[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/10: pack: Make sure tests can run without a world rebuild.
From: |
guix-commits |
Subject: |
01/10: pack: Make sure tests can run without a world rebuild. |
Date: |
Mon, 27 Feb 2023 10:00:32 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit fee1d08f0dd183ef78bcb9f1534d7b9e7f1df7ac
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Feb 27 15:35:54 2023 +0100
pack: Make sure tests can run without a world rebuild.
Commit 68380db4c40a2ee1156349a87254fd7b1f1a52d5 moved from
'gexp->derivation', which as a side effect, would lead tests to require
a "world rebuild"--specifically, they'd have to build (default-guile).
This was mitigated by 68775338a510f84e63657ab09242d79e726fa457, but that
change introduced another regression.
* guix/scripts/pack.scm (populate-profile-root): Define 'bootstrap?'.
Pass #:guile to 'computed-file', with a value depending on 'bootstrap?'.
* tests/pack.scm ("self-contained-tarball + localstatedir")
("docker-image + localstatedir", "squashfs-image + localstatedir")
("deb archive with symlinks and control files")
("rpm archive can be installed/uninstalled"): Use a <profile> record
instead of a derivation.
---
guix/scripts/pack.scm | 8 +++++++-
tests/pack.scm | 40 ++++++++++++++++++++--------------------
2 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 51a7b8f185..eb41eb5563 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015, 2017-2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2017-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
@@ -220,6 +220,11 @@ items, which relies on hard links."
(file-append (store-database (list profile))
"/db/db.sqlite")))
+ (define bootstrap?
+ ;; Whether a '--bootstrap' environment is needed, for testing purposes.
+ ;; XXX: Infer that from available info.
+ (and (not database) (not (profile-locales? profile))))
+
(define (import-module? module)
;; Since we don't use deduplication support in 'populate-store', don't
;; import (guix store deduplication) and its dependencies, which includes
@@ -287,6 +292,7 @@ items, which relies on hard links."
(for-each (cut evaluate-populate-directive <> #$output)
directives)))
#:local-build? #f
+ #:guile (if bootstrap? %bootstrap-guile (default-guile))
#:options (list #:references-graphs `(("profile" ,profile))
#:target target)))
diff --git a/tests/pack.scm b/tests/pack.scm
index 734ae1c69b..87187bb62c 100644
--- a/tests/pack.scm
+++ b/tests/pack.scm
@@ -138,10 +138,10 @@
(test-assertm "self-contained-tarball + localstatedir" store
(mlet* %store-monad
((guile (set-guile-for-build (default-guile)))
- (profile (profile-derivation (packages->manifest
- (list %bootstrap-guile))
- #:hooks '()
- #:locales? #f))
+ (profile -> (profile
+ (content (packages->manifest (list %bootstrap-guile)))
+ (hooks '())
+ (locales? #f)))
(tarball (self-contained-tarball "tar-pack" profile
#:localstatedir? #t))
(check (gexp->derivation "check-tarball"
@@ -210,10 +210,10 @@
(test-assertm "docker-image + localstatedir" store
(mlet* %store-monad
((guile (set-guile-for-build (default-guile)))
- (profile (profile-derivation (packages->manifest
- (list %bootstrap-guile))
- #:hooks '()
- #:locales? #f))
+ (profile -> (profile
+ (content (packages->manifest (list %bootstrap-guile)))
+ (hooks '())
+ (locales? #f)))
(tarball (docker-image "docker-pack" profile
#:symlinks '(("/bin/Guile" -> "bin/guile"))
#:localstatedir? #t))
@@ -250,10 +250,10 @@
(test-assertm "squashfs-image + localstatedir" store
(mlet* %store-monad
((guile (set-guile-for-build (default-guile)))
- (profile (profile-derivation (packages->manifest
- (list %bootstrap-guile))
- #:hooks '()
- #:locales? #f))
+ (profile -> (profile
+ (content (packages->manifest (list %bootstrap-guile)))
+ (hooks '())
+ (locales? #f)))
(image (squashfs-image "squashfs-pack" profile
#:symlinks '(("/bin" -> "bin"))
#:localstatedir? #t))
@@ -288,10 +288,10 @@
(test-assertm "deb archive with symlinks and control files" store
(mlet* %store-monad
((guile (set-guile-for-build (default-guile)))
- (profile (profile-derivation (packages->manifest
- (list %bootstrap-guile))
- #:hooks '()
- #:locales? #f))
+ (profile -> (profile
+ (content (packages->manifest (list %bootstrap-guile)))
+ (hooks '())
+ (locales? #f)))
(deb (debian-archive
"deb-pack" profile
#:compressor %gzip-compressor
@@ -376,10 +376,10 @@
(test-assertm "rpm archive can be installed/uninstalled" store
(mlet* %store-monad
((guile (set-guile-for-build (default-guile)))
- (profile (profile-derivation (packages->manifest
- (list %bootstrap-guile))
- #:hooks '()
- #:locales? #f))
+ (profile -> (profile
+ (content (packages->manifest (list %bootstrap-guile)))
+ (hooks '())
+ (locales? #f)))
(rpm-pack (rpm-archive "rpm-pack" profile
#:compressor %gzip-compressor
#:symlinks '(("/bin/guile" -> "bin/guile"))
- branch master updated (2cf07434d8 -> cf9e0508b2), guix-commits, 2023/02/27
- 02/10: gexp: computed-file: Do not honor %guile-for-build., guix-commits, 2023/02/27
- 04/10: gnu: Add scheme48-prescheme., guix-commits, 2023/02/27
- 05/10: gnu: Add font-microsoft-cascadia., guix-commits, 2023/02/27
- 08/10: gnu: nvme-cli: Update to 2.3., guix-commits, 2023/02/27
- 07/10: gnu: Add libnvme., guix-commits, 2023/02/27
- 09/10: gnu: hwloc: Remove obsolete comments., guix-commits, 2023/02/27
- 10/10: gnu: hwloc: Skip failing test on non-x86 systems., guix-commits, 2023/02/27
- 01/10: pack: Make sure tests can run without a world rebuild.,
guix-commits <=
- 03/10: scripts: repl: Extend REPL %load-path with all channels., guix-commits, 2023/02/27
- 06/10: gnu: podman: Update to 4.4.1., guix-commits, 2023/02/27