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

profiles: Hooks honor the #:system parameter of ‘profile-derivation’.

Fixes <https://issues.guix.gnu.org/65225>.

* guix/profiles.scm (info-dir-file, package-cache-file)
(info-dir-file, ghc-package-cache-file, ca-certificate-bundle)
(emacs-subdirs, gdk-pixbuf-loaders-cache-file, glib-schemas)
(gtk-icon-themes, gtk-im-modules, linux-module-database)
(xdg-desktop-database, xdg-mime-database, fonts-dir-file)
(manual-database, manual-database/optional): Add optional #:system
parameter and pass it to ‘gexp->derivation’.
(profile-derivation): Pass HOOK a second parameter, SYSTEM.
* gnu/bootloader.scm (efi-bootloader-profile)[efi-bootloader-profile-hook]:
Add optional #:system parameter and pass it to ‘gexp->derivation’.
* guix/channels.scm (package-cache-file): Likewise.
* tests/profiles.scm ("profile-derivation, #:system, and hooks"): New
test.

Reported-by: Tobias Geerinckx-Rice <me@tobias.gr>
This commit is contained in:
Ludovic Courtès
2023-10-19 16:39:06 +02:00
parent 9d4b720e1f
commit 344e39c928
4 changed files with 60 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
;;;
;;; This file is part of GNU Guix.
@@ -382,6 +382,28 @@
(_ (built-derivations (list drv))))
(return (file-exists? (string-append bindir "/guile")))))
(test-assertm "profile-derivation, #:system, and hooks"
;; Make sure all the profile hooks are built for the system specified with
;; #:system, even if that does not match (%current-system).
;; See <https://issues.guix.gnu.org/65225>.
(mlet* %store-monad
((system -> (if (string=? (%current-system) "riscv64-linux")
"x86_64-linux"
"riscv64-linux"))
(entry -> (package->manifest-entry packages:coreutils))
(_ (set-guile-for-build (default-guile) system))
(drv (profile-derivation (manifest (list entry))
#:system system))
(refs (references* (derivation-file-name drv))))
(return (and (string=? (derivation-system drv) system)
(pair? refs)
(every (lambda (ref)
(or (not (string-suffix? ".drv" ref))
(let ((drv (read-derivation-from-file ref)))
(string=? (derivation-system drv)
system))))
refs)))))
(test-assertm "profile-derivation relative symlinks, one entry"
(mlet* %store-monad
((entry -> (package->manifest-entry %bootstrap-guile))