-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
C-bugCategory: bugCategory: bugE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Experience needed to fix: Medium / intermediateCall for participation: Experience needed to fix: Medium / intermediate
Description
Please complete the following tasks
- I have searched the discussions
- I have searched the open and rejected issues
Rust Version
rustc 1.92.0-nightly (f6aa851db 2025-10-07)
Clap Version
HEAD, 4.5.49
Minimal reproducible code
cargo build
Steps to reproduce the bug with the above code
cd clap/cargo_builder && cargo build --release
cd ../../clap2/cargo_builder && cargo build --release
cd ../..
bcomp (or diff) clap/target/release/libclap_builder.rlib clap2/target/release/libclap_builder.rlib
Actual Behaviour
- absolute paths to the source tree are embedded in the rlib, even in release mode
- there are at least several hundred other hex differences (some look like padding, perhaps garbage or uninitialized)
Expected Behaviour
Two cargo builds in different source trees on the same host on the same version result in binary-identical rlibs.
Additional Context
This causes distributed build, cache, and test systems like Bazel to be less efficient. Because the clap_builder dependency in a binary may be different across hosts, the resulting binary will hash differently and expensive tests may be rerun. No other clap crate has this issue.
Debug Output
No response
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Experience needed to fix: Medium / intermediateCall for participation: Experience needed to fix: Medium / intermediate