Skip to content

Commit 268898d

Browse files
authored
mkCargoDerivation: set noCompressDebugSectionsSet on darwin (#941)
1 parent 2f8fc22 commit 268898d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
* **Breaking**: dropped compatibility for Nix versions below 2.31.2
1111
* **Breaking**: dropped compatibility for nixpkgs-25.05
1212

13+
### Fixed
14+
* `mkCargoDerivation` will now set `noCompressDebugSectionsSet` to disable
15+
compressing debug sections (when `remapPathPrefixHook` is active and running)
16+
on platforms which do not support it
17+
1318
## [0.21.3] - 2025-12-04
1419

1520
### Added

lib/mkCargoDerivation.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ chosenStdenv.mkDerivation (
100100
# access. Directory structure should basically follow the output of `cargo vendor`.
101101
cargoVendorDir = args.cargoVendorDir or (vendorCargoDeps args);
102102

103+
# compressing debug sections is only supported on elf formats (i.e. not darwin)
104+
noCompressDebugSectionsSet =
105+
args.noCompressDebugSectionsSet
106+
or (lib.optionalString (chosenStdenv.hostPlatform.parsed.kernel.execFormat.name != "elf") "1");
107+
103108
nativeBuildInputs =
104109
(args.nativeBuildInputs or [ ])
105110
++ (crossEnv.nativeBuildInputs or [ ])

0 commit comments

Comments
 (0)