mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 13:10:33 +02:00
grafts: Consider all the outputs in the graft mapping.
Before that, outputs of a derivation could be left referring to the
ungrafted version of the derivation.
* guix/grafts.scm (graft-derivation)[outputs]: Change to a list of
name/file pairs.
* guix/grafts.scm (graft-derivation)[build]: Add 'old-outputs' variable
and use it when computing 'mapping'. Use 'mapping' directly.
* tests/grafts.scm ("graft-derivation, multiple outputs"): New test.
This commit is contained in:
@@ -75,6 +75,26 @@
|
||||
(string=? (readlink (string-append graft "/sh")) one)
|
||||
(string=? (readlink (string-append graft "/self")) graft))))))
|
||||
|
||||
(test-assert "graft-derivation, multiple outputs"
|
||||
(let* ((build `(begin
|
||||
(symlink (assoc-ref %build-inputs "a")
|
||||
(assoc-ref %outputs "one"))
|
||||
(symlink (assoc-ref %outputs "one")
|
||||
(assoc-ref %outputs "two"))))
|
||||
(orig (build-expression->derivation %store "grafted" build
|
||||
#:inputs `(("a" ,%bash))
|
||||
#:outputs '("one" "two")))
|
||||
(repl (add-text-to-store %store "bash" "fake bash"))
|
||||
(grafted (graft-derivation %store orig
|
||||
(list (graft
|
||||
(origin %bash)
|
||||
(replacement repl))))))
|
||||
(and (build-derivations %store (list grafted))
|
||||
(let ((one (derivation->output-path grafted "one"))
|
||||
(two (derivation->output-path grafted "two")))
|
||||
(and (string=? (readlink one) repl)
|
||||
(string=? (readlink two) one))))))
|
||||
|
||||
(test-end)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user