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
Delete temporary directory on successful build #2689
Conversation
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
Could you rebase? |
7fde50e
to
834dec5
Compare
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.
834dec5
to
16a4864
Compare
@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). |
@tollb That test shouldn't be just skipped, exit status 1 means it's a genuine error.
|
@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. |
@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. |
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.
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.