mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 17:14:00 +00:00
rustPlatform.buildRustPackage: provide debug symbols on darwin (#327136)
This commit is contained in:
commit
a50dabe867
@ -97,6 +97,11 @@ assert useSysroot -> !(args.doCheck or true);
|
||||
|
||||
stdenv.mkDerivation ((removeAttrs args [ "depsExtraArgs" "cargoUpdateHook" "cargoLock" ]) // lib.optionalAttrs useSysroot {
|
||||
RUSTFLAGS = "--sysroot ${sysroot} " + (args.RUSTFLAGS or "");
|
||||
} // lib.optionalAttrs (stdenv.isDarwin && buildType == "debug") {
|
||||
RUSTFLAGS =
|
||||
"-C split-debuginfo=packed "
|
||||
+ lib.optionalString useSysroot "--sysroot ${sysroot} "
|
||||
+ (args.RUSTFLAGS or "");
|
||||
} // {
|
||||
inherit buildAndTestSubdir cargoDeps;
|
||||
|
||||
|
@ -36,6 +36,11 @@ cargoInstallHook() {
|
||||
-maxdepth 1 \
|
||||
-regex ".*\.\(so.[0-9.]+\|so\|a\|dylib\)" \
|
||||
-print0 | xargs -r -0 cp -t $out/lib
|
||||
|
||||
# If present, copy any .dSYM directories for debugging on darwin
|
||||
# https://github.com/NixOS/nixpkgs/issues/330036
|
||||
find "${releaseDir}" -maxdepth 1 -name '*.dSYM' -exec cp -RLt $out/bin/ {} +
|
||||
|
||||
rmdir --ignore-fail-on-non-empty $out/lib $out/bin
|
||||
runHook postInstall
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user