treewide: Fix unsafe concatenation of $LD_LIBRARY_PATH

Naive concatenation of $LD_LIBRARY_PATH can result in an empty
colon-delimited segment; this tells glibc to load libraries from the
current directory, which is definitely wrong, and may be a security
vulnerability if the current directory is untrusted.  (See #67234, for
example.)  Fix this throughout the tree.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2020-01-01 16:29:34 -08:00 committed by Frederik Rietdijk
parent 2e5051e223
commit 3cd8ce3bce
48 changed files with 55 additions and 55 deletions

View File

@ -30,7 +30,7 @@ mkDerivation rec {
# libraries. These reside in build/lib, and are not found by
# default.
preBuild = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib:$PWD/VTK/ThirdParty/vtkm/vtk-m/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib:$PWD/VTK/ThirdParty/vtkm/vtk-m/lib
'';
enableParallelBuilding = true;

View File

@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
outputs = [ "out" "doc" ]; # headers are just two and very small
preConfigure = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:"`pwd`/build/src
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}"`pwd`/build/src
'' else ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:"`pwd`/build/src
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}"`pwd`/build/src
'';
nativeBuildInputs = [ cmake ];

View File

@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
preConfigure = ''
# autotools check tries to dlopen libpython as a requirement for the python plugin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${python}/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${python}/lib
'';
postPatch = ''

View File

