devShell NIX_LDFLAGS environment variable contains all the -L flags twice #420

Open
opened 2024-06-25 19:51:58 +00:00 by lunaphied · 1 comment
Owner

For whatever reason, at least when sourced by direnv, you get all the -L flags twice (though not the initial -rpath flag), this is probably something to resolve as the ordering of -L flags technically influences things

For whatever reason, at least when sourced by direnv, you get all the `-L` flags twice (though not the initial `-rpath` flag), this is probably something to resolve as the ordering of `-L` flags technically influences things
6.4 KiB
lunaphied added the
bug
E/help wanted
E/reproducible
labels 2024-06-25 19:51:58 +00:00
Owner

I can confirm this is only in the devShell:

diff --git a/package.nix b/package.nix
index ef6f317e8..843c6bcca 100644
--- a/package.nix
+++ b/package.nix
@@ -297,20 +297,23 @@ stdenv.mkDerivation (finalAttrs: {
       done
       install_name_tool -change ${boost}/lib/libboost_system.dylib $out/lib/libboost_system.dylib $out/lib/libboost_thread.dylib
     ''
     + ''
       # Workaround https://github.com/NixOS/nixpkgs/issues/294890.
       if [[ -n "''${doCheck:-}" ]]; then
         appendToVar configureFlags "--enable-tests"
       else
         appendToVar configureFlags "--disable-tests"
       fi
+
+      python -c 'import shlex; import os; print("\n".join(shlex.split(os.environ["NIX_LDFLAGS"])))'
+      exit 5
     '';
 
   mesonBuildType = "debugoptimized";
 
   installTargets = lib.optional internalApiDocs "internal-api-html";
 
   enableParallelBuilding = true;
 
   doCheck = canRunInstalled;
Running phase: unpackPhase
unpacking source archive /nix/store/8gf99nq1l1mjlbwx3gknca2bf30i2y34-source
source root is source
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
-rpath
/nix/store/09jwpx8c947ab7iyb0zh52gjg08fwrwl-lix-2.91.0-devpre20240624_dirty/lib
--compress-debug-sections=zlib
-L/nix/store/jpjmh2325b6k3svvsmhj57wqlph9srdx-brotli-1.1.0-lib/lib
-L/nix/store/5pcy995yarjy7bfdswgkfggbzg48dlq0-libkrb5-1.21.2/lib
-L/nix/store/kw1nc4sg6hp550z8g8pdjb3d3ixz4m3l-nghttp2-1.61.0-lib/lib
-L/nix/store/ic63ay0py10fyryaw7345k4ps32da33w-libidn2-2.3.7/lib
-L/nix/store/gp504m4dvw5k2pdx6pccf1km79fkcwgf-openssl-3.0.13/lib
-L/nix/store/2vqgx0si98m8c3yd2fhspmikavf3nvmd-libpsl-0.21.5/lib
-L/nix/store/vrqy1mn0nw6g6y0w22gipbspknnwr9q5-libssh2-1.11.0/lib
-L/nix/store/lv6nackqis28gg7l2ic43f6nk52hb39g-zlib-1.3.1/lib
-L/nix/store/by853zqacqy647v0z7l70xm77xl9ifal-zstd-1.5.6/lib
-L/nix/store/36kr91f8s509z2r8hqvpayw5bqyqgyzr-curl-8.7.1/lib
-L/nix/store/xwcf1rw3ackqp2vxms9myf9jq2ny6ynv-bzip2-1.0.8/lib
-L/nix/store/lphbn1va4i43fj7f3m9xskf9y86khzf3-xz-5.4.6/lib
-L/nix/store/72vkvhn5xwc2xl0wjb4yn3xchl1kknq8-editline-1.17.1/lib
-L/nix/store/y5p181lnbh8rrwd3ljp83k0cn3xklyk2-sqlite-3.45.3/lib
-L/nix/store/5nk2ga7i2f030am4qpcdsd8qlk6i3z83-attr-2.5.2/lib
-L/nix/store/mjgi65m3hgzqqvqcix848gskkw5zzwi9-acl-2.3.2/lib
-L/nix/store/kpnp478dwh41h1iwga7kikgfnyl55mnb-libarchive-3.7.4-lib/lib
-L/nix/store/62sh2bwllmkl8zzpqhglzgpk7lmsmrsa-boost-1.81.0/lib
-L/nix/store/77za77nbsv7s8afisp0k9ivpzn41x49k-lowdown-1.1.0-lib/lib
-L/nix/store/iykq7pdw9vci34nr2f3jl6rv901ivx8h-libsodium-1.0.19/lib
-L/nix/store/ys4akmpb1wh5vwxkihwzryxli4k1s6wh-lix-doc/lib
-L/nix/store/83jfjv2b6cc33jv7q1lvvd846crkd0wh-libseccomp-2.5.5-lib/lib
-L/nix/store/qkpm3v8q7h6j79hhhvvh3swp6kl59ssy-libcpuid-0.6.5/lib
-L/nix/store/1vq26sbc257kgziqyqmazbq4rgryr49g-aws-c-auth-0.7.18/lib
-L/nix/store/dijcprp9hflgigrmhsqdzbp6lpm4ihmm-aws-c-sdkutils-0.1.16/lib
-L/nix/store/my48py0b249gxbbshz8vxrr4gaf8kaim-aws-c-cal-0.6.12/lib
-L/nix/store/0chs9i53rw3bfkmqyalknpgb4b592n48-aws-c-common-0.9.17/lib
-L/nix/store/05gxcrd0jlqbx3kbhadgag22562sl1j2-aws-c-compression-0.2.18/lib
-L/nix/store/j6kdbs3nlc71wx8j88m2rx7yc9bgm5hg-aws-c-event-stream-0.4.2/lib
-L/nix/store/p58g40prdnv2cpp30qqphrzrssc6x60p-aws-c-http-0.8.1/lib
-L/nix/store/kvpckray62jv10a58bz4vicyw9rpizks-aws-c-io-0.14.7/lib
-L/nix/store/v3hby74gcwmkv33ndlv6kiakj6zzgnqz-aws-c-mqtt-0.10.4/lib
-L/nix/store/aywcl4ifzpr95mrq6ibrcx0z9f6677vd-aws-c-s3-0.5.7/lib
-L/nix/store/1y05i3vad54r0p1nddybgrpxpq4qrshd-aws-checksums-0.1.18/lib
-L/nix/store/168wmh284x6d7abn46b5b8xcps5q1vij-s2n-tls-1.4.12/lib
-L/nix/store/qsn2kr63qhp8bcn8qmb4k130mq60npr3-aws-crt-cpp-0.26.8/lib
-L/nix/store/325g651xj4q9hjlx5lpbxx01ihaqbrkm-aws-sdk-cpp-1.11.318/lib
-L/nix/store/g1xqvy5p9xgl33iywjy8192xpsfw33b1-gtest-1.14.0/lib
-L/nix/store/0rx3cdp5awca02hwbxa5rall5yhpvj8s-rapidcheck-0-unstable-2023-12-14/lib
-L/nix/store/d44k49xm27kpkczzmdn6hs6f9lcgqsqc-boehm-gc-8.2.6/lib
I can confirm this is only in the devShell: ```diff diff --git a/package.nix b/package.nix index ef6f317e8..843c6bcca 100644 --- a/package.nix +++ b/package.nix @@ -297,20 +297,23 @@ stdenv.mkDerivation (finalAttrs: { done install_name_tool -change ${boost}/lib/libboost_system.dylib $out/lib/libboost_system.dylib $out/lib/libboost_thread.dylib '' + '' # Workaround https://github.com/NixOS/nixpkgs/issues/294890. if [[ -n "''${doCheck:-}" ]]; then appendToVar configureFlags "--enable-tests" else appendToVar configureFlags "--disable-tests" fi + + python -c 'import shlex; import os; print("\n".join(shlex.split(os.environ["NIX_LDFLAGS"])))' + exit 5 ''; mesonBuildType = "debugoptimized"; installTargets = lib.optional internalApiDocs "internal-api-html"; enableParallelBuilding = true; doCheck = canRunInstalled; ``` ``` Running phase: unpackPhase unpacking source archive /nix/store/8gf99nq1l1mjlbwx3gknca2bf30i2y34-source source root is source Running phase: patchPhase Running phase: updateAutotoolsGnuConfigScriptsPhase Running phase: configurePhase -rpath /nix/store/09jwpx8c947ab7iyb0zh52gjg08fwrwl-lix-2.91.0-devpre20240624_dirty/lib --compress-debug-sections=zlib -L/nix/store/jpjmh2325b6k3svvsmhj57wqlph9srdx-brotli-1.1.0-lib/lib -L/nix/store/5pcy995yarjy7bfdswgkfggbzg48dlq0-libkrb5-1.21.2/lib -L/nix/store/kw1nc4sg6hp550z8g8pdjb3d3ixz4m3l-nghttp2-1.61.0-lib/lib -L/nix/store/ic63ay0py10fyryaw7345k4ps32da33w-libidn2-2.3.7/lib -L/nix/store/gp504m4dvw5k2pdx6pccf1km79fkcwgf-openssl-3.0.13/lib -L/nix/store/2vqgx0si98m8c3yd2fhspmikavf3nvmd-libpsl-0.21.5/lib -L/nix/store/vrqy1mn0nw6g6y0w22gipbspknnwr9q5-libssh2-1.11.0/lib -L/nix/store/lv6nackqis28gg7l2ic43f6nk52hb39g-zlib-1.3.1/lib -L/nix/store/by853zqacqy647v0z7l70xm77xl9ifal-zstd-1.5.6/lib -L/nix/store/36kr91f8s509z2r8hqvpayw5bqyqgyzr-curl-8.7.1/lib -L/nix/store/xwcf1rw3ackqp2vxms9myf9jq2ny6ynv-bzip2-1.0.8/lib -L/nix/store/lphbn1va4i43fj7f3m9xskf9y86khzf3-xz-5.4.6/lib -L/nix/store/72vkvhn5xwc2xl0wjb4yn3xchl1kknq8-editline-1.17.1/lib -L/nix/store/y5p181lnbh8rrwd3ljp83k0cn3xklyk2-sqlite-3.45.3/lib -L/nix/store/5nk2ga7i2f030am4qpcdsd8qlk6i3z83-attr-2.5.2/lib -L/nix/store/mjgi65m3hgzqqvqcix848gskkw5zzwi9-acl-2.3.2/lib -L/nix/store/kpnp478dwh41h1iwga7kikgfnyl55mnb-libarchive-3.7.4-lib/lib -L/nix/store/62sh2bwllmkl8zzpqhglzgpk7lmsmrsa-boost-1.81.0/lib -L/nix/store/77za77nbsv7s8afisp0k9ivpzn41x49k-lowdown-1.1.0-lib/lib -L/nix/store/iykq7pdw9vci34nr2f3jl6rv901ivx8h-libsodium-1.0.19/lib -L/nix/store/ys4akmpb1wh5vwxkihwzryxli4k1s6wh-lix-doc/lib -L/nix/store/83jfjv2b6cc33jv7q1lvvd846crkd0wh-libseccomp-2.5.5-lib/lib -L/nix/store/qkpm3v8q7h6j79hhhvvh3swp6kl59ssy-libcpuid-0.6.5/lib -L/nix/store/1vq26sbc257kgziqyqmazbq4rgryr49g-aws-c-auth-0.7.18/lib -L/nix/store/dijcprp9hflgigrmhsqdzbp6lpm4ihmm-aws-c-sdkutils-0.1.16/lib -L/nix/store/my48py0b249gxbbshz8vxrr4gaf8kaim-aws-c-cal-0.6.12/lib -L/nix/store/0chs9i53rw3bfkmqyalknpgb4b592n48-aws-c-common-0.9.17/lib -L/nix/store/05gxcrd0jlqbx3kbhadgag22562sl1j2-aws-c-compression-0.2.18/lib -L/nix/store/j6kdbs3nlc71wx8j88m2rx7yc9bgm5hg-aws-c-event-stream-0.4.2/lib -L/nix/store/p58g40prdnv2cpp30qqphrzrssc6x60p-aws-c-http-0.8.1/lib -L/nix/store/kvpckray62jv10a58bz4vicyw9rpizks-aws-c-io-0.14.7/lib -L/nix/store/v3hby74gcwmkv33ndlv6kiakj6zzgnqz-aws-c-mqtt-0.10.4/lib -L/nix/store/aywcl4ifzpr95mrq6ibrcx0z9f6677vd-aws-c-s3-0.5.7/lib -L/nix/store/1y05i3vad54r0p1nddybgrpxpq4qrshd-aws-checksums-0.1.18/lib -L/nix/store/168wmh284x6d7abn46b5b8xcps5q1vij-s2n-tls-1.4.12/lib -L/nix/store/qsn2kr63qhp8bcn8qmb4k130mq60npr3-aws-crt-cpp-0.26.8/lib -L/nix/store/325g651xj4q9hjlx5lpbxx01ihaqbrkm-aws-sdk-cpp-1.11.318/lib -L/nix/store/g1xqvy5p9xgl33iywjy8192xpsfw33b1-gtest-1.14.0/lib -L/nix/store/0rx3cdp5awca02hwbxa5rall5yhpvj8s-rapidcheck-0-unstable-2023-12-14/lib -L/nix/store/d44k49xm27kpkczzmdn6hs6f9lcgqsqc-boehm-gc-8.2.6/lib ```
qyriad changed title from `NIX_LDFLAGS` environment variable contains all the `-L` flags twice to devShell `NIX_LDFLAGS` environment variable contains all the `-L` flags twice 2024-06-25 20:05:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#420
No description provided.