Age | Commit message (Collapse) | Author |
|
|
|
Implements the approach suggested by feedback on PR #6994, where
tempdir paths are created in the store (now with an exclusive lock).
As part of this work, the currently-broken and unused
`createTempDirInStore` function is updated to create an exclusive lock
on the temp directory in the store.
The GC now makes a non-blocking attempt to lock any store directories
that "look like" the temp directories created by this function, and if
it can't acquire one, ignores the directory.
|
|
`move` tends to have this `mv` connotation of “I will copy it for you if
needs be”
|
|
Directly takes some c++ strings, and gently throws an exception on error
(rather than having to inline this logic everywhere)
|
|
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
|
|
Before the change garbage collector was not considering
`.drv` and outputs as alive even if configuration says otherwise.
As a result `nix store gc --dry-run` could visit (and parse)
`.drv` files multiple times (worst case it's quadratic).
It happens because `alive` set was populating only runtime closure
without regard for actual configuration. The change fixes it.
Benchmark: my system has about 139MB, 40K `.drv` files.
Performance before the change:
$ time nix store gc --dry-run
real 4m22,148s
Performance after the change:
$ time nix store gc --dry-run
real 0m14,178s
|
|
Before the change on a system with `auto-optimise-store = true`:
$ nix store gc --verbose --max 1
deleted all the paths instead of one path (we requested 1 byte limit).
It happens because every file in `auto-optimise-store = true` has at
least 2 links: file itself and a link in /nix/store/.links/ directory.
The change conservatively assumes that any file that has one (as before)
or two links (assume auto-potimise mode) will free space.
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
|
|
Fixes #6169
|
|
Also use std::string_view in a few more places.
|
|
|
|
https://hydra.nixos.org/build/161439235
|
|
On macOS / BSD, these sockets inherit the non-blocking flag of the
server soocket, which is not what we want.
https://github.com/dotnet/runtime/issues/25069
https://bugs.python.org/issue7995
https://hydra.nixos.org/build/161439304
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The client thread can't just delete its own thread object from
connections, it has to detach it.
|
|
|
|
|
|
|
|
|
|
|
|
(where "referrers" includes the reverse of derivation outputs and
derivers). Now we do a full traversal to look if we can reach any
root. If not, all paths reached can be deleted.
|
|
|
|
|
|
|
|
The garbage collector no longer blocks other processes from
adding/building store paths or adding GC roots. To prevent the
collector from deleting store paths just added by another process,
processes need to connect to the garbage collector via a Unix domain
socket to register new temporary roots.
|
|
|
|
|
|
Useful when we're using a daemon with a chroot store, e.g.
$ NIX_DAEMON_SOCKET_PATH=/tmp/chroot/nix/var/nix/daemon-socket/socket nix-daemon --store /tmp/chroot
Then the client can now connect with
$ nix build --store unix:///tmp/chroot/nix/var/nix/daemon-socket/socket?root=/tmp/chroot nixpkgs#hello
|
|
Fixes bogus messages like "currently hard linking saves 17592186044416.00 MiB".
|
|
This matches the already-existing `local-fs-store.cc`.
|
|
|
|
Fix #4026
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builtins.readFile: do not truncate content
|
|
|
|
|