git.iko.soy/typeable/cabal2nix
on master help sign in
Fix unsafe concatenation of $LD_LIBRARY_PATH

Naive concatenation of $LD_LIBRARY_PATH can result in an empty colon-delimited segment, which tells glibc to load libraries from the current directory. Signed-off-by: Anders Kaseorg <andersk@mit.edu>

commit843e5914571f861a01d00c671a1911c4ab3955ac authorAnders Kaseorg <andersk@mit.edu> dateWed 1 Jan 2020, 18:42 (7 years ago) parent2fb6f7e
1 file changed+1−1
src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+1−1
src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+1−1
@@ -255,7 +255,7 @@ gfPhaseOverrides = unlines
255255 , " sed -i \"s|numJobs (bf bi)++||\" ./Setup.hs"
256256 -- Parallel compilation fails. Disable it.
257257 , "'';"
258− , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build:$LD_LIBRARY_PATH'';"
258+ , "preBuild = ''export LD_LIBRARY_PATH=`pwd`/dist/build''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH'';"
259259 -- The build step itself, after having built the library, needs to be able
260260 -- to find the library it just built in order to compile grammar files.
261261 ]