[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/09: guix build: Allow non-package objects in manifest.
From: |
guix-commits |
Subject: |
02/09: guix build: Allow non-package objects in manifest. |
Date: |
Thu, 5 Mar 2020 11:14:48 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 5a675b2c67825e581cd8193f643f66c4cb1ea1e4
Author: Ludovic Courtès <address@hidden>
AuthorDate: Tue Mar 3 10:34:35 2020 +0100
guix build: Allow non-package objects in manifest.
* guix/scripts/build.scm (options->things-to-build)[manifest->packages]:
Remove.
Inline map of 'manifest-entry-item'.
* tests/guix-build.sh: Add test for "guix build -m" with non-package object.
---
guix/scripts/build.scm | 14 ++++----------
tests/guix-build.sh | 13 ++++++++++++-
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index eedf6bf..5c690cb 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -812,14 +812,6 @@ build---packages, gexps, derivations, and so on."
(for-each validate-type lst)
lst))
- ;; Note: Taken from (guix scripts refresh).
- (define (manifest->packages manifest)
- "Return the list of packages in MANIFEST."
- (filter-map (lambda (entry)
- (let ((item (manifest-entry-item entry)))
- (if (package? item) item #f)))
- (manifest-entries manifest)))
-
(append-map (match-lambda
(('argument . (? string? spec))
(cond ((derivation-path? spec)
@@ -844,8 +836,10 @@ build---packages, gexps, derivations, and so on."
(('file . file)
(ensure-list (load* file (make-user-module '()))))
(('manifest . manifest)
- (manifest->packages
- (load* manifest (make-user-module '((guix profiles)
(gnu))))))
+ (map manifest-entry-item
+ (manifest-entries
+ (load* manifest
+ (make-user-module '((guix profiles) (gnu)))))))
(('expression . str)
(ensure-list (read/eval str)))
(('argument . (? derivation? drv))
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index c1df6db..1a997de 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2016, 2017, 2018, 2019 Ludovic Courtès
<address@hidden>
+# Copyright © 2012, 2013, 2014, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès
<address@hidden>
# Copyright © 2020 Marius Bakke <address@hidden>
#
# This file is part of GNU Guix.
@@ -317,6 +317,17 @@ EOF
test `guix build -d --manifest="$module_dir/manifest.scm" \
| grep -e '-hello-' -e '-guix-' \
| wc -l` -eq 2
+
+# Building from a manifest that contains a non-package object.
+cat > "$module_dir/manifest.scm"<<EOF
+(manifest
+ (list (manifest-entry (name "foo") (version "0")
+ (item (computed-file "computed-thingie"
+ #~(mkdir (ungexp output)))))))
+EOF
+guix build -d -m "$module_dir/manifest.scm" \
+ | grep 'computed-thingie\.drv$'
+
rm "$module_dir"/*.scm
# Using 'GUIX_BUILD_OPTIONS'.
- branch master updated (94aab84 -> 5ec4156), guix-commits, 2020/03/05
- 01/09: ci: Move 'cross-jobs' procedure to the top level., guix-commits, 2020/03/05
- 03/09: weather: Allow non-package objects in manifest., guix-commits, 2020/03/05
- 05/09: tests: "make check-system" includes the current commit ID, if any., guix-commits, 2020/03/05
- 02/09: guix build: Allow non-package objects in manifest.,
guix-commits <=
- 04/09: tests: "make check-system" no longer interns source upfront., guix-commits, 2020/03/05
- 06/09: guix build: Parameterize '%graft?' upfront., guix-commits, 2020/03/05
- 07/09: weather: Parameterize '%graft?' upfront., guix-commits, 2020/03/05
- 08/09: tests: Add <system-test> gexp compiler., guix-commits, 2020/03/05
- 09/09: tests: Add a manifest for system tests., guix-commits, 2020/03/05