build-system/gnu: Distinguish between imported modules and used modules.

* guix/build-system/gnu.scm (gnu-build): Add the `imported-modules'
  keyword parameter.  Pass it to `build-expression->derivation'.
This commit is contained in:
Ludovic Courtès 2012-10-31 17:53:59 +01:00
parent f03da4a008
commit 111111d046

View file

@ -120,12 +120,21 @@ (define* (gnu-build store name source inputs
(phases '%standard-phases)
(system (%current-system))
(implicit-inputs? #t) ; useful when bootstrapping
(imported-modules '((guix build gnu-build-system)
(guix build utils)))
(modules '((guix build gnu-build-system)
(guix build utils))))
"Return a derivation called NAME that builds from tarball SOURCE, with
input derivation INPUTS, using the usual procedure of the GNU Build
System. The builder is run with GUILE, or with the distro's final Guile
package if GUILE is #f or omitted."
package if GUILE is #f or omitted.
The builder is run in a context where MODULES are used; IMPORTED-MODULES
specifies modules not provided by Guile itself that must be imported in
the builder's environment, from the host. Note that we distinguish
between both, because for Guile's own modules like (ice-9 foo), we want
to use GUILE's own version of it, rather than import the user's one,
which could lead to gratuitous input divergence."
(define builder
`(begin
(use-modules ,@modules)
@ -170,7 +179,7 @@ (define guile-for-build
(standard-inputs system))
'()))
#:outputs outputs
#:modules modules
#:modules imported-modules
#:guile-for-build guile-for-build))
(define gnu-build-system