-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
macOS wrapped_clang should export ZERO_AR_DATE=1 to make linking hermetic #10886
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Rules-CPP
Issues for C++ rules
type: feature request
Comments
A workaround for now is to call the build with |
brentleyjones
changed the title
macOS wrapped_clang should set ZERO_AR_DATE=1 to make linking hermetic
macOS wrapped_clang should export ZERO_AR_DATE=1 to make linking hermetic
Mar 2, 2020
oquenchil
added
P3
We're not considering working on this, but happy to review a PR. (No assignee)
type: feature request
and removed
untriaged
labels
Mar 13, 2020
thii
added a commit
to thii/bazel
that referenced
this issue
Jul 27, 2020
it. Xcode 10.2 adds a new flag `-D` to libtool that sets archive contents' user ids, group ids, dates, and file modes to reasonable defaults. This patch adds this new flag to all libtool actions to when they're built with a version of libtool that supports this mode, to ensure hemertic results for linking actions. Note that this new flag covers the functionality of the `ZERO_AR_DATE` environment variable, but this variable is still being left in the libtool wrapper for backward-compatibility with older versions. Fixes bazelbuild#10886. RENOTES: None.
thii
added a commit
to thii/bazel
that referenced
this issue
Aug 14, 2020
it. Xcode 10.2 adds a new flag `-D` to libtool that sets archive contents' user ids, group ids, dates, and file modes to reasonable defaults. This patch adds this new flag to all libtool actions to when they're built with a version of libtool that supports this mode, to ensure hemertic results for linking actions. Note that this new flag covers the functionality of the `ZERO_AR_DATE` environment variable, but this variable is still being left in the libtool wrapper for backward-compatibility with older versions. Fixes bazelbuild#10886. RENOTES: None.
This is still an issue, btw. While libtool uses |
PR to fix the link action #13091 |
bazel-io
pushed a commit
that referenced
this issue
Feb 26, 2021
This variable disables timestamps in archives and binary links in Apple's toolchain. Previously this was set for archives but not the links themselves. Relevant logic in ld64: https://github.com/keith/ld64/blob/86955a06a7e8e0d18ab28e521aa1122bfecd05a9/src/ld/Options.cpp#L4420-L4422 Fixes the other half of #10886 Closes #13091. PiperOrigin-RevId: 359724927
siddharthab
pushed a commit
to grailbio/rules_r
that referenced
this issue
Apr 10, 2021
LLVM versions on macOS have been updated to be past LLVM 7, so -fdebug-prefix-map now works as expected and the reproducibility tests can be re-enabled. Now, we just need to set ZERO_AR_DATE=1 (thanks @chrchang). Also see bazelbuild/bazel#10886 There is still a problem with the version of `install_name_tool` shipped with Xcode CLT, and therefore we are starting to distribute a newer version of `install_name_tool` in this project.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Rules-CPP
Issues for C++ rules
type: feature request
Description of the problem / feature request:
wrapped_clang
, unlikebazel/libtool
, doesn't exportZERO_AR_DATE=1
. This causes timestamps to be embedded in linked binaries.Feature requests: what underlying problem are you trying to solve with this feature?
wrapped_clang
should exportZERO_AR_DATE=1
.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
On macOS, using the Xcode toolchain:
The binaries will report differences because of the embedded timestamps.
What operating system are you running Bazel on?
macOS
What's the output of
bazel info release
?release 2.1.0
Have you found anything relevant by searching the web?
bazelbuild/rules_swift#136
bazelbuild/rules_swift#120
bazel/tools/objc/libtool.sh
Line 115 in 0e1100f
Any other information, logs, or outputs that you want to share?
http://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html
The above blog mentions setting this value to remove the timestamps.
The text was updated successfully, but these errors were encountered: