From 3f4ecf32291779d9f75493a5e75cdbea2bc51adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 20 Mar 2016 22:44:03 +0100 Subject: gexp: Add #:disallowed-references. * guix/gexp.scm (gexp->derivation): Add #:disallowed-references and honor it. * tests/gexp.scm ("gexp->derivation #:disallowed-references, allowed") ("gexp->derivation #:disallowed-references"): New tests. * doc/guix.texi (G-Expressions): Adjust accordingly. --- tests/gexp.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests/gexp.scm') diff --git a/tests/gexp.scm b/tests/gexp.scm index d343dc3329..75b907abee 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -600,6 +600,30 @@ (build-derivations %store (list drv)) #f))) +(test-assertm "gexp->derivation #:disallowed-references, allowed" + (mlet %store-monad ((drv (gexp->derivation "disallowed-refs" + #~(begin + (mkdir #$output) + (chdir #$output) + (symlink #$output "self") + (symlink #$%bootstrap-guile + "guile")) + #:disallowed-references '()))) + (built-derivations (list drv)))) + + +(test-assert "gexp->derivation #:disallowed-references" + (let ((drv (run-with-store %store + (gexp->derivation "disallowed-refs" + #~(begin + (mkdir #$output) + (chdir #$output) + (symlink #$%bootstrap-guile "guile")) + #:disallowed-references (list %bootstrap-guile))))) + (guard (c ((nix-protocol-error? c) #t)) + (build-derivations %store (list drv)) + #f))) + (define shebang (string-append "#!" (derivation->output-path (%guile-for-build)) "/bin/guile --no-auto-compile")) -- cgit v1.2.3