1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 15:11:35 +00:00

cabal: add "-hidir $TMPDIR" parameter to ghc call that compiles Setup.hs

Packages that don't have a Setup.hs file get to use a default version that
lives in the Nix store. By default ghc tries to put the Setup.o and Setup.hi
files in the same directory as the source file, which isn't writable. This
leads to build errors [1]. Thus, we re-direct those paths to a build-local
writable location: $TMPDIR.

Arguably, we could also use "." or copy the /nix/store/deadbeef-Setup.hs file
into the local source directory before compiling, which would work fine, too.

[1] https://github.com/NixOS/nixpkgs/issues/4851
This commit is contained in:
Peter Simons 2014-11-06 14:05:44 +01:00
parent d3bcc4ac98
commit 40bb2781ee

View file

@ -194,7 +194,7 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
for i in Setup.hs Setup.lhs ${defaultSetupHs}; do
test -f $i && break
done
ghc --make -o Setup -odir $TMPDIR $i
ghc --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i
for p in $extraBuildInputs $propagatedNativeBuildInputs; do
if [ -d "$p/lib/ghc-${ghc.ghc.version}/package.conf.d" ]; then