guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/05: build-system/gnu: Turn #:phases into a gexp when cross-compiling.


From: guix-commits
Subject: 01/05: build-system/gnu: Turn #:phases into a gexp when cross-compiling.
Date: Tue, 8 Nov 2022 08:06:44 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 3bd4b92f55f40119349e39902a9b800de98040d2
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Nov 8 12:11:03 2022 +0100

    build-system/gnu: Turn #:phases into a gexp when cross-compiling.
    
    Previously, we'd get this error:
    
      $ guix build --target=aarch64-linux-gnu r-minimal -d --no-grafts
      guix build: error: path ‘/gnu/store/[^-]+-glibc-[^-]+-static’ is not valid
    
    This is because the sexp would be passed as an input of the surrounding
    gexp in 'gnu-cross-build', and thus
    "/gnu/store/[^-]+-glibc-[^-]+-static" would be interpreted as a source
    file name, as in this example:
    
      scheme@(guix gexp)> #~(foo #$(list 'whatever 
"/gnu/store/[^-]+-glibc-[^-]+-static"))
      $11 = #<gexp (foo #<gexp-input (whatever 
"/gnu/store/[^-]+-glibc-[^-]+-static"):out>) 7f098badec30>
      scheme@(guix gexp)> (gexp-inputs $11)
      $12 = (#<gexp-input "/gnu/store/[^-]+-glibc-[^-]+-static":out>)
    
    Fixes <https://issues.guix.gnu.org/59073>.
    Reported by Christopher Baines <mail@cbaines.net>.
    
    * guix/build-system/gnu.scm (gnu-cross-build): When PHASES is a pair,
    pass it through 'sexp->gexp'.
---
 guix/build-system/gnu.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm
index 8eea1cd4c2..e62ee18367 100644
--- a/guix/build-system/gnu.scm
+++ b/guix/build-system/gnu.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 
Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012-2022 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -539,7 +539,9 @@ platform."
                                              (map
                                               search-path-specification->sexp
                                               native-search-paths))
-                   #:phases #$phases
+                   #:phases #$(if (pair? phases)
+                                  (sexp->gexp phases)
+                                  phases)
                    #:locale #$locale
                    #:bootstrap-scripts #$bootstrap-scripts
                    #:configure-flags #$configure-flags



reply via email to

[Prev in Thread] Current Thread [Next in Thread]