mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
guix build: -S returns the replacement's source.
Reported by Mark H Weaver. * guix/scripts/build.scm (options->derivations): When SRC and GRAFT? are true, use the source of P's replacement. * tests/guix-build.sh: Add test.
This commit is contained in:
parent
49c4fd2aab
commit
94d609aba8
2 changed files with 19 additions and 9 deletions
|
@ -592,6 +592,7 @@ (define graft? (assoc-ref opts 'graft?))
|
|||
(parameterize ((%graft? graft?))
|
||||
(append-map (match-lambda
|
||||
((? package? p)
|
||||
(let ((p (or (and graft? (package-replacement p)) p)))
|
||||
(match src
|
||||
(#f
|
||||
(list (package->derivation store p system)))
|
||||
|
@ -600,7 +601,7 @@ (define graft? (assoc-ref opts 'graft?))
|
|||
(list (package-source-derivation store s))))
|
||||
(proc
|
||||
(map (cut package-source-derivation store <>)
|
||||
(proc p)))))
|
||||
(proc p))))))
|
||||
((? derivation? drv)
|
||||
(list drv))
|
||||
((? procedure? proc)
|
||||
|
|
|
@ -43,6 +43,7 @@ trap "rm -rf $module_dir" EXIT
|
|||
|
||||
cat > "$module_dir/foo.scm"<<EOF
|
||||
(define-module (foo)
|
||||
#:use-module (guix tests)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix build-system trivial))
|
||||
|
@ -88,6 +89,10 @@ cat > "$module_dir/foo.scm"<<EOF
|
|||
(synopsis "Dummy package")
|
||||
(description "bar is a dummy package for testing.")
|
||||
(license #f)))
|
||||
|
||||
(define-public baz
|
||||
(dummy-package "baz" (replacement foo)))
|
||||
|
||||
EOF
|
||||
|
||||
GUIX_PACKAGE_PATH="$module_dir"
|
||||
|
@ -97,6 +102,10 @@ export GUIX_PACKAGE_PATH
|
|||
guix build -d -S foo
|
||||
guix build -d -S foo | grep -e 'foo\.tar\.gz'
|
||||
|
||||
# 'baz' has a replacement so we should be getting the replacement's source.
|
||||
(unset GUIX_BUILD_OPTIONS;
|
||||
test "`guix build -d -S baz`" = "`guix build -d -S foo`")
|
||||
|
||||
guix build -d --sources=package foo
|
||||
guix build -d --sources=package foo | grep -e 'foo\.tar\.gz'
|
||||
|
||||
|
|
Loading…
Reference in a new issue