-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Description
Describe the bug
cargo 1.77 started stripping debuginfo by default for cargo build --release
in order to make Rust binaries smaller by default, but on macOS, if somehow the "wrong" (GNU binutils ~2.41, I believe?) strip
gets into the PATH, the strip
call will result in a segfaulting binary when executed. nixpkgs does try to work around this already, and things work fine when the "right" strip
is the path.
based on bug reports from macOS users, this is often not enough for many actually-extant user configurations. macOS users that use Nix are running into this anyways, due to their PATH rearranging (possibly after entering a nix shell? flake? no idea...). it is possible some specific Nix-based tooling is causing the problem, as a result, and not nixpkgs per se, but we have not gotten enough information from reports to narrow this down... it's simultaneously pervasive and elusive, despite the known reasons.
I decided to file this bug, even though it is incredibly vague, because you may wish to figure out a position on this issue before you land an upgrade to the Rust 1.77 toolchain for nixpkgs, and because people seem to prefer opening the issue against rust-lang as it regresses on the latest version of the toolchain, despite being a preexisting issue (i.e. the "wrong strip" could already be a problem if someone enabled it in their Cargo.toml's build settings, or used it "by hand"). please feel free to close it whenever.
Steps To Reproduce
steps to reproduce the behavior:
- put the GNU strip first in the PATH while on macOS
- set up the rust 1.77 toolchain
cargo run --release
technically this also happens with compiling a C program and stripping it "manually", etc.
Expected behavior
printing "Hello world!", probably.
Screenshots
nah.
Additional context
apparently homebrew also sometimes causes this problem.
Notify maintainers
idk who should be bothered over this.
Metadata
not applicable.
Add a 👍 reaction to issues you find important.