[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
103/376: Allow regular files as GC roots
From: |
Ludovic Courtès |
Subject: |
103/376: Allow regular files as GC roots |
Date: |
Wed, 28 Jan 2015 22:04:20 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit 1c208f2b7ef8ffb5e6d435d703dad83223a67bd6
Author: Eelco Dolstra <address@hidden>
Date: Fri Aug 1 16:46:01 2014 +0200
Allow regular files as GC roots
If a root is a regular file, then its name must denote a store
path. For instance, the existence of the file
/nix/var/nix/gcroots/per-user/eelco/hydra-roots/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7
would cause
/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7
to be a root.
This is useful because it involves less I/O (no need for a readlink()
call) and takes up less disk space (the symlink target typically takes
up a full disk block, while directory entries are packed more
efficiently). This is particularly important for hydra.nixos.org,
which has hundreds of thousands of roots, and where reading the roots
can take 25 minutes.
---
src/libstore/gc.cc | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index 96e891f..2e2e850 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -328,6 +328,12 @@ static void findRoots(StoreAPI & store, const Path & path,
Roots & roots)
}
}
+ else if (S_ISREG(st.st_mode)) {
+ Path storePath = settings.nixStore + "/" + baseNameOf(path);
+ if (store.isValidPath(storePath))
+ roots[path] = storePath;
+ }
+
}
catch (SysError & e) {
- 77/376: nix-daemon: Less verbosity, (continued)
- 77/376: nix-daemon: Less verbosity, Ludovic Courtès, 2015/01/28
- 74/376: nix-daemon: Use a thread instead of SIGPOLL to catch client disconnects, Ludovic Courtès, 2015/01/28
- 99/376: install-nix-from-closure.sh: Install cacert, Ludovic Courtès, 2015/01/28
- 93/376: nix-copy-closure: Implement --gzip via ssh's -C flag, Ludovic Courtès, 2015/01/28
- 91/376: Remove obsolete SSH master connection code, Ludovic Courtès, 2015/01/28
- 100/376: Rename nixPath to __nixPath, Ludovic Courtès, 2015/01/28
- 95/376: Change the default for use-ssh-substituter to ‘true’, Ludovic Courtès, 2015/01/28
- 90/376: Implement nix-copy-closure --from via nix-store --serve, Ludovic Courtès, 2015/01/28
- 97/376: Remove outdated AUTHORS file, Ludovic Courtès, 2015/01/28
- 92/376: Fix NIX_SSHOPTS, Ludovic Courtès, 2015/01/28
- 103/376: Allow regular files as GC roots,
Ludovic Courtès <=
- 94/376: nix-copy-closure: Drop --bzip2, --xz, --show-progress, Ludovic Courtès, 2015/01/28
- 84/376: Use pthread_cancel instead of a signal, Ludovic Courtès, 2015/01/28
- 102/376: Restore default SIGPIPE handler before invoking ‘man’, Ludovic Courtès, 2015/01/28
- 98/376: nix-profile.sh: Set $SSL_CERT_FILE, Ludovic Courtès, 2015/01/28
- 96/376: nix-daemon: Pass on the user's $SSH_AUTH_SOCK to the SSH substituter, Ludovic Courtès, 2015/01/28
- 101/376: make clean: Remove Makefile.config, Ludovic Courtès, 2015/01/28
- 105/376: findRoots(): Prevent a call to lstat(), Ludovic Courtès, 2015/01/28
- 108/376: Remove ugly hack for detecting build environment setup errors, Ludovic Courtès, 2015/01/28
- 107/376: Call commonChildInit() before doing chroot init, Ludovic Courtès, 2015/01/28
- 104/376: Make readDirectory() return inode / file type, Ludovic Courtès, 2015/01/28