-
Notifications
You must be signed in to change notification settings - Fork 275
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
on macOS isysroot should be set to a stable execroot relative path #966
Comments
FWIW swiftc emits the SDK path here, it may be best contributing to Swift directly. |
Question: if you set the I don't think we can generally assume any particular stable symlink exists (different teams will do this differently, and indeed may prefer a path to the exact xcode version for reproducibility of debugging), but perhaps we can document some suggested best practices. |
I'm suggesting that as part of |
Such a symlink would have be created under |
I believe
|
Can you debug binaries with a relative sysroot directory? |
You might have to set |
I'll look into modifying |
|
@DavidGoldman - do you think that an execroot-relative isysroot is feasible? |
Ah, I completely missed the objc/clang part of this. Hmm, we could try to use a symlink for Another option would be to upstream changes to Clang to allow -debug-prefix-map to apply to these paths if it doesn't already, and then remap them in the debugger. |
FWIW I made swift remap isysroot with debug-prefix-map (this isn't released and currently rules_swift does not pass a remapping for this) swiftlang/swift#32580 does anyone know right now if that doesn't work for clang? |
From a quick check it looks like Clang supports remapping the sysroot here but not the SDK path? EDIT: Ah looks like the SDK is the just the SDK name, e.g. MacOSX.sdk You could test this out by adding the following line here:
and then you'd need to remap |
From Adrian's reply it seems LLDB doesn't rely upon that value for Swift? swiftlang/swift#32580 (review) Wonder if it's the same for Clang as well. We might be okay with just using debug-prefix-map to remap the sysroot values to a constant without remapping in the debugger. |
Yea for us we do still set that in our lldbinit, so we'd prefer the values be scrubbed, but yea it would be great if that would work for everyone too! |
Posted on the swift forums: https://forums.swift.org/t/lldb-usage-of-dw-at-llvm-isysroot/40575 |
Through some more testing with Swift I found many of these entries, that were also able to be remapped:
AFAICT remapping this in the binary has no impact on debugging. |
These features should fix this bazelbuild/bazel#12175 bazelbuild/rules_swift#511 Note with Swift there was a bug where debug-prefix-map didn't apply to sysroot, it has been fixed but not made it to Xcode yet. |
Description of the problem / feature request:
isysroot
should be set to a stable exec root relative path (such as a symlink to the real Xcode SDK) to prevent the path of the build machine's Xcode from being embedded in build artifacts.Currently
isysroot
is set to__BAZEL_XCODE_SDKROOT__
, which currently resolves to something like/Applications/Xcode-11.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
. This causes paths like/Applications/Xcode-11.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/dispatch
being embedded into artifacts when they contain debug symbols.Feature requests: what underlying problem are you trying to solve with this feature?
Making this change would make macOS debug or dSYM generating targets more reproducible.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
On macOS:
The
.o
files compiled will have embedded paths, generated byDW_AT_LLVM_isysroot
, pointing to machine specific paths for Xcode.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?
None
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 text was updated successfully, but these errors were encountered: