From 344e39c928bdb8e6b7e5ac79d94535921a414a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 19 Oct 2023 16:39:06 +0200 Subject: =?UTF-8?q?profiles:=20Hooks=20honor=20the=20#:system=20parameter?= =?UTF-8?q?=20of=20=E2=80=98profile-derivation=E2=80=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . * 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 --- tests/profiles.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/profiles.scm b/tests/profiles.scm index 9ad03f2b24..9c419ada93 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013-2022 Ludovic Courtès +;;; Copyright © 2013-2023 Ludovic Courtès ;;; Copyright © 2014 Alex Kost ;;; ;;; 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 . + (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)) -- cgit v1.2.3