Skip to content

Treat all proc macro dependencies as host dependencies in bootstrap - #165641

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Kobzol:proc-macros-deps
Nov 16, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Kobzol:proc-macros-deps

Conversation

@Kobzol

@Kobzol Kobzol commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

View all comments

I think that the name Host was not fully accurate, and we were only adding proc macros as Host deps anyway. This PR renames Host to ProcMacro, and records all proc macro dependencies produced by cargo in bootstrap builds. So even if you cross-compile from T1 to T2, and you build proc macros for both T1 and T2, we will now record also proc macros for T2 to be Host/ProcMacro dependencies. So they should be correctly filtered when assembling the toolchain.

Kinda hard to tell if this won't break anything, but at least when cross-compiling compiler and library, the deps looked reasonable to me.

Fixes: #165478

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 8, 2026
@rustbot

rustbot commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789, jieyouxu

@Kobzol

Kobzol commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=dist-x86_64-linux,dist-s390x-linux

rust-bors Bot pushed a commit that referenced this pull request Nov 8, 2026
Treat all proc macro dependencies as host dependencies in bootstrap


try-job: dist-x86_64-linux
try-job: dist-s390x-linux
@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bjorn3

bjorn3 commented Nov 8, 2026

Copy link
Copy Markdown
Member

I think this causes the target proc-macros to be omitted from rustc-dev, breaking rustc-dev.

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2026
@rust-bors

rust-bors Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 281011f failed: CI. Failed job:

@Kobzol

Kobzol commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=dist-x86_64-linux,dist-s390x-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 9, 2026
Treat all proc macro dependencies as host dependencies in bootstrap


try-job: dist-x86_64-linux
try-job: dist-s390x-linux
@rust-bors

rust-bors Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 54ebbd7 (54ebbd7a7f69c528472653a7eeb80ac3d83ea368)
Base parent: 4de0e38 (4de0e38612353dc524009a12ad43f0c05a5f8c6e)

@Kobzol

Kobzol commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

@rust-timer build=54ebbd7a7f69c528472653a7eeb80ac3d83ea368

@rust-timer

Copy link
Copy Markdown
Collaborator

Unknown rust-timer command: build=54ebbd7a7f69c528472653a7eeb80ac3d83ea368

@Kobzol

Kobzol commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

@rust-timer build 54ebbd7

@rust-timer

Copy link
Copy Markdown
Collaborator

