fix(ar): deterministic archives with D modifier#1697
fix(ar): deterministic archives with D modifier#1697NobodyXu merged 2 commits intorust-lang:mainfrom
D modifier#1697Conversation
| // Not all ar implementations support it, so we try with `D` first | ||
| // and fall back without it. | ||
| if !run_silent(cmd.arg("cqD").arg(dst).args(objs)) { | ||
| let (mut cmd, _, _) = self.try_get_archiver_and_flags()?; |
There was a problem hiding this comment.
It seems that we already set this, just before the if?
There was a problem hiding this comment.
Command doesn't implemented Clone, unfortunately.
There was a problem hiding this comment.
Thanks, in that case shall we remove that env setting, given that we use option D then?
There was a problem hiding this comment.
See the simplified version :)
The `cq` path already sets this for determinism on macOS, but the subsequent `ar s` step was missing it.
| // Not all ar implementations support it, so we try with `D` first | ||
| // and fall back without it. | ||
| if !run_silent(cmd.arg("cqD").arg(dst).args(objs)) { | ||
| let (mut cmd, _, _) = self.try_get_archiver_and_flags()?; |
There was a problem hiding this comment.
Command doesn't implemented Clone, unfortunately.
Try the `D` modifier which zeros out timestamps in archive headers. Fall back to the previous behavior if not supported. See <rust-lang#1696>
|
Hi, I maintain the project https://github.com/Orange-OpenSource/hurl, I try to identify some new warnings on macOS / Sequoia: $ cargo build
...
warning: [email protected]: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar: illegal option -- D
warning: [email protected]: usage: ar -d [-TLsv] archive file ...
warning: [email protected]: ar -m [-TLsv] archive file ...
warning: [email protected]: ar -m [-abiTLsv] position archive file ...
warning: [email protected]: ar -p [-TLsv] archive [file ...]
warning: [email protected]: ar -q [-cTLsv] archive file ...
warning: [email protected]: ar -r [-cuTLsv] archive file ...
warning: [email protected]: ar -r [-abciuTLsv] position archive file ...
warning: [email protected]: ar -t [-TLsv] archive [file ...]
warning: [email protected]: ar -x [-ouTLsv] archive [file ...]
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.03sThis warning happens when I'm upgrading cc from 1.2.58 to 1.2.59: With 1.2.58: $ cargo build
Compiling cc v1.2.58
Compiling openssl-sys v0.9.112
Compiling libz-sys v1.1.25
Compiling curl-sys v0.4.87+curl-8.19.0
Compiling hurl v8.0.0-SNAPSHOT (/Users/jc/Documents/Dev/hurl/packages/hurl)
Compiling curl v0.4.49
Finished `dev` profile [unoptimized + debuginfo] target(s) in 8.17sJust updating to 1.2.59: $ cargo build
Updating crates.io index
Locking 1 package to latest compatible version
Updating cc v1.2.58 -> v1.2.59
warning: [email protected]: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar: illegal option -- D
warning: [email protected]: usage: ar -d [-TLsv] archive file ...
warning: [email protected]: ar -m [-TLsv] archive file ...
warning: [email protected]: ar -m [-abiTLsv] position archive file ...
warning: [email protected]: ar -p [-TLsv] archive [file ...]
warning: [email protected]: ar -q [-cTLsv] archive file ...
warning: [email protected]: ar -r [-cuTLsv] archive file ...
warning: [email protected]: ar -r [-abciuTLsv] position archive file ...
warning: [email protected]: ar -t [-TLsv] archive [file ...]
warning: [email protected]: ar -x [-ouTLsv] archive [file ...]
Compiling hurl v8.0.0-SNAPSHOT (/Users/jc/Documents/Dev/hurl/packages/hurl)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 8.73sI've this impression that this issue is related to this PR, but maybe I'm mistaken... |
|
Yes. That is from this PR. We might need to suppress the first probe invocation, if failed. |
|
The warning doesn't really matter on macOS for the default archiver though. No need to revert unless you feel annoyed by those should-be-silented warnings |
Try the
Dmodifier which zeros out timestamps in archive headers.Fall back to the previous behavior if not supported.
Fixes #1696