mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
gexp: Fix expansion for (file-append (local-file ...) ...).
Fixes <https://bugs.gnu.org/41527>.
Regression introduced in d03001a31a
.
* guix/gexp.scm (lower+expand-object): When LOWERED is not a struct and
EXPAND is true, call EXPAND.
* tests/gexp.scm ("file-append, raw store item"): New test.
This commit is contained in:
parent
e033700f17
commit
abf43d4511
2 changed files with 17 additions and 1 deletions
|
@ -270,7 +270,9 @@ (define* (lower+expand-object obj
|
|||
(if (not expand)
|
||||
(loop lowered (lookup-expander lowered))
|
||||
(return (expand obj lowered output)))
|
||||
(return lowered))))))) ;self-quoting
|
||||
(if (not expand) ;self-quoting
|
||||
(return lowered)
|
||||
(return (expand obj lowered output)))))))))
|
||||
|
||||
(define-syntax define-gexp-compiler
|
||||
(syntax-rules (=> compiler expander)
|
||||
|
|
|
@ -285,6 +285,20 @@ (define (match-input thing)
|
|||
(((thing "out"))
|
||||
(eq? thing file))))))
|
||||
|
||||
(test-assert "file-append, raw store item"
|
||||
(let* ((obj (plain-file "example.txt" "Hello!"))
|
||||
(a (file-append obj "/a"))
|
||||
(b (file-append a "/b"))
|
||||
(c (file-append b "/c"))
|
||||
(exp #~(list #$c))
|
||||
(item (run-with-store %store (lower-object obj)))
|
||||
(lexp (run-with-store %store (lower-gexp exp))))
|
||||
(and (equal? (lowered-gexp-sexp lexp)
|
||||
`(list ,(string-append item "/a/b/c")))
|
||||
(equal? (lowered-gexp-sources lexp)
|
||||
(list item))
|
||||
(null? (lowered-gexp-inputs lexp)))))
|
||||
|
||||
(test-assertm "with-parameters for %current-system"
|
||||
(mlet* %store-monad ((system -> (match (%current-system)
|
||||
("aarch64-linux" "x86_64-linux")
|
||||
|
|
Loading…
Reference in a new issue