From 5d0984595c77b1b0acd84eb4684f786de5f95aff Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 12 Jul 2014 22:11:12 +0200 Subject: gexp: Resolve the default system at '>>=' time. Partly fixes . Reported by David Thompson . * guix/gexp.scm (gexp->derivation): Change #:system to default #f. Use (%current-system) from within the 'mlet*'. * tests/gexp.scm ("gexp->derivation, default system"): New test. --- tests/gexp.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/gexp.scm') 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 @@ (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")) -- cgit v1.2.3