Build directories left-overs in $TMPDIR
after build failure/user interruption #678
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#678
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
Since Lix 2.91.1 (at least, could happen on older versions), Lix leave some build directories of built derivations in
$TMPDIR
instead of cleaning them up.Steps To Reproduce
Building a large graph of derivations seems to exacerbate this.
Expected behavior
Build directories should be cleaned up.
nix --version
outputConfirmed to happen:
Additional context
Example:
cc @mweinelt
I have no crashes logged, so this feels like an issue with some control flow.
One scenario that leaves a build dir behind is when aborting a build using CTRL_C.
nix (Lix, like Nix) 2.93.0-dev-pre20250206-1a13827
I know there's also the "directory not empty" error message when deleting some build directories sometimes. Unsure of the actual cause of that one either.
Just had this with lix 2.91.0:
No CTRL+C, regular build failure.
Looking at the left-over files, it seems like all source code etc. has been removed and only some build artifacts remain. I was running this with
--cores 32
, so the build itself was parallelized.Could it be that some processes, of in this case GHC, were still producing files, while lix was already trying to shutdown and start removing things?
Edit: It seems to happen frequently... I have collected 91 GB of left-overs from nix (lix) in /tmp right now :D
The workaround that I'm currently relying on is this:
Nix issue is https://github.com/NixOS/nix/issues/5207
reproducer:
likely cause: first line of block should be the last line instead
try { deleteTmpDir(false); } catch (...) { ignoreExceptionInDestructor(); }
try { killChild(); } catch (...) { ignoreExceptionInDestructor(); }
try { stopDaemon(); } catch (...) { ignoreExceptionInDestructor(); }
This issue was mentioned on Gerrit on the following CLs:
Still reproduces, when interrupting the build with CTRL_C.
Build directories left-overs into Build directories left-overs in$TMPDIR
$TMPDIR
after build failure/user interruptionstatic void _deletePath(int parentfd, const Path & path, uint64_t & bytesFreed)
{
checkInterrupt();
for fuck's sake.
Deletion on CTRL_C works with https://gerrit.lix.systems/c/lix/+/2666. Thank you!
cl merged. claws crossed we won't need a round 3