@ -79,7 +79,7 @@ stdenv.mkDerivation rec {
# 80 - test-gnc-module-scm-module (Failed)
# 81 - test-gnc-module-scm-multi (Failed)
preCheck = ''
export LD_LIBRARY_PATH=$PWD/lib:$PWD/lib/gnucash:$PWD/lib/gnucash/test:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PWD/lib:$PWD/lib/gnucash:$PWD/lib/gnucash/test''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
export NIX_CFLAGS_LINK="-lgtest -lgtest_main"
'';
doCheck = false;

View File

@ -177,7 +177,7 @@ writeTextFile rec {
export SAGE_EXTCODE='${sagelib.src}/src/ext'
# for find_library
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
'';
} // {
lib = sagelib; # equivalent of `passthru`, which `writeTextFile` doesn't support

View File

@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
cd "$sourceRoot"
patchPhase
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${libXext}/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${libXext}/lib"
${stdenv.shell} bootStrap.bash \
--with-core \
${if withQT then "--with-qt" else "--without-qt"} \

View File

@ -52,7 +52,7 @@ let
etcProfile = writeText "profile" ''
export PS1='${name}-chrootenv:\u@\h:\w\$ '
export LOCALE_ARCHIVE='/usr/lib/locale/locale-archive'
export LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
export PATH="/run/wrappers/bin:/usr/bin:/usr/sbin:$PATH"
export TZDIR='/etc/zoneinfo'

View File

@ -228,8 +228,8 @@ mkDerivation rec {
];
preBuild = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${zlib}/lib";
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${libX11}/lib";
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${zlib}/lib";
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${libX11}/lib";
'';
dontWrapQtApps = true;

View File

@ -123,7 +123,7 @@ stdenv.mkDerivation rec {
preConfigure = ''
# allow ecore_con to find libcurl.so, which is a runtime dependency (it is dlopened)
export LD_LIBRARY_PATH="${curl.out}/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="${curl.out}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
source "$setupHook"
'';

View File

@ -29,7 +29,7 @@ in llvmPackages.stdenv.mkDerivation {
# To handle the lack of 'local' RPATH; required, as they call one of
# their built binaries requiring their libs, in the build process.
preBuild = ''
export LD_LIBRARY_PATH="$(pwd)/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$(pwd)/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
'';
enableParallelBuilding = true;

View File

@ -143,7 +143,7 @@ stdenv.mkDerivation ({
'';
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
'';
postInstall = stdenv.lib.optionalString enableSharedLibraries ''

View File

@ -119,7 +119,7 @@ stdenv.mkDerivation ({
'';
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
'';
postInstall = ''

View File

@ -120,7 +120,7 @@ stdenv.mkDerivation ({
'';
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
'';
postInstall = ''

View File

@ -141,7 +141,7 @@ in stdenv.mkDerivation ({
'';
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
'';
postInstall = ''

View File

@ -117,7 +117,7 @@ in stdenv.mkDerivation ({
'';
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
'';
postInstall = ''

View File

@ -134,7 +134,7 @@ in stdenv.mkDerivation (rec {
'';
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
'';
postInstall = ''

View File

@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
chmod u+x $(pwd)/../${usr_prefix}/bin/mlton
# So the builder runs the binary compiler with gmp.
export LD_LIBRARY_PATH=${gmp.out}/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${gmp.out}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
'' + stdenv.lib.optionalString stdenv.isLinux ''
# Patch ELF interpreter.

View File

@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
checkPhase = ''
while IFS= read -r -d ''' dir
do
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$dir
LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$(pwd)/$dir
export LD_LIBRARY_PATH
done < <(find . -type d -print0)

View File

@ -21,7 +21,7 @@ in stdenv.mkDerivation {
preCheck = ''
# Make `libgcc_s.so' visible for `pthread_cancel'.
export LD_LIBRARY_PATH=\
"$(dirname $(echo ${stdenv.cc.cc.lib}/lib*/libgcc_s.so)):$LD_LIBRARY_PATH"
"$(dirname $(echo ${stdenv.cc.cc.lib}/lib*/libgcc_s.so))''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
'';
meta = with stdenv.lib; {

View File

@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
configureFlags = [ "--enable-release" ];
doCheck = true;
checkPhase = ''
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${llvm}/lib make check
LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${llvm}/lib make check
'';
postInstall = ''
wrapProgram $out/bin/pure --prefix LD_LIBRARY_PATH : ${llvm}/lib

View File

@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=`pwd`''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
'';
outputs = [ "dev" "out" ];

View File

@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
doCheck = true;
checkTarget = "test";
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/lib
'';
meta = with stdenv.lib; {

View File

@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DCTESTS=ON" ];
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=`pwd`''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
'';
checkTarget = "criterion_tests test";

View File

@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
];
preBuild = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pwd`/Cutelyst:`pwd`/EventLoopEPoll"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/Cutelyst:`pwd`/EventLoopEPoll"
'';
postBuild = ''

View File

@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
''}
${stdenv.lib.optionalString stdenv.isDarwin ''
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:`pwd`/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib
# Removing tests depending on charset conversion
substituteInPlace ../test/Makefile --replace "conversions.sh" ""
rm -f ../tests/bugfixes/redmine/test_issue_460.py

View File

@ -160,7 +160,7 @@ stdenv.mkDerivation rec {
checkInputs = [ tzdata libxml2 desktop-file-utils shared-mime-info ];
preCheck = optionalString doCheck ''
export LD_LIBRARY_PATH="$NIX_BUILD_TOP/${pname}-${version}/glib/.libs:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$NIX_BUILD_TOP/${pname}-${version}/glib/.libs''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
export TZDIR="${tzdata}/share/zoneinfo"
export XDG_CACHE_HOME="$TMP"
export XDG_RUNTIME_HOME="$TMP"

View File

@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
'';
preBuild = ''
export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
'';
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=unknown-warning-option";

View File

@ -23,9 +23,9 @@ stdenv.mkDerivation rec {
# Hack to be able to run the test, broken because we use
# CMAKE_SKIP_BUILD_RPATH to avoid cmake resetting rpath on install
preBuild = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH="`pwd`/src/lib_json:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="`pwd`/src/lib_json''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
'' else ''
export LD_LIBRARY_PATH="`pwd`/src/lib_json:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="`pwd`/src/lib_json''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
'';
nativeBuildInputs = [ cmake python ];

View File

@ -32,8 +32,8 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD${placeholder "out"}/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD${placeholder "out"}/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD${placeholder "out"}/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD${placeholder "out"}/lib
'';
checkTarget = "tests test";

View File

@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
export DYLD_FALLBACK_LIBRARY_PATH="$(pwd):$DYLD_FALLBACK_LIBRARY_PATH"
'';

View File

@ -125,7 +125,7 @@ stdenv.mkDerivation rec {
];
preConfigure = ''
export LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="`pwd`/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
configureFlags+="
-docdir $out/share/doc/${name}
-plugindir $out/lib/qt4/plugins

View File

@ -164,7 +164,7 @@ stdenv.mkDerivation {
setOutputFlags = false;
preConfigure = ''
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
${lib.optionalString (compareVersion "5.9.0" < 0) ''
# We need to set LD to CXX or otherwise we get nasty compile errors
export LD=$CXX

View File

@ -30,9 +30,9 @@ stdenv.mkDerivation {
];
preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:`pwd`/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib
'' else ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
'' + ''
# Prevent tests from using all cores
export OMP_NUM_THREADS=2

View File

@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
# Run single threaded
export OMP_NUM_THREADS=1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
'';
meta = with stdenv.lib; {

View File

@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
export DYLD_FALLBACK_LIBRARY_PATH="$(pwd):$DYLD_FALLBACK_LIBRARY_PATH"
'';

View File

@ -117,7 +117,7 @@ stdenv.mkDerivation rec {
cat > "$out/bin/${cmd}" <<EOF
#!${runtimeShell}
set -f
LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:$libs" exec $out/pharo "\$@"
LD_LIBRARY_PATH="\$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$libs" exec $out/pharo "\$@"
EOF
chmod +x "$out/bin/${cmd}"
ln -s ${libgit2}/lib/libgit2.so* "$out/"

View File

@ -105,7 +105,7 @@ let
path = "${cudatoolkit}/lib/stubs/libcuda.so";
}];
cudaStubEnv = lib.optionalString cudaSupport
"LD_LIBRARY_PATH=${cudaStub}\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ";
"LD_LIBRARY_PATH=${cudaStub}\${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH ";
in buildPythonPackage rec {
version = "1.2.0";

View File

@ -109,7 +109,7 @@ let
'';
preBuild = ''
export LD_LIBRARY_PATH="$PWD/depends/protobuf:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$PWD/depends/protobuf''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
'';
cmakeFlags = [ "-DDFHACK_BUILD_ARCH=${arch}" "-DDOWNLOAD_RUBY=OFF" ]

View File

@ -7,5 +7,5 @@ for i in dfhack.init-example dfhack-config/default hack/* stonesense/*; do
done
cd "$DF_DIR"
LD_LIBRARY_PATH="$env_dir/hack/libs:$env_dir/hack:$LD_LIBRARY_PATH" \
LD_LIBRARY_PATH="$env_dir/hack/libs:$env_dir/hack${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" \
LD_PRELOAD="$env_dir/hack/libdfhack.so:$LD_PRELOAD" exec $env_dir/libs/Dwarf_Fortress "$@"

View File

@ -53,7 +53,7 @@ let
echo "$runtime_paths"
exit 0
fi
export LD_LIBRARY_PATH="$runtime_paths:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$runtime_paths''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
exec "$@"
'';
@ -260,7 +260,7 @@ in buildFHSUserEnv rec {
exit 1
fi
shift
${lib.optionalString (!nativeOnly) "export LD_LIBRARY_PATH=/lib32:/lib64:${lib.concatStringsSep ":" ldPath}:$LD_LIBRARY_PATH"}
${lib.optionalString (!nativeOnly) "export LD_LIBRARY_PATH=/lib32:/lib64:${lib.concatStringsSep ":" ldPath}\${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"}
exec -- "$run" "$@"
'';
};

View File

@ -285,7 +285,7 @@ if test -z "$libsOnly"; then
for prog in $BIN/*; do
cp -f $prog $out/bin &&
patchelf --set-interpreter $(echo $glibcDir/lib/ld-linux*.so.2) $out/bin/$(basename $prog) &&
wrapProgram $out/bin/$(basename $prog) --prefix LD_LIBRARY_PATH : $out/lib/:$gcc/lib/:$out/share/ati/:$libXinerama/lib/:$libXrandr/lib/:$libfontconfig/lib/:$libfreetype/lib/:$LD_LIBRARY_PATH
wrapProgram $out/bin/$(basename $prog) --prefix LD_LIBRARY_PATH : $out/lib/:$gcc/lib/:$out/share/ati/:$libXinerama/lib/:$libXrandr/lib/:$libfontconfig/lib/:$libfreetype/lib/${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
done
}

View File

@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
# dependency on `libtcam` (which itself is built as part of this build). In order to allow
# that, we set the dynamic linker's path to point on the build time location of the library.
preBuild = ''
export LD_LIBRARY_PATH=$PWD/src:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PWD/src''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
'';
meta = with lib; {

View File

@ -97,6 +97,6 @@ buildFHSUserEnv {
# Actually run Plex, prepending LD_LIBRARY_PATH with the libraries from
# the Plex package.
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$root exec "$root/Plex Media Server"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$root exec "$root/Plex Media Server"
'';
}

View File

@ -26,4 +26,4 @@ index e280e86..b2dd42b 100755
-# Execute the strangled program under a clean environment
# pass through the FPS and overriden LD_PRELOAD environment variables
-exec env FPS="${FPS}" LD_PRELOAD="${LD_PRELOAD}:libstrangle.so" "$@"
+FPS="${FPS}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@out@/lib/libstrangle/lib64:@out@/lib/libstrangle/lib32" LD_PRELOAD="${LD_PRELOAD}:libstrangle.so" exec "$@"
+FPS="${FPS}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}@out@/lib/libstrangle/lib64:@out@/lib/libstrangle/lib32" LD_PRELOAD="${LD_PRELOAD}:libstrangle.so" exec "$@"

View File

@ -27,7 +27,7 @@ let
in writeScriptBin "primusrun" ''
#!${runtimeShell}
export LD_LIBRARY_PATH=${ldPath}:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${ldPath}''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
# https://bugs.launchpad.net/ubuntu/+source/bumblebee/+bug/1758243
export __GLVND_DISALLOW_PATCHING=1
exec "$@"

View File

@ -134,7 +134,7 @@ in rec {
substituteInPlace src/common/module.c --replace "/sbin/modprobe" "modprobe"
# for pybind/rgw to find internal dep
export LD_LIBRARY_PATH="$PWD/build/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$PWD/build/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
# install target needs to be in PYTHONPATH for "*.pth support" check to succeed
patchShebangs src/script src/spdk src/test src/tools

View File

@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
dontUseCmakeBuildDir = true;
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/3rdparty/googletest/googletest:$(pwd)/neopg
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$(pwd)/3rdparty/googletest/googletest:$(pwd)/neopg
'';
meta = with stdenv.lib; {

View File

@ -11,7 +11,7 @@ stdenv.mkDerivation {
makeFlags = [
# let intermediate tools find intermediate library
"LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(CURDIR)/src"
"LD_LIBRARY_PATH=$LD_LIBRARY_PATH\${LD_LIBRARY_PATH:+:}$(CURDIR)/src"
];
# Parallel building occasionaly fails with: Error copying file "/tmp/nix-build-opencc-1.0.5.drv-0/OpenCC-ver.1.0.5/build/src/libopencc.so.1.0.0" to "/tmp/nix-build-opencc-1.0.5.drv-0/OpenCC-ver.1.0.5/build/src/tools".