nix store delete/nix-store --delete cannot delete paths with self-references #494
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
awaiting
author
awaiting
contributors
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
Feature/S3
Importance
High
Importance
Low
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
Release Blocking
Non-urgent
Release Blocking
Urgent
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
Urgency
High
Urgency
Low
ux
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#494
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?
Reproducer:
This is an instance of #282, probably not the only one.
nix store deleteshould just delete the path in such an instance, the "references" are nonsense.Beware while fixing this: this might be more properly fixed by fixing the root cause, #495
I think there's something off with
nix-store --deletein general:For instance,
nix-store --delete /nix/store/4m1m9i8wfs2zwapdr5c2pxppr41vik71-vm-test-run-matrix-synapsefails for me withBoth
--referrersand--rootsdoesn't give me anything. It's an empty store-path frompkgs.nixosTest:Or am I holding something wrong?
nix --version:one of the fun ways it's fucked is because of sudo env-vars. that one's pretty evil.
okay here's a test that can be used to start on fixing this:
@jade wrote in #494 (comment):
Fun fact, this test will never succeed, even if the logic behind the self references is fixed.
This is because the process running
nix store deletewill have the env varout=/nix/store/...which will create a temp root throughfindPlatformRootsAdditionally, the
undeletable.nixreproducer does not reproduce for meI don't think
outwill be an env var, since it's not exported?it will be exported inside the devshell because devshells invoke stdenv and thus exports
out, which bash then uses as a hint that the assignment should reëxportoutwith the new value. for the same reason it'll be exposed in a build sandbox, but not when loading the required packages (but not the rest of stdenv) via some other means (like direnv would iwrc). f2 would be safe from this because f2 controls test environments very carefully, but f1 is broken by design in this regard :/Using the following diff:
lix builds successfully, so I believe that this issue can be closed as the previous failing test was an artifact of the name
outbeing load-bearingso this is definitely fixed now