From dd3b9e84b9b0db53def58a2888827acbaccf4944 Mon Sep 17 00:00:00 2001 From: Zheng Junjie <873216071@qq.com> Date: Fri, 28 Jul 2023 21:33:52 +0800 Subject: utils: Add 'strip-for-target'. * guix/utils.scm (strip-for-target): New procedure. Signed-off-by: Mathieu Othacehe --- guix/utils.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'guix') diff --git a/guix/utils.scm b/guix/utils.scm index e9af33bdeb..7a42b49df2 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2022 Antero Mejr ;;; Copyright © 2023 Philip McGrath ;;; Copyright © 2023 Janneke Nieuwenhuizen +;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -111,6 +112,7 @@ cxx-for-target ld-for-target pkg-config-for-target + strip-for-target version-compare version>? @@ -784,6 +786,11 @@ architecture (x86_64)?" (string-append target "-pkg-config") "pkg-config")) +(define* (strip-for-target #:optional (target (%current-target-system))) + (if target + (string-append target "-strip") + "strip")) + (define version-compare (let ((strverscmp (let ((sym (or (dynamic-func "strverscmp" (dynamic-link)) -- cgit v1.2.3 From 67effc1560fc175dfbcb58ef5b965b08b3942d6c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Oct 2023 23:44:39 +0200 Subject: grafts: Fix corner case involving multiple-output derivations. Fixes a bug that would occur with references to two outputs of the same derivation, with one of them referring to the other one. For example, the references of libreoffice include both mariadb:dev and mariadb:lib; additionally, mariadb:dev refers to mariadb:lib. In this case, the glibc graft would not be applied on one of the mariadb paths, and both the grafted and ungrafted glibc would end up in the closure of libreoffice. Fixes . * guix/grafts.scm (non-self-references): Simplify and include references to outputs of DRV other than OUTPUTS. (reference-origins): Simplify and possibly return outputs of DRV itself. (cumulative-grafts)[graft-origin?]: Add OUTPUT parameter and honor it. [dependency-grafts]: Adjust accordingly. * tests/grafts.scm ("graft-derivation, multiple outputs need to be replaced"): New test. Change-Id: Iac2005024ab7049037537b3af55298696ec90e3c --- guix/grafts.scm | 43 +++++++++++++++++++------------------------ tests/grafts.scm | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 25 deletions(-) (limited to 'guix') diff --git a/guix/grafts.scm b/guix/grafts.scm index f93da32981..48f4c212f7 100644 --- a/guix/grafts.scm +++ b/guix/grafts.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014-2022 Ludovic Courtès +;;; Copyright © 2014-2023 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -176,11 +176,8 @@ references." (append-map (cut references/cached store <>) items)))) (append-map (cut references/cached store <>) items))) - (let ((refs (references* (map (cut derivation->output-path drv <>) - outputs))) - (self (match (derivation->output-paths drv) - (((names . items) ...) - items)))) + (let* ((self (map (cut derivation->output-path drv <>) outputs)) + (refs (references* self))) (remove (cut member <> self) refs))) (define %graft-cache @@ -207,7 +204,7 @@ references." (return result))))))) (define (reference-origins drv items) - "Return the derivation/output pairs among the inputs of DRV, recursively, + "Return the derivation/output pairs among DRV and its inputs, recursively, that produce ITEMS. Elements of ITEMS not produced by a derivation (i.e., it's a content-addressed \"source\"), or not produced by a dependency of DRV, have no corresponding element in the resulting list." @@ -238,13 +235,10 @@ have no corresponding element in the resulting list." ((set-contains? visited drv) (loop rest items result visited)) (else - (let* ((inputs - (map derivation-input-derivation - (derivation-inputs drv))) - (result items - (fold2 lookup-derivers - result items inputs))) - (loop (append rest inputs) + (let ((result items (lookup-derivers drv result items))) + (loop (append rest + (map derivation-input-derivation + (derivation-inputs drv))) items result (set-insert drv visited))))))))) @@ -258,16 +252,17 @@ GRAFTS to the dependencies of DRV. Return the resulting list of grafts. This is a monadic procedure in %STATE-MONAD where the state is a vhash mapping derivations to the corresponding set of grafts." - (define (graft-origin? drv graft) - ;; Return true if DRV corresponds to the origin of GRAFT. + (define (graft-origin? drv output graft) + ;; Return true if DRV and OUTPUT correspond to the origin of GRAFT. (match graft - (($ (? derivation? origin) output) - (match (assoc-ref (derivation->output-paths drv) output) - ((? string? result) - (string=? result - (derivation->output-path origin output))) - (_ - #f))) + (($ (? derivation? origin) origin-output) + (and (string=? origin-output output) + (match (assoc-ref (derivation->output-paths drv) output) + ((? string? result) + (string=? result + (derivation->output-path origin output))) + (_ + #f)))) (_ #f))) @@ -278,7 +273,7 @@ derivations to the corresponding set of grafts." ((drv . output) ;; If GRAFTS already contains a graft from DRV, do not ;; override it. - (if (find (cut graft-origin? drv <>) grafts) + (if (find (cut graft-origin? drv output <>) grafts) (state-return grafts) (cumulative-grafts store drv grafts #:outputs (list output) diff --git a/tests/grafts.scm b/tests/grafts.scm index 63dbb13830..24c4d24359 100644 --- a/tests/grafts.scm +++ b/tests/grafts.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014-2019, 2022 Ludovic Courtès +;;; Copyright © 2014-2019, 2022-2023 Ludovic Courtès ;;; Copyright © 2021 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -268,6 +268,54 @@ (readlink (string-append out "/two"))) (file-exists? (string-append out "/one/replacement"))))))) +(test-assert "graft-derivation, multiple outputs need to be replaced" + ;; Build a reference graph like this: + ;; + ;; ,- p2:out --. + ;; v v + ;; p1:one <---- p1:two + ;; | + ;; `-> p0 + ;; + ;; Graft p0r in lieu of p0, and make sure all the paths from the grafted p2 + ;; lead to p0r. See . + (let* ((p0 (build-expression->derivation + %store "p0" '(mkdir (assoc-ref %outputs "out")))) + (p0r (build-expression->derivation + %store "P0" + '(let ((out (assoc-ref %outputs "out"))) + (mkdir out) + (call-with-output-file (string-append out "/replacement") + (const #t))))) + (p1 (build-expression->derivation + %store "p1" + `(let ((one (assoc-ref %outputs "one")) + (two (assoc-ref %outputs "two")) + (p0 (assoc-ref %build-inputs "p0"))) + (mkdir one) + (mkdir two) + (symlink p0 (string-append one "/p0")) + (symlink one (string-append two "/link"))) + #:inputs `(("p0" ,p0)) + #:outputs '("one" "two"))) + (p2 (build-expression->derivation + %store "p2" + `(let ((out (assoc-ref %outputs "out"))) + (mkdir out) (chdir out) + (symlink (assoc-ref %build-inputs "p1:one") "one") + (symlink (assoc-ref %build-inputs "p1:two") "two")) + #:inputs `(("p1:one" ,p1 "one") + ("p1:two" ,p1 "two")))) + (p0g (list (graft + (origin p0) + (replacement p0r)))) + (p2d (graft-derivation %store p2 p0g))) + + (build-derivations %store (list p2d)) + (let ((out (derivation->output-path (pk 'p2d p2d)))) + (equal? (stat (string-append out "/one/p0/replacement")) + (stat (string-append out "/two/link/p0/replacement")))))) + (test-assert "graft-derivation with #:outputs" ;; Call 'graft-derivation' with a narrowed set of outputs passed as ;; #:outputs. -- cgit v1.2.3 From b3ec2a0d37b6494b04f38e20fc7ce450afb36d1d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 28 Oct 2023 00:09:55 +0200 Subject: environment: Honor ‘-s’ for guile-for-build. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partly fixes . * guix/scripts/environment.scm (guix-environment*): Pass SYSTEM to ‘package-derivation’ when defining ‘%guile-for-build’. Reported-by: Simon Tournier Change-Id: I9d883f1e61fac72754fdc9dee9b7c8a3dea32add --- guix/scripts/environment.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 9712389842..61ef639b46 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -1153,7 +1153,8 @@ command-line option processing with 'parse-command-line'." store (if bootstrap? %bootstrap-guile - (default-guile)))))) + (default-guile)) + system)))) (run-with-store store ;; Containers need a Bourne shell at /bin/sh. (mlet* %store-monad ((bash (environment-bash container? -- cgit v1.2.3 From 9d4b720e1f9e7581e340e4c84c3781af4ee72fde Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 19 Oct 2023 16:36:35 +0200 Subject: packages: Add ‘system’ parameter for ‘set-guile-for-build’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/packages.scm (set-guile-for-build): Add ‘system’ parameter. --- guix/packages.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/packages.scm b/guix/packages.scm index f70fad695e..e2e82692ad 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -2022,11 +2022,12 @@ symbolic output name, such as \"out\". Note that this procedure calls ;;; Monadic interface. ;;; -(define (set-guile-for-build guile) +(define* (set-guile-for-build guile #:optional system) "This monadic procedure changes the Guile currently used to run the build -code of derivations to GUILE, a package object." +code of derivations to GUILE, a package object, compiled for SYSTEM." (lambda (store) - (let ((guile (package-derivation store guile))) + (let ((guile (package-derivation store guile + (or system (%current-system))))) (values (%guile-for-build guile) store)))) (define* (package-file package -- cgit v1.2.3 From 344e39c928bdb8e6b7e5ac79d94535921a414a05 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 19 Oct 2023 16:39:06 +0200 Subject: profiles: Hooks honor the #:system parameter of ‘profile-derivation’. 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 --- gnu/bootloader.scm | 5 +++-- guix/channels.scm | 3 ++- guix/profiles.scm | 49 ++++++++++++++++++++++++++++++++----------------- tests/profiles.scm | 24 +++++++++++++++++++++++- 4 files changed, 60 insertions(+), 21 deletions(-) (limited to 'guix') diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 2c36d8c6cf..ba06de7618 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2017 David Craven ;;; Copyright © 2017, 2020, 2022 Mathieu Othacehe ;;; Copyright © 2017 Leo Famulari -;;; Copyright © 2019, 2021 Ludovic Courtès +;;; Copyright © 2019, 2021, 2023 Ludovic Courtès ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2022 Josselin Poiret ;;; Copyright © 2022 Reza Alizadeh Majd @@ -335,7 +335,7 @@ FILES may contain file like objects produced by procedures like plain-file, local-file, etc., or package contents produced with file-append. HOOKS lists additional hook functions to modify the profile." - (define (efi-bootloader-profile-hook manifest) + (define* (efi-bootloader-profile-hook manifest #:optional system) (define build (with-imported-modules '((guix build utils)) #~(begin @@ -383,6 +383,7 @@ HOOKS lists additional hook functions to modify the profile." (gexp->derivation "efi-bootloader-profile" build + #:system system #:local-build? #t #:substitutable? #f #:properties diff --git a/guix/channels.scm b/guix/channels.scm index 681adafc6c..f01903642d 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -926,7 +926,7 @@ specified." (entries -> (map instance->entry instances derivations))) (return (manifest entries)))) -(define (package-cache-file manifest) +(define* (package-cache-file manifest #:optional system) "Build a package cache file for the instance in MANIFEST. This is meant to be used as a profile hook." ;; Note: Emit a profile in format version 3, which was introduced in 2017 @@ -961,6 +961,7 @@ be used as a profile hook." (gexp->derivation-in-inferior "guix-package-cache" build profile + #:system system ;; If the Guix in PROFILE is too old and ;; lacks 'guix repl', don't build the cache diff --git a/guix/profiles.scm b/guix/profiles.scm index fea766879d..5d2fb8dc64 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -993,7 +993,7 @@ if not found." (anym %store-monad entry-lookup-package (manifest-entries manifest))) -(define (info-dir-file manifest) +(define* (info-dir-file manifest #:optional system) "Return a derivation that builds the 'dir' file for all the entries of MANIFEST." (define texinfo ;lazy reference @@ -1051,13 +1051,14 @@ MANIFEST." '#$(manifest-inputs manifest))))))) (gexp->derivation "info-dir" build + #:system system #:local-build? #t #:substitutable? #f #:properties `((type . profile-hook) (hook . info-dir)))) -(define (ghc-package-cache-file manifest) +(define* (ghc-package-cache-file manifest #:optional system) "Return a derivation that builds the GHC 'package.cache' file for all the entries of MANIFEST, or #f if MANIFEST does not have any GHC packages." (define ghc ;lazy reference @@ -1108,6 +1109,7 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages." (if (any (cut string-prefix? "ghc" <>) (map manifest-entry-name (manifest-entries manifest))) (gexp->derivation "ghc-package-cache" build + #:system system #:local-build? #t #:substitutable? #f #:properties @@ -1115,7 +1117,7 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages." (hook . ghc-package-cache))) (return #f)))) -(define (ca-certificate-bundle manifest) +(define* (ca-certificate-bundle manifest #:optional system) "Return a derivation that builds a single-file bundle containing the CA certificates in the /etc/ssl/certs sub-directories of the packages in MANIFEST. Single-file bundles are required by programs such as Git and Lynx." @@ -1179,13 +1181,14 @@ MANIFEST. Single-file bundles are required by programs such as Git and Lynx." #t)))))) (gexp->derivation "ca-certificate-bundle" build + #:system system #:local-build? #t #:substitutable? #f #:properties `((type . profile-hook) (hook . ca-certificate-bundle)))) -(define (emacs-subdirs manifest) +(define* (emacs-subdirs manifest #:optional system) (define build (with-imported-modules (source-module-closure '((guix build profiles) @@ -1219,13 +1222,14 @@ MANIFEST. Single-file bundles are required by programs such as Git and Lynx." (newline port) #t))))))) (gexp->derivation "emacs-subdirs" build + #:system system #:local-build? #t #:substitutable? #f #:properties `((type . profile-hook) (hook . emacs-subdirs)))) -(define (gdk-pixbuf-loaders-cache-file manifest) +(define* (gdk-pixbuf-loaders-cache-file manifest #:optional system) "Return a derivation that produces a loaders cache file for every gdk-pixbuf loaders discovered in MANIFEST." (define gdk-pixbuf ;lazy reference @@ -1264,6 +1268,7 @@ loaders discovered in MANIFEST." (if gdk-pixbuf (gexp->derivation "gdk-pixbuf-loaders-cache-file" build + #:system system #:local-build? #t #:substitutable? #f #:properties @@ -1271,7 +1276,7 @@ loaders discovered in MANIFEST." (hook . gdk-pixbuf-loaders-cache-file))) (return #f)))) -(define (glib-schemas manifest) +(define* (glib-schemas manifest #:optional system) "Return a derivation that unions all schemas from manifest entries and creates the Glib 'gschemas.compiled' file." (define glib ; lazy reference @@ -1318,6 +1323,7 @@ creates the Glib 'gschemas.compiled' file." ;; Don't run the hook when there's nothing to do. (if %glib (gexp->derivation "glib-schemas" build + #:system system #:local-build? #t #:substitutable? #f #:properties @@ -1325,7 +1331,7 @@ creates the Glib 'gschemas.compiled' file." (hook . glib-schemas))) (return #f)))) -(define (gtk-icon-themes manifest) +(define* (gtk-icon-themes manifest #:optional system) "Return a derivation that unions all icon themes from manifest entries and creates the GTK+ 'icon-theme.cache' file for each theme." (define gtk+ ; lazy reference @@ -1377,6 +1383,7 @@ creates the GTK+ 'icon-theme.cache' file for each theme." ;; Don't run the hook when there's nothing to do. (if %gtk+ (gexp->derivation "gtk-icon-themes" build + #:system system #:local-build? #t #:substitutable? #f #:properties @@ -1384,7 +1391,7 @@ creates the GTK+ 'icon-theme.cache' file for each theme." (hook . gtk-icon-themes))) (return #f)))) -(define (gtk-im-modules manifest) +(define* (gtk-im-modules manifest #:optional system) "Return a derivation that builds the cache files for input method modules for both major versions of GTK+." @@ -1454,6 +1461,7 @@ for both major versions of GTK+." #t)))) (if (or gtk+ gtk+-2) (gexp->derivation "gtk-im-modules" gexp + #:system system #:local-build? #t #:substitutable? #f #:properties @@ -1461,7 +1469,7 @@ for both major versions of GTK+." (hook . gtk-im-modules))) (return #f))))) -(define (linux-module-database manifest) +(define* (linux-module-database manifest #:optional system) "Return a derivation that unites all the kernel modules of the manifest and creates the dependency graph of all these kernel modules. @@ -1511,13 +1519,14 @@ This is meant to be used as a profile hook." (_ (error "Specified Linux kernel and Linux kernel modules are not all of the same version")))))))) (gexp->derivation "linux-module-database" build + #:system system #:local-build? #t #:substitutable? #f #:properties `((type . profile-hook) (hook . linux-module-database)))) -(define (xdg-desktop-database manifest) +(define* (xdg-desktop-database manifest #:optional system) "Return a derivation that builds the @file{mimeinfo.cache} database from desktop files. It's used to query what applications can handle a given MIME type." @@ -1551,6 +1560,7 @@ MIME type." ;; Don't run the hook when 'glib' is not referenced. (if glib (gexp->derivation "xdg-desktop-database" build + #:system system #:local-build? #t #:substitutable? #f #:properties @@ -1558,7 +1568,7 @@ MIME type." (hook . xdg-desktop-database))) (return #f)))) -(define (xdg-mime-database manifest) +(define* (xdg-mime-database manifest #:optional system) "Return a derivation that builds the @file{mime.cache} database from manifest entries. It's used to query the MIME type of a given file." (define shared-mime-info ; lazy reference @@ -1605,6 +1615,7 @@ entries. It's used to query the MIME type of a given file." ;; Don't run the hook when there are no GLib based applications. (if glib (gexp->derivation "xdg-mime-database" build + #:system system #:local-build? #t #:substitutable? #f #:properties @@ -1615,7 +1626,7 @@ entries. It's used to query the MIME type of a given file." ;; Several font packages may install font files into same directory, so ;; fonts.dir and fonts.scale file should be generated here, instead of in ;; packages. -(define (fonts-dir-file manifest) +(define* (fonts-dir-file manifest #:optional system) "Return a derivation that builds the @file{fonts.dir} and @file{fonts.scale} files for the fonts of the @var{manifest} entries." (define mkfontscale @@ -1676,6 +1687,7 @@ files for the fonts of the @var{manifest} entries." directories))))))) (gexp->derivation "fonts-dir" build + #:system system #:modules '((guix build utils) (guix build union) (srfi srfi-26)) @@ -1685,7 +1697,7 @@ files for the fonts of the @var{manifest} entries." `((type . profile-hook) (hook . fonts-dir)))) -(define (manual-database manifest) +(define* (manual-database manifest #:optional system) "Return a derivation that builds the manual page database (\"mandb\") for the entries in MANIFEST." (define gdbm-ffi @@ -1761,23 +1773,24 @@ the entries in MANIFEST." (force-output)))))) (gexp->derivation "manual-database" build + #:system system #:substitutable? #f #:local-build? #t #:properties `((type . profile-hook) (hook . manual-database)))) -(define (manual-database/optional manifest) +(define* (manual-database/optional manifest #:optional system) "Return a derivation to build the manual database of MANIFEST, but only if MANIFEST contains the \"man-db\" package. Otherwise, return #f." ;; Building the man database (for "man -k") is expensive and rarely used. ;; Build it only if the profile also contains "man-db". (mlet %store-monad ((man-db (manifest-lookup-package manifest "man-db"))) (if man-db - (manual-database manifest) + (manual-database manifest system) (return #f)))) -(define (texlive-font-maps manifest) +(define* (texlive-font-maps manifest #:optional system) "Return a derivation that builds the TeX Live font maps for the entries in MANIFEST." (define entry->texlive-input @@ -1898,6 +1911,7 @@ MANIFEST." ;; incomplete modular TeX Live installations to generate errors. (if (any texlive-scripts-entry? (manifest-entries manifest)) (gexp->derivation "texlive-font-maps" build + #:system system #:substitutable? #f #:local-build? #t #:properties @@ -1977,7 +1991,8 @@ are cross-built for TARGET." (extras (if (null? (manifest-entries manifest)) (return '()) (mapm/accumulate-builds (lambda (hook) - (hook manifest)) + (hook manifest + system)) hooks)))) (define extra-inputs (filter-map (lambda (drv) 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 From 661672a7f82db706be8dcc962d5e2385bdcf8c78 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 28 Oct 2023 01:21:56 +0200 Subject: environment: Parameterize ‘%graft?’ early on. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, ‘%graft?’ would be parameterized after ‘package-derivation’ had been called for ‘%guile-for-build’, which is too late. * guix/scripts/environment.scm (guix-environment*)[with-store/maybe]: Parameterize ‘%graft?’. Remove ‘%graft?’ parameterization from body. Change-Id: I65ef4a8c5f27e19a49196005871e5f7057fabaec --- guix/scripts/environment.scm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'guix') diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 61ef639b46..ad5d6a1026 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -1100,17 +1100,18 @@ command-line option processing with 'parse-command-line'." ;; Evaluate EXP... with STORE bound to a connection, unless ;; STORE-NEEDED? is false, in which case STORE is bound to #f. (let ((proc (lambda (store) exp ...))) - (if store-needed? - (with-store s - (set-build-options-from-command-line s opts) - (with-build-handler (build-notifier #:use-substitutes? - (assoc-ref opts 'substitutes?) - #:verbosity - (assoc-ref opts 'verbosity) - #:dry-run? - (assoc-ref opts 'dry-run?)) - (proc s))) - (proc #f)))) + (parameterize ((%graft? (assoc-ref opts 'graft?))) + (if store-needed? + (with-store s + (set-build-options-from-command-line s opts) + (with-build-handler (build-notifier #:use-substitutes? + (assoc-ref opts 'substitutes?) + #:verbosity + (assoc-ref opts 'verbosity) + #:dry-run? + (assoc-ref opts 'dry-run?)) + (proc s))) + (proc #f))))) (when container? (assert-container-features)) @@ -1146,8 +1147,7 @@ command-line option processing with 'parse-command-line'." (warning (G_ "no packages specified; creating an empty environment~%"))) ;; Use the bootstrap Guile when requested. - (parameterize ((%graft? (assoc-ref opts 'graft?)) - (%guile-for-build + (parameterize ((%guile-for-build (and store-needed? (package-derivation store -- cgit v1.2.3 From 6eb147dc3146ff6e9651491f8dfa2406c22b9ac5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 28 Oct 2023 01:23:41 +0200 Subject: environment: Fix typo in error messages. * guix/scripts/environment.scm (guix-environment*): Fix typo in error messages. Change-Id: I0b8669cb43267d0456a70f3b157514a6bcc725e8 --- guix/scripts/environment.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index ad5d6a1026..6ae3b11e39 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -1123,11 +1123,11 @@ command-line option processing with 'parse-command-line'." (when no-cwd? (leave (G_ "--no-cwd cannot be used without '--container'~%"))) (when emulate-fhs? - (leave (G_ "'--emulate-fhs' cannot be used without '--container~%'"))) + (leave (G_ "'--emulate-fhs' cannot be used without '--container'~%"))) (when nesting? - (leave (G_ "'--nesting' cannot be used without '--container~%'"))) + (leave (G_ "'--nesting' cannot be used without '--container'~%"))) (when (pair? symlinks) - (leave (G_ "'--symlink' cannot be used without '--container~%'")))) + (leave (G_ "'--symlink' cannot be used without '--container'~%")))) (with-store/maybe store (with-status-verbosity (assoc-ref opts 'verbosity) -- cgit v1.2.3 From 84fbfa82af73ee156441935fbc1fa27e017cda90 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Fri, 27 Oct 2023 21:24:17 +0300 Subject: build-system/go: Use gccgo when go isn't supported. * guix/build-system/go.scm (default-gccgo): New variable. (lower): Only use default-go when it is supported. Change-Id: I30564d97703344df582accaf741f4fcd159b6be1 --- guix/build-system/go.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm index 0a9761aac7..0934fded07 100644 --- a/guix/build-system/go.scm +++ b/guix/build-system/go.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2021-2022 Ludovic Courtès -;;; Copyright © 2021 Efraim Flashner +;;; Copyright © 2021, 2023 Efraim Flashner ;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. @@ -114,12 +114,19 @@ commit hash and its date rather than a proper release tag." (let ((go (resolve-interface '(gnu packages golang)))) (module-ref go 'go))) +(define (default-gccgo) + ;; Lazily resolve the binding to avoid a circular dependency. + (let ((gcc (resolve-interface '(gnu packages gcc)))) + (module-ref gcc 'gccgo-12))) + (define (make-go-std) (module-ref (resolve-interface '(gnu packages golang)) 'make-go-std)) (define* (lower name #:key source inputs native-inputs outputs system target - (go (default-go)) + (go (if (supported-package? (default-go)) + (default-go) + (default-gccgo))) #:allow-other-keys #:rest arguments) "Return a bag for NAME." -- cgit v1.2.3 From 7a14f9365aeac503097dab5bf2576cfd69eb89f3 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 3 Nov 2023 14:46:53 +0100 Subject: guix: Upgrade to Bioconductor 3.18. * guix/build-system/r.scm (bioconductor-uri): Bump Bioconductor version to 3.18. * guix/import/cran.scm (%bioconductor-version): Same. Change-Id: Ic3fc2e6ab6b5f6f6e55662f81baee67391158c5b --- guix/build-system/r.scm | 2 +- guix/import/cran.scm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm index 657346bea3..7ab4db82b6 100644 --- a/guix/build-system/r.scm +++ b/guix/build-system/r.scm @@ -60,7 +60,7 @@ release corresponding to NAME and VERSION." "/src/contrib/" name "_" version ".tar.gz") ;; TODO: use %bioconductor-version from (guix import cran) - (string-append "https://bioconductor.org/packages/3.17" + (string-append "https://bioconductor.org/packages/3.18" type-url-part "/src/contrib/" name "_" version ".tar.gz")))) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 59c65f9fa5..ca984cb49c 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -181,9 +181,9 @@ package definition." (define %cran-canonical-url "https://cran.r-project.org/package=") (define %bioconductor-url "https://bioconductor.org/packages/") -;; The latest Bioconductor release is 3.17. Bioconductor packages should be +;; The latest Bioconductor release is 3.18. Bioconductor packages should be ;; updated together. -(define %bioconductor-version "3.17") +(define %bioconductor-version "3.18") (define* (bioconductor-packages-list-url #:optional type) (string-append "https://bioconductor.org/packages/" -- cgit v1.2.3