-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
darwin stdenv's ld -no_uuid
linker flag breaks normal symbolication for debugging + profiling
#178366
Comments
Quick update: I managed to work around this issue again in my current project, via two additional project-specific overrides:
but getting all of this worked out was rather painful and involved both quite detailed
and lots of experimentation. |
This is a problem for us.
To quote:
From my limited testing on aarch64-darwin, the UUID seems to be stable for Edit: Actually scratch that, the UUIDs for |
I took a stab at the issue and opened #188347. |
@zhaofengli — thanks for working on this issue! I haven’t had a chance to test your PR yet but it looks like a really promising approach! |
This bug required an ugly workaround for the tinygo package on Darwin: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/tinygo/0003-Use-out-path-as-build-id-on-darwin.patch If CC @muscaln |
This is to support NixOS, who have added -no_uuid to the linker. Upstream bug report: NixOS/nixpkgs#178366
This is to support NixOS, who have added -no_uuid to the linker. Upstream bug report: NixOS/nixpkgs#178366
This is to support NixOS, who have added -no_uuid to the linker. Upstream bug report: NixOS/nixpkgs#178366
This is to support NixOS, who have added -no_uuid to the linker. Upstream bug report: NixOS/nixpkgs#178366
#188347 is the default since 23.11. Is this issue resolved now? |
Closing since this should be fixed by #188347. |
Describe the bug
#77632 made builds on darwin reproducible (yay!) in part by causing the darwin stdenv’s cc wrapper to set the
-no_uuid
linker flag so as to avoid random uuid build-ids being added to all compiled binaries and libraries.Unfortunately, while setting this flag was effective for improving reproducibility, I think (and will hopefully soon test) that setting it also had the side-effect of breaking symbolication of binaries built with the resulting toolchain, for example, interfering with profiling them with
Instruments
or debugging them withlldb
.Desired resolution
Ideally, I imagine we’d find a way to set UUIDs deterministically, I suppose a little bit like how placeholder hash insertion works.
Failing that, in the shorter term, I'd love for there to be a well-documented way to remove the
-no_uuid
flag so that users who want UUIDs can readily obtain them or, I suppose, to add new UUIDs after the fact?Anyway, what I've found so far is: in simple situations, overriding via an overlay can help, like so:
however, I'm still struggling to make this approach work well with more complex situations, for example, using https://github.com/oxalica/rust-overlay.
(There, trying to use this simple approach runs in to difficulty because it's not clear where and how to override the darwin stdenv: trying to do so alongside a new build isn't quite enough because (at least the way I'm loading it) the rust-overlay captures the wrong stdenv; however, trying to do so via an earlier overlay runs into challenges with the staged structure of the darwin stdenv, such that the
cc = prev.stdenv.cc.overrideAttrs
override can fail becauseprev.stdenv.cc
is set to the string"/dev/null"
in early stages, and hence has nooverrideAttrs
attr itself.)Note: you can test whether or not built binaries have uuids in a variety of ways, including
which exit with success and will print nothing when UUIDs are missing, or by using any of a variety of other DWARF tools, searching for the
LC_UUID
tag.Notify maintainers
cc: @thefloweringash @LnL7
The text was updated successfully, but these errors were encountered: