Skip to content

cargo run doesn't rebuild bootstrap binaries #95141

Closed as not planned
Closed as not planned
@jyn514

Description

@jyn514

Currently, cargo run has a big footgun: if you modify src/bootstrap/bin/rustc.rs (or rustdoc.rs), it won't be rebuilt until you manually run cargo build --bins. I tried avoiding this in #94828 by running that automatically in bootstrap, but it discards various linker arguments and environment variables that prevent people from configuring the build.

A better solution is to introduce a binary that dispatches to different main functions, like rustup. If called as bootstrap it would run the main builder; if called as rustc or rustdoc it would run the logic currently in rustc.rs / rustdoc.rs; if called by any other name it should give a hard error.

cc #94828 (comment), #94829

I am happy to help mentor this work.

@rustbot label: +A-rustbuild +C-enhancement +E-mentor +E-help-wanted

Metadata

Metadata

Assignees

Labels

C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-help-wantedCall for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions