haskell-modules/generic-builder.nix: use mktemp instead of TMPDIR#171685
Merged
maralorn merged 1 commit intoNixOS:haskell-updatesfrom May 21, 2022
Merged
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.
Member
|
We should then maybe also deliberate cleaning up the temporary directory if |
Member
|
Needs to target staging |
Member
|
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.
|
sternenseemann
approved these changes
May 10, 2022
Member
sternenseemann
left a comment
There was a problem hiding this comment.
I think this is okay, it pollutes the temporary directory in case of interactive usage, but this was also the case before this change.
| ${optionalString (isLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"} | ||
|
|
||
| setupPackageConfDir="$TMPDIR/setup-package.conf.d" | ||
| builddir="$(mktemp -d)" |
Member
There was a problem hiding this comment.
Can we set a meaningful template here (e.g. mentioning nix, pname,..?)
Member
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 = trueset 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.shto update generated release notes