Add best effort macOS reproducibility flags#692
Open
keith wants to merge 2 commits intobazelbuild:mainfrom
Open
Add best effort macOS reproducibility flags#692keith wants to merge 2 commits intobazelbuild:mainfrom
keith wants to merge 2 commits intobazelbuild:mainfrom
Conversation
Member
Author
i think we're past those enough to not worry about that anymore |
armandomontanez
approved these changes
Apr 16, 2026
Collaborator
armandomontanez
left a comment
There was a problem hiding this comment.
Nice! Would be nice to do similar with Linux with the caveat that toolchains are much more diverse in that world.
Collaborator
|
Might be worth discussing toolchain configuration compatibility expectations at the next sync. Added to the agenda. |
Member
Author
|
that is actually somewhat solved today by this: rules_cc/cc/private/link/finalize_link_action.bzl Lines 363 to 366 in 1a5d8a3 |
Member
Author
|
as discussed in the meeting today I updated this to dynamically check if this feature is supported |
lilygorsheneva
previously approved these changes
Apr 21, 2026
Without `-ffile-compilation-dir=.` (or a similar flag), debug info in `.o` files contains the absolute path to the compile time execroot. Without `-Wl,-oso_prefix,.` final binaries contain `N_OSO` stabs that contain absolute paths to the files link time execroot. This still leaves 1 known hole that is the absolute path to Xcode is embedded in debug info, but that doesn't break debuggability like these 2 issues do, it just makes the binaries non hermetic. Fixing that one requires a compiler wrapper. All of these issues are fixed in apple_support, but for folks not using that toolchain these are pretty low risk to add here. The only issue is if people have very old versions of Xcode / the Xcode command line tools these flags won't exist. More info about these paths in https://www.smileykeith.com/2025/09/21/understanding-apple-debug-info/
208bc4d to
ddfdc07
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without
-ffile-compilation-dir=.(or a similar flag), debug info in.ofiles contains the absolute path to the compile time execroot.Without
-Wl,-oso_prefix,.final binaries containN_OSOstabs thatcontain absolute paths to the files link time execroot.
This still leaves 1 known hole that is the absolute path to Xcode is
embedded in debug info, but that doesn't break debuggability like these
2 issues do, it just makes the binaries non hermetic. Fixing that one
requires a compiler wrapper.
All of these issues are fixed in apple_support, but for folks not using
that toolchain these are pretty low risk to add here. The only issue is
if people have very old versions of Xcode / the Xcode command line tools
these flags won't exist.
More info about these paths in https://www.smileykeith.com/2025/09/21/understanding-apple-debug-info/