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

Delete temporary directory on successful build #2689

Merged

Conversation

tollb
Copy link
Contributor

@tollb tollb commented Feb 19, 2019

With --check and the --keep-failed (-K) flag, the temporary directory
was being retained regardless of whether the build was successful and
reproducible. This removes the temporary directory, as expected, on
a reproducible check build.

Added tests to verify that temporary build directories are not
retained unnecessarily, particularly when using --check with
--keep-failed.

Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

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

LGTM

@domenkozar
Copy link
Member

Could you rebase?

@tollb tollb force-pushed the fix/delete_tmp_dir_when_build_check_ok branch 4 times, most recently from 7fde50e to 834dec5 Compare April 9, 2020 20:03
With --check and the --keep-failed (-K) flag, the temporary directory
was being retained regardless of whether the build was successful and
reproducible.  This removes the temporary directory, as expected, on
a reproducible check build.

Added tests to verify that temporary build directories are not
retained unnecessarily, particularly when using --check with
--keep-failed.
@tollb tollb force-pushed the fix/delete_tmp_dir_when_build_check_ok branch from 834dec5 to 16a4864 Compare April 9, 2020 20:37
@tollb
Copy link
Contributor Author

tollb commented Apr 9, 2020

@domenkozar: I rebased the commit, adding status code checks to be consistent with @LnL7 updates that were committed after this PR was filed. I noticed one inconsistency with a return status for Darwin vs NixOS. Since I do not have access to a Darwin system, I disabled the one status code check for Darwin and left a comment in the code (check.sh).

@domenkozar domenkozar merged commit db25a6d into NixOS:master Apr 10, 2020
@LnL7
Copy link
Member

LnL7 commented Apr 10, 2020

@tollb That test shouldn't be just skipped, exit status 1 means it's a genuine error.

error: renaming '/private/var/folders/jf/2khhhlb53_jd54vf1wk60j2w0000gn/T/nix-test/store/vxvgpsip84469dl4mfjpa34ks33s85q7-nondeterministic' to '/private/var/folders/jf/2khhhlb53_jd54vf1wk60j2w0000gn/T/nix-test/store/jfwiq0apzyiq4hcb33zv33pa3qi114gg-nondeterministic.check': Permission denied

@tollb
Copy link
Contributor Author

tollb commented Apr 10, 2020

@LnL7 Thanks for following-up! The message that you reported sounds like it might be related to a second PR #2688 that I filed around the same time (February 2019). I don't have the ability to test with Darwin and that PR no longer applies cleanly. I'm also not sure why the issue only affects Darwin at this point. However, I can rebase PR #2688 if you'd be willing to test it.

Assuming the rebased #2688 works and gets merged, I could open a new PR to re-enable the check for Darwin. Please let me know if you are willing to test a rebased PR #2688 or if you have other suggestions on how to proceed.
CC @domenkozar

@LnL7
Copy link
Member

LnL7 commented Apr 10, 2020

@tollb Indeed, however from what I can tell renaming a readonly dir seems to work fine on linux so I'm surprised you ran into that.

As for why, sandboxing works quite differently on darwin. We don't have bind mounts so even when the sandbox is enabled hash rewriting is still used.

tollb added a commit to tollb/nix that referenced this pull request Apr 10, 2020
A test case for correct handling of temporary directory deletion that
was added to check.sh as part of PR NixOS#2689 was initially disabled for
Darwin because of a directory permission issue in PR NixOS#2688.

Now that the issue in PR NixOS#2688 is fixed, this commit enables the test
case for Darwin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants