substitute-binary: Ignore $GUIX_BINARY_SUBSTITUTE_URL.
* guix/scripts/substitute-binary.scm (%cache-url): Ignore the 'GUIX_BINARY_SUBSTITUTE_URL' environment variable. * test-env.in: Invoke 'guix-daemon' with '--substitute-urls'. * tests/substitute-binary.scm: Set '%cache-url' to the value of 'GUIX_BINARY_SUBSTITUTE_URL'.
This commit is contained in:
parent
9176607ec4
commit
4938b0eead
|
@ -625,20 +625,19 @@ found."
|
||||||
(assoc-ref (daemon-options) option))
|
(assoc-ref (daemon-options) option))
|
||||||
|
|
||||||
(define %cache-url
|
(define %cache-url
|
||||||
(or (getenv "GUIX_BINARY_SUBSTITUTE_URL")
|
(match (and=> (find-daemon-option "substitute-urls")
|
||||||
(match (and=> (find-daemon-option "substitute-urls")
|
string-tokenize)
|
||||||
string-tokenize)
|
((url)
|
||||||
((url)
|
url)
|
||||||
url)
|
((head tail ..1)
|
||||||
((head tail ..1)
|
;; Currently we don't handle multiple substitute URLs.
|
||||||
;; Currently we don't handle multiple substitute URLs.
|
(warning (_ "these substitute URLs will not be used:~{ ~a~}~%")
|
||||||
(warning (_ "these substitute URLs will not be used:~{ ~a~}~%")
|
tail)
|
||||||
tail)
|
head)
|
||||||
head)
|
(#f
|
||||||
(#f
|
;; This can only happen when this script is not invoked by the
|
||||||
;; This can only happen when this script is not invoked by the
|
;; daemon.
|
||||||
;; daemon.
|
"http://hydra.gnu.org")))
|
||||||
"http://hydra.gnu.org"))))
|
|
||||||
|
|
||||||
(define (guix-substitute-binary . args)
|
(define (guix-substitute-binary . args)
|
||||||
"Implement the build daemon's substituter protocol."
|
"Implement the build daemon's substituter protocol."
|
||||||
|
|
|
@ -81,7 +81,8 @@ then
|
||||||
# Launch the daemon without chroot support because is may be
|
# Launch the daemon without chroot support because is may be
|
||||||
# unavailable, for instance if we're not running as root.
|
# unavailable, for instance if we're not running as root.
|
||||||
"@abs_top_builddir@/pre-inst-env" \
|
"@abs_top_builddir@/pre-inst-env" \
|
||||||
"@abs_top_builddir@/guix-daemon" --disable-chroot &
|
"@abs_top_builddir@/guix-daemon" --disable-chroot \
|
||||||
|
--substitute-urls="$GUIX_BINARY_SUBSTITUTE_URL" &
|
||||||
|
|
||||||
daemon_pid=$!
|
daemon_pid=$!
|
||||||
trap "kill $daemon_pid ; rm -rf $NIX_STATE_DIR" EXIT
|
trap "kill $daemon_pid ; rm -rf $NIX_STATE_DIR" EXIT
|
||||||
|
|
|
@ -166,6 +166,9 @@ a file for NARINFO."
|
||||||
(define-syntax-rule (with-narinfo narinfo body ...)
|
(define-syntax-rule (with-narinfo narinfo body ...)
|
||||||
(call-with-narinfo narinfo (lambda () body ...)))
|
(call-with-narinfo narinfo (lambda () body ...)))
|
||||||
|
|
||||||
|
;; Transmit these options to 'guix substitute-binary'.
|
||||||
|
(set! (@@ (guix scripts substitute-binary) %cache-url)
|
||||||
|
(getenv "GUIX_BINARY_SUBSTITUTE_URL"))
|
||||||
|
|
||||||
(test-equal "query narinfo without signature"
|
(test-equal "query narinfo without signature"
|
||||||
"" ; not substitutable
|
"" ; not substitutable
|
||||||
|
|
Loading…
Reference in New Issue