Skip to content

Commit

Permalink
build: strip compiler references from runtime closure
Browse files Browse the repository at this point in the history
Sourced from NixOS/nixpkgs#375030

Fixes: https://git.lix.systems/lix-project/lix/issues/699
Change-Id: Id215437a6519a140dd91127cbd6c2b518f34a397
  • Loading branch information
getchoo committed Feb 27, 2025
1 parent d037b9e commit 8082f0b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
pkg-config,
python3,
rapidcheck,
removeReferencesTo,
rustPlatform,
rustc,
sqlite,
Expand Down Expand Up @@ -263,6 +264,8 @@ stdenv.mkDerivation (finalAttrs: {
cmake
rustc
capnproto-lix
# Required for libstd++ assertions that leaks inside of the final binary.
removeReferencesTo
]
++ [
(lib.getBin lowdown-unsandboxed)
Expand Down Expand Up @@ -431,6 +434,10 @@ stdenv.mkDerivation (finalAttrs: {
+ lib.optionalString internalApiDocs ''
mkdir -p $out/nix-support
echo "doc internal-api-docs $out/share/doc/nix/internal-api/html" >> "$out/nix-support/hydra-build-products"
''
+ ''
# Drop all references to libstd++ include files due to `__FILE__` leaking in libstd++ assertions.
find "$out" -type f -exec remove-references-to -t ${stdenv.cc.cc.stdenv.cc.cc} '{}' +
'';

doInstallCheck = finalAttrs.doCheck;
Expand Down

0 comments on commit 8082f0b

Please # to comment.