Missing artifact for sha 54ebbd7a7f69c528472653a7eeb80ac3d83ea368 (https://ci-artifacts.rust-lang.org/rustc-builds/54ebbd7a7f69c528472653a7eeb80ac3d83ea368/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz); not built yet, try again later.

@Kobzol

Kobzol commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 10, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
Treat all proc macro dependencies as host dependencies in bootstrap
@Kobzol

Kobzol commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Ok, the 390x archive no longer contains the proc macros, but rustc-dev still contains them, good. Btw rust-lld has ~167 MiB because of the static LLVM linking, yikes.

@Kobzol

Kobzol commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

@rustbot ready

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 10, 2026
@rust-bors

rust-bors Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 69ae83c (69ae83c4247980676869da36e1a3948050efcf7a)
Base parent: 6f1c7ee (6f1c7ee0ec0ea64802f4b7a184b63b7efb645b3b)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (69ae83c): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

Results (primary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.4% [-3.1%, -1.7%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.4% [-3.1%, -1.7%] 2

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 483.518s -> 483.731s (0.04%)
Artifact size: 407.10 MiB -> 406.46 MiB (-0.16%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 10, 2026

@jieyouxu jieyouxu left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. r=me with a nit.

@rustbot author

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 14, 2026
@Kobzol

Kobzol commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

@bors r=jieyouxu

@rust-bors

rust-bors Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 911d542 has been tentatively approved by jieyouxu

It will be put into the queue for this repository once PR CI succeeds.

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

Reason for tree closure: consistent failures on main

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 14, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Nov 14, 2026
Treat all proc macro dependencies as host dependencies in bootstrap

I think that the name `Host` was not fully accurate, and we were only adding proc macros as Host deps anyway. This PR renames Host to ProcMacro, and records *all* proc macro dependencies produced by cargo in bootstrap builds. So even if you cross-compile from T1 to T2, and you build proc macros for both T1 and T2, we will now record also proc macros for T2 to be Host/ProcMacro dependencies. So they should be correctly filtered when assembling the toolchain.

Kinda hard to tell if this won't break anything, but at least when cross-compiling compiler and library, the deps looked reasonable to me.

Fixes: rust-lang#165478
jhpratt added a commit to jhpratt/rust that referenced this pull request Nov 14, 2026
Treat all proc macro dependencies as host dependencies in bootstrap

I think that the name `Host` was not fully accurate, and we were only adding proc macros as Host deps anyway. This PR renames Host to ProcMacro, and records *all* proc macro dependencies produced by cargo in bootstrap builds. So even if you cross-compile from T1 to T2, and you build proc macros for both T1 and T2, we will now record also proc macros for T2 to be Host/ProcMacro dependencies. So they should be correctly filtered when assembling the toolchain.

Kinda hard to tell if this won't break anything, but at least when cross-compiling compiler and library, the deps looked reasonable to me.

Fixes: rust-lang#165478
rust-bors Bot pushed a commit that referenced this pull request Nov 16, 2026
…uwer

Rollup of 23 pull requests

Successful merges:

 - #165928 (Replace most uses of `type_array` with `type_byte_array` in `rustc_codegen_llvm`)
 - #160618 (require a consistent codegen backend when -Zllvm-target-feature is present)
 - #161950 (Ensure floats are returned losslessly by the C ABI on 32-bit x86)
 - #162267 (Fix an edge within `std::fs::create_dir_all` for certain platforms that views trailing cur dir components as a separate missing directory components)
 - #164043 (alloc: Unstably add `Vec::repeat` and `Vec::repeat_in`)
 - #164808 (asm const ptr: move name generation to asm-specific logic)
 - #164823 (Use `DerefMut` and `IndexMut` before `&raw mut` autoborrow)
 - #165568 (rustdoc: Suggest corrections for reference label typos)
 - #165641 (Treat all proc macro dependencies as host dependencies in bootstrap)
 - #165924 (rustc_codegen_gcc subtree update 2026-11-13)
 - #165927 (Remove `const_struct` from `rustc_codegen_ssa`)
 - #163696 (Stabilize `int_from_ascii`)
 - #163882 (docs(vec): clarify into_boxed_slice allocation guarantee)
 - #164362 (Emit note for `non_exhaustive` within defining crate for `unreachable_patterns`)
 - #164465 (Under `guard_patterns` allow parenthesized guarded patterns in match arms)
 - #164997 (Fix as str suggestion in subpattern)
 - #165825 (make `Complex<x87_f80>` ABI-compatible with C)
 - #165868 (Small changes to dyn compatibility)
 - #165879 (Add `#[rustc_test_entrypoint_marker]` back !)
 - #165902 (Add allocator() to vec_deque::IntoIter and vec_deque::Drain)
 - #165903 (Fix borrowck ICE when a borrow outlives a local in a const block)
 - #165914 (Use `trim_prefix` in bootstrap)
 - #165919 (tests: accept better behavior on underaligned accesses)

Failed merges:

 - #165893 (Prune un/under used methods of `ast::Attribute`)
rust-bors Bot pushed a commit that referenced this pull request Nov 16, 2026
…uwer

Rollup of 23 pull requests

Successful merges:

 - #165928 (Replace most uses of `type_array` with `type_byte_array` in `rustc_codegen_llvm`)
 - #160618 (require a consistent codegen backend when -Zllvm-target-feature is present)
 - #161950 (Ensure floats are returned losslessly by the C ABI on 32-bit x86)
 - #162267 (Fix an edge within `std::fs::create_dir_all` for certain platforms that views trailing cur dir components as a separate missing directory components)
 - #164043 (alloc: Unstably add `Vec::repeat` and `Vec::repeat_in`)
 - #164808 (asm const ptr: move name generation to asm-specific logic)
 - #164823 (Use `DerefMut` and `IndexMut` before `&raw mut` autoborrow)
 - #165568 (rustdoc: Suggest corrections for reference label typos)
 - #165641 (Treat all proc macro dependencies as host dependencies in bootstrap)
 - #165924 (rustc_codegen_gcc subtree update 2026-11-13)
 - #165927 (Remove `const_struct` from `rustc_codegen_ssa`)
 - #163696 (Stabilize `int_from_ascii`)
 - #163882 (docs(vec): clarify into_boxed_slice allocation guarantee)
 - #164362 (Emit note for `non_exhaustive` within defining crate for `unreachable_patterns`)
 - #164465 (Under `guard_patterns` allow parenthesized guarded patterns in match arms)
 - #164997 (Fix as str suggestion in subpattern)
 - #165825 (make `Complex<x87_f80>` ABI-compatible with C)
 - #165868 (Small changes to dyn compatibility)
 - #165879 (Add `#[rustc_test_entrypoint_marker]` back !)
 - #165902 (Add allocator() to vec_deque::IntoIter and vec_deque::Drain)
 - #165903 (Fix borrowck ICE when a borrow outlives a local in a const block)
 - #165914 (Use `trim_prefix` in bootstrap)
 - #165919 (tests: accept better behavior on underaligned accesses)

Failed merges:

 - #165893 (Prune un/under used methods of `ast::Attribute`)
@rust-bors
rust-bors Bot merged commit 835f9e8 into rust-lang:main Nov 16, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 16, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 16, 2026
Rollup merge of #165641 - Kobzol:proc-macros-deps, r=jieyouxu

Treat all proc macro dependencies as host dependencies in bootstrap

I think that the name `Host` was not fully accurate, and we were only adding proc macros as Host deps anyway. This PR renames Host to ProcMacro, and records *all* proc macro dependencies produced by cargo in bootstrap builds. So even if you cross-compile from T1 to T2, and you build proc macros for both T1 and T2, we will now record also proc macros for T2 to be Host/ProcMacro dependencies. So they should be correctly filtered when assembling the toolchain.

Kinda hard to tell if this won't break anything, but at least when cross-compiling compiler and library, the deps looked reasonable to me.

Fixes: #165478
@Kobzol
Kobzol deleted the proc-macros-deps branch November 16, 2026 06:51
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (7aeb102): comparison URL.

Overall result: ❌ regressions - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.0%, 0.5%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Artifact size: 406.16 MiB -> 406.17 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Nov 16, 2026
@lqd

lqd commented Nov 16, 2026

Copy link
Copy Markdown
Member

Looks like include-blob noise for many of the members of the rollup

@cuviper

cuviper commented Nov 16, 2026

Copy link
Copy Markdown
Member

Btw rust-lld has ~167 MiB because of the static LLVM linking, yikes.

Yeah, I think we should change to dynamic LLVM everywhere we can.

sushink70 pushed a commit to sushink70/miri that referenced this pull request Nov 17, 2026
…uwer

Rollup of 23 pull requests

Successful merges:

 - rust-lang/rust#165928 (Replace most uses of `type_array` with `type_byte_array` in `rustc_codegen_llvm`)
 - rust-lang/rust#160618 (require a consistent codegen backend when -Zllvm-target-feature is present)
 - rust-lang/rust#161950 (Ensure floats are returned losslessly by the C ABI on 32-bit x86)
 - rust-lang/rust#162267 (Fix an edge within `std::fs::create_dir_all` for certain platforms that views trailing cur dir components as a separate missing directory components)
 - rust-lang/rust#164043 (alloc: Unstably add `Vec::repeat` and `Vec::repeat_in`)
 - rust-lang/rust#164808 (asm const ptr: move name generation to asm-specific logic)
 - rust-lang/rust#164823 (Use `DerefMut` and `IndexMut` before `&raw mut` autoborrow)
 - rust-lang/rust#165568 (rustdoc: Suggest corrections for reference label typos)
 - rust-lang/rust#165641 (Treat all proc macro dependencies as host dependencies in bootstrap)
 - rust-lang/rust#165924 (rustc_codegen_gcc subtree update 2026-11-13)
 - rust-lang/rust#165927 (Remove `const_struct` from `rustc_codegen_ssa`)
 - rust-lang/rust#163696 (Stabilize `int_from_ascii`)
 - rust-lang/rust#163882 (docs(vec): clarify into_boxed_slice allocation guarantee)
 - rust-lang/rust#164362 (Emit note for `non_exhaustive` within defining crate for `unreachable_patterns`)
 - rust-lang/rust#164465 (Under `guard_patterns` allow parenthesized guarded patterns in match arms)
 - rust-lang/rust#164997 (Fix as str suggestion in subpattern)
 - rust-lang/rust#165825 (make `Complex<x87_f80>` ABI-compatible with C)
 - rust-lang/rust#165868 (Small changes to dyn compatibility)
 - rust-lang/rust#165879 (Add `#[rustc_test_entrypoint_marker]` back !)
 - rust-lang/rust#165902 (Add allocator() to vec_deque::IntoIter and vec_deque::Drain)
 - rust-lang/rust#165903 (Fix borrowck ICE when a borrow outlives a local in a const block)
 - rust-lang/rust#165914 (Use `trim_prefix` in bootstrap)
 - rust-lang/rust#165919 (tests: accept better behavior on underaligned accesses)

Failed merges:

 - rust-lang/rust#165893 (Prune un/under used methods of `ast::Attribute`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bootstrap: cross-built rustc dist includes proc-macros in lib/

8 participants