Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haskell-modules/generic-builder.nix: use mktemp instead of TMPDIR #171685

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,10 @@ stdenv.mkDerivation ({
echo "Build with ${ghc}."
${optionalString (isLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"}

setupPackageConfDir="$TMPDIR/setup-package.conf.d"
builddir="$(mktemp -d)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we set a meaningful template here (e.g. mentioning nix, pname,..?)

setupPackageConfDir="$builddir/setup-package.conf.d"
mkdir -p $setupPackageConfDir
packageConfDir="$TMPDIR/package.conf.d"
packageConfDir="$builddir/package.conf.d"
mkdir -p $packageConfDir

setupCompileFlags="${concatStringsSep " " setupCompileFlags}"
Expand Down Expand Up @@ -418,7 +419,7 @@ stdenv.mkDerivation ({
done

echo setupCompileFlags: $setupCompileFlags
${nativeGhcCommand} $setupCompileFlags --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i
${nativeGhcCommand} $setupCompileFlags --make -o Setup -odir $builddir -hidir $builddir $i

runHook postCompileBuildDriver
'';
Expand Down