aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2024-11-26 10:51:20 +0100
committerLudovic Courtès <ludo@gnu.org>2024-12-01 20:14:16 +0100
commitc6050cce28cfcbdc4c74886595da07005d33e3b0 (patch)
tree3989a63a3857e56164902e0f3c1e77c062d39ebe
parent5d6691d33ec0b1225696d2545763ec28effc32e9 (diff)
downloadguix-c6050cce28cfcbdc4c74886595da07005d33e3b0.tar.gz
guix-c6050cce28cfcbdc4c74886595da07005d33e3b0.zip
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
-rw-r--r--guix/scripts/build.scm14
1 files changed, 11 insertions, 3 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 5c93dc78f8..d1368f7e48 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -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