Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include version number of libs being built in cargo lib metadata (esp. librustc_driver*.so) #137036

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,12 @@ impl Builder<'_> {
Mode::Codegen => metadata.push_str("codegen"),
_ => {}
}
// `rustc_driver`'s version number is always `0.0.0`, which can cause linker search path
// problems on side-by-side installs because we don't include the version number of the
// `rustc_driver` being built. This can cause builds of different version numbers to produce
// `librustc_driver*.so` artifacts that end up with identical filename hashes.
metadata.push_str(&self.version);

cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata);

if cmd_kind == Kind::Clippy {
Expand Down
Loading