1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

guix build: Validate that the file passed to ‘-m’ returns a manifest.

* guix/scripts/build.scm (options->things-to-build)[ensure-manifest]:
New procedure.
Use it.

Change-Id: If64c483d7079f441a296d5bd4e06e67f44cbb7bf
This commit is contained in:
Ludovic Courtès
2024-11-26 10:51:20 +01:00
parent 5d6691d33e
commit c6050cce28

View File

@@ -629,6 +629,12 @@ values.")))))))))
(for-each validate-type lst)
lst))
(define (ensure-manifest x file)
(unless (manifest? x)
(raise (formatted-message (G_ "file '~a' does not return a manifest")
file)))
x)
(define system
(or (assoc-ref opts 'system) (%current-system)))
@@ -701,9 +707,11 @@ values.")))))))))
(loop tail 'regular
(append (map manifest-entry-item
(manifest-entries
(load* manifest
(make-user-module '((guix profiles)
(gnu))))))
(ensure-manifest
(load* manifest
(make-user-module '((guix profiles)
(gnu))))
manifest)))
result)))
(('expression . str)
(loop tail 'regular