Failing nix build cannot clean up temporary build directory, leading to "cannot unlink /tmp/drv-name/": Directory not empty #503
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#503
Loading…
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
As described above, the Nix (Lix?) builder fails to correctly clean up if a build fails, which slowly grinds a larger build to a halt (if this error occurs while building a dependant, for example). I personally noticed this when attempting to build packages from nixos-cosmic. After a little bit of time, a package would fail and the larger derivation that depended on these packages existing fails as well. This issue does not seem to be happening with
Nix 2.18.5
(which I pulled directly from nixpkgs).I also see this particular issue marked as a Nix regression upstream, as can be found here: https://github.com/NixOS/nix/issues/5207
If you have a problem with a specific package or NixOS,
you probably want to file an issue at https://github.com/NixOS/nixpkgs/issues.
Steps To Reproduce
nix (Lix, like Nix) 2.92.0-devpre20240830_d75df91
)git clone https://github.com/Frontear/dotfiles
failing-build
branch.nix build .#cachixJobs.LAPTOP-3DT4F02
(this is simply apkgs.linkFarmFromDrvs
derivation that builds nixos-cosmic packages, lix, and some other little tidbits for my binary cache).Expected behavior
Expecting the build to take a long time but eventually succeed, because the derivations are correct. At the minimum though, even if it fails, it shouldn't fail with cleanup issues.
nix --version
outputAdditional context
https://github.com/NixOS/nix/issues/5207
https://github.com/NixOS/nix/issues/9412
Nevermind! I did not take the time to carefully comb the logs, it is in fact a package itself that is failing to build. Furthermore it fails on Nix 2.18.5 (it had gone further than Lix so I suspected it had fixed the issue, but evidently not). Closing as invalid!
Hm. Well, we do still want to fix such bugs. I would really like a more minimal reproducer though, as that would make it much easier to figure out what is going wrong here.
Hi!
I definitely will look into grabbing a simpler reproducible environment for this, I actually ended up dropping cosmic completely after this, especially because I wasn't even using it much, which led to me forgetting about this issue.