Skip to content

Build bootstrap with an explicit target#155771

Open
chenyukang wants to merge 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-155651-bootstrap-build-target
Open

Build bootstrap with an explicit target#155771
chenyukang wants to merge 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-155651-bootstrap-build-target

Conversation

@chenyukang
Copy link
Copy Markdown
Member

@chenyukang chenyukang commented Apr 25, 2026

Fixes #155651

@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 Apr 25, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 25, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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
Copy link
Copy Markdown
Member

Kobzol commented Apr 25, 2026

This sounds like a hack to make bootstrap match a specific kind of Cargo config. We should instead ask Cargo where was the generated binary stored, or use cargo run, or something like that.

@chenyukang chenyukang force-pushed the yukang-fix-155651-bootstrap-build-target branch 2 times, most recently from 8d9b418 to dfe540e Compare April 25, 2026 11:06
@chenyukang chenyukang closed this Apr 25, 2026
@chenyukang chenyukang force-pushed the yukang-fix-155651-bootstrap-build-target branch from dfe540e to 7e0430f Compare April 25, 2026 12:00
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 25, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 25, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@chenyukang
Copy link
Copy Markdown
Member Author

chenyukang commented Apr 25, 2026

oh, I did something wrong on Git and closed it.

@chenyukang chenyukang reopened this Apr 25, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 25, 2026
@rust-log-analyzer

This comment has been minimized.

@chenyukang chenyukang force-pushed the yukang-fix-155651-bootstrap-build-target branch from 12db296 to d46bb0d Compare April 25, 2026 13:00
@rust-log-analyzer

This comment has been minimized.

@chenyukang chenyukang force-pushed the yukang-fix-155651-bootstrap-build-target branch from d46bb0d to 6985a7e Compare April 25, 2026 14:03
@chenyukang
Copy link
Copy Markdown
Member Author

This sounds like a hack to make bootstrap match a specific kind of Cargo config. We should instead ask Cargo where was the generated binary stored, or use cargo run, or something like that.

This is not trying to guess an arbitrary Cargo output path. We explicitly pass --target self.build, so the bootstrap binary location follows Cargo’s normal target-dir layout under CARGO_TARGET_DIR//debug. This relies on Cargo’s standard target-dir layout.

I tried to use cargo run directly, it will involve more changes because of CI testing.

By “ask Cargo where the generated binary was stored”, do you mean using Cargo’s JSON messages and reading the compiler-artifact.executable field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x.py fails if .cargo/config configures build.target

5 participants