mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
union: Don't traverse sub-directories only found in one element of the union.
This significantly reduces I/O when building profiles, especially with
lots of package-specific sub-directories (such as 'share/emacs/24.3',
'texmf', etc.)
* guix/build/union.scm (union-build)[file-tree](others-have-it?): New
procedure. Use it in the 'enter?' parameter of 'file-system-fold';
change 'skip' parameter accordingly.
* tests/union.scm ("union-build"): Ensure that 'include' is a symlink
and 'bin' is a directory.
This commit is contained in:
@@ -114,7 +114,17 @@
|
||||
(file-exists? "bin/ld")
|
||||
(file-exists? "lib/libc.so")
|
||||
(directory-exists? "lib/gcc")
|
||||
(file-exists? "include/unistd.h"))))))
|
||||
(file-exists? "include/unistd.h")
|
||||
|
||||
;; The 'include' sub-directory is only found in
|
||||
;; glibc-bootstrap, so it should be unified in a
|
||||
;; straightforward way, without traversing it.
|
||||
(eq? 'symlink (stat:type (lstat "include")))
|
||||
|
||||
;; Conversely, several inputs have a 'bin' sub-directory, so
|
||||
;; unifying it requires traversing them all, and creating a
|
||||
;; new 'bin' sub-directory in the profile.
|
||||
(eq? 'directory (stat:type (lstat "bin"))))))))
|
||||
|
||||
(test-end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user