diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-06-05 22:47:10 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-06-12 00:49:32 +0200 |
commit | 8cef92d0633850d97c1a1d4521812268f56672be (patch) | |
tree | 3bdb9872d697a7c9fb6d3cda76921ad002cd8da2 /guix/profiles.scm | |
parent | baf0a4288264098ede43e4f7cd099a29fcf35be4 (diff) |
profiles: Move some of the work to the build side.
When running:
guix environment --ad-hoc gnome --no-grafts --search-paths
this reduces wall-clock time by ~5%. The number of object cache lookups
goes down from 96K to 89K. (Note that 'gnome' is an interesting example
because it has many propagated inputs, which themselves have propagated
inputs too, which would lead to a long input list and a long manifest in
the 'profile-derivation' gexp.)
* guix/profiles.scm (profile-derivation)[inputs, search-paths]: Remove.
[extra-inputs]: New variable.
[builder]: Adjust call to 'build-profile'.
* guix/build/profiles.scm (manifest-sexp->inputs+search-paths): New
procedure.
(build-profile): Remove 'inputs' parameter; make 'manifest' the 2nd
positional parameter and add #:extra-inputs. Call
'manifest-sexp->inputs+search-paths' to obtain 'inputs' and
'search-paths'.
Diffstat (limited to 'guix/profiles.scm')
-rw-r--r-- | guix/profiles.scm | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/guix/profiles.scm b/guix/profiles.scm index ed5c10315a..8cbffa4d2b 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1812,12 +1812,10 @@ are cross-built for TARGET." (mapm/accumulate-builds (lambda (hook) (hook manifest)) hooks)))) - (define inputs - (append (filter-map (lambda (drv) - (and (derivation? drv) - (gexp-input drv))) - extras) - (manifest-inputs manifest))) + (define extra-inputs + (filter-map (lambda (drv) + (and (derivation? drv) (gexp-input drv))) + extras)) (define glibc-utf8-locales ;lazy reference (module-ref (resolve-interface '(gnu packages base)) @@ -1851,20 +1849,11 @@ are cross-built for TARGET." #+(if locales? set-utf8-locale #t) - (define search-paths - ;; Search paths of MANIFEST's packages, converted back to their - ;; record form. - (map sexp->search-path-specification - (delete-duplicates - '#$(map search-path-specification->sexp - (manifest-search-paths manifest))))) - - (build-profile #$output '#$inputs + (build-profile #$output '#$(manifest->gexp manifest) + #:extra-inputs '#$extra-inputs #:symlink #$(if relative-symlinks? #~symlink-relative - #~symlink) - #:manifest '#$(manifest->gexp manifest) - #:search-paths search-paths)))) + #~symlink))))) (gexp->derivation name builder #:system system |