-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
haskell-modules/generic-builder.nix: use mktemp instead of TMPDIR #171685
Conversation
Using $TMPDIR here is problematic because it is not always cleared at the end of each build, for instance when using "nix-shell --run genericBuild". This can cause confusing errors when a nix-shell build is trying to pull in dependencies from a previous build since it tries to use older package conf files. To fix, we can just use mktemp which will guarantee us a clean directory for each build. Should have no effect in nix-build, but will fix a common issue with using generic-builder in nix-shell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We should then maybe also deliberate cleaning up the temporary directory if |
Needs to target staging |
haskell-updates would be better in this case.
… On 10. May 2022, at 01:56, Artturi ***@***.***> wrote:
Needs to target staging
Check contributing.md for how to do that
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is okay, it pollutes the temporary directory in case of interactive usage, but this was also the case before this change.
@@ -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)" |
There was a problem hiding this comment.
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
,..?)
Thank you! |
Using $TMPDIR here is problematic because it is not always cleared at
the end of each build, for instance when using "nix-shell --run
genericBuild". This can cause confusing errors when a nix-shell build
is trying to pull in dependencies from a previous build since it tries
to use older package conf files.
To fix, we can just use mktemp which will guarantee us a clean
directory for each build. Should have no effect in nix-build, but will
fix a common issue with using generic-builder in nix-shell.
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes