diff --git a/guix/gexp.scm b/guix/gexp.scm index 3b154d400f..7d6a882787 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -94,7 +94,7 @@ (define (lower-inputs inputs) (define* (gexp->derivation name exp #:key - (system (%current-system)) + system hash hash-algo recursive? (env-vars '()) (modules '()) @@ -114,6 +114,7 @@ (define %modules modules) (define outputs (gexp-outputs exp)) (mlet* %store-monad ((inputs (lower-inputs (gexp-inputs exp))) + (system -> (or system (%current-system))) (sexp (gexp->sexp exp)) (builder (text-file (string-append name "-builder") (object->string sexp))) diff --git a/tests/gexp.scm b/tests/gexp.scm index 60adf497ed..b0ff1019e6 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -211,6 +211,17 @@ (define (match-input thing) (return (string=? (readlink (string-append out "/foo")) guile)))) +(test-assertm "gexp->derivation, default system" + ;; The default system should be the one at '>>=' time, not the one at + ;; invocation time. See . + (let ((system (%current-system)) + (mdrv (parameterize ((%current-system "foobar64-linux")) + (gexp->derivation "foo" + (gexp + (mkdir (ungexp output))))))) + (mlet %store-monad ((drv mdrv)) + (return (string=? system (derivation-system drv)))))) + (define shebang (string-append (derivation->output-path guile-for-build) "/bin/guile --no-auto-compile"))