Lix should disallow auto-optimise-store on darwin for now #477
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#477
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?
Is your feature request related to a problem? Please describe.
Right now, to my knowledge, auto-optimise-store causes nix-store corruption on darwin systems. Until it is fixed, lix should not allow users to turn it on darwin.
Describe the solution you'd like
Any error when auto-optimise-store is enabled on darwin would be nice
Describe alternatives you've considered
Investigate and fix the underlying issue that causes auto-optimise-store to be broken
Additional context
See a screenshot of a discussion in the Nix on macOS matrix room attached
Upstream issue on the store corruption (does not discuss prohibiting this option)
Should we hard error, or should we perhaps print a warning and ignore the setting? My concern is if this is an error then when the user hits this they can't run
nix profile rollback
ornix-env --rollback
, and if theirnix.conf
is managed by something like nix-darwin then that makes recovery more annoying.Digging into the underlying code, it's hard to trace through all this but it looks like
addToStore()
can end up invoked from multiple threads, andrandom()
is fundamentally not a thread-safe API (it uses global state), so my best guess is we're simply getting collisions. I just tried a test where I spun up 10 threads and had them generate only 100 numbers each and checked for dupes and I got a lot.I submitted https://gerrit.lix.systems/c/lix/+/2100 as a proposed fix for the underlying issue, though I don't know how to actually test the store corruption to make sure this solves it.
https://gerrit.lix.systems/c/lix/+/2100 has now been merged. I'm pretty sure that should fix the upstream corruption bug, so I'm going to close this.