We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37273af commit 24596d7Copy full SHA for 24596d7
1 file changed
pkgs/build-support/bintools-wrapper/setup-hook.sh
@@ -20,7 +20,13 @@ bintoolsWrapper_addLDVars () {
20
fi
21
22
if [[ -d "$1/lib" ]]; then
23
- export NIX_${role_pre}LDFLAGS+=" -L$1/lib"
+ # Don't add the /lib directory if it actually doesn't contain any libraries. For instance,
24
+ # Python and Haskell packages often only have directories like $out/lib/ghc-8.4.3/ or
25
+ # $out/lib/python3.6/, so having them in LDFLAGS just makes the linker search unnecessary
26
+ # directories and bloats the size of the environment variable space.
27
+ if [[ -n "$(echo $1/lib/lib*)" ]]; then
28
+ export NIX_${role_pre}LDFLAGS+=" -L$1/lib"
29
+ fi
30
31
}
32
0 commit comments