profiles: Move some of the work to the build side.
authorLudovic Courtès <ludo@gnu.org>
Sat, 5 Jun 2021 20:47:10 +0000 (22:47 +0200)
committerLudovic Courtès <ludo@gnu.org>
Fri, 11 Jun 2021 22:49:32 +0000 (00:49 +0200)
commit8cef92d0633850d97c1a1d4521812268f56672be
tree3bdb9872d697a7c9fb6d3cda76921ad002cd8da2
parentbaf0a4288264098ede43e4f7cd099a29fcf35be4
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'.
guix/build/profiles.scm
guix/profiles.scm