From: Thiago Jung Bauermann via Guix-patches via <guix-patches@gnu.org>
To: 49672@debbugs.gnu.org
Cc: Thiago Jung Bauermann <bauermann@kolabnow.com>
Subject: [bug#49672] [PATCH 5/9] gnu: Use ‘current-target-nix-system’ in prefix checks
Date: Tue, 20 Jul 2021 22:00:39 -0300 [thread overview]
Message-ID: <20210721010043.632012-5-bauermann@kolabnow.com> (raw)
In-Reply-To: <20210721010043.632012-1-bauermann@kolabnow.com>
Some places check whether the system identifier starts with “<arch>-linux”,
which is a Nix system identifier. The GNU triplet identifier stored in
‘%current-target-system’ may not match the pattern if it includes a vendor
field.
Fix the problem by checking against ‘current-target-nix-system’, which
always returns a Nix system identifier.
* gnu/packages/bootloaders.scm (u-boot-tools)[arguments]<#:phases>: Use
‘current-target-nix-system’.
* gnu/packages/c.scm (tcc)[arguments]<#:configure-flags>: Likewise.
* gnu/packages/databases.scm (rocksdb)[arguments]<#:tests>: Likewise.
* gnu/packages/debug.scm (american-fuzzy-lop): Likewise.
(qemu-for-american-fuzzy-lop): Likewise.
* gnu/packages/golang.scm (go-1.4)[arguments]<#:system>: Likewise.
(go-1.14)[arguments]<#:system>: Likewise.
* gnu/packages/lisp.scm (clisp)[arguments]<#:configure-flags>: Likewise.
* gnu/packages/mes.scm (mes-0.19)[native-inputs]: Likewise.
---
gnu/packages/bootloaders.scm | 4 +---
gnu/packages/c.scm | 3 +--
gnu/packages/databases.scm | 3 +--
gnu/packages/debug.scm | 6 ++----
gnu/packages/golang.scm | 6 ++----
gnu/packages/lisp.scm | 3 +--
gnu/packages/mes.scm | 3 +--
7 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index be51fb0c3de4..669574468bd2 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -622,9 +622,7 @@ def test_ctrl_c"))
(invoke "test/image/test-imagetools.sh")))
;; Only run full test suite on x86_64 systems, as many tests
;; assume x86_64.
- ,@(if (string-match "^x86_64-linux"
- (or (%current-target-system)
- (%current-system)))
+ ,@(if (string-match "^x86_64-linux" (current-target-nix-system))
'((add-after 'check 'check-x86
(lambda* (#:key make-flags test-target #:allow-other-keys)
(apply invoke "make" "mrproper" make-flags)
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 1b9003ce09dd..f85bc2f4b6c9 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -88,8 +88,7 @@
(assoc-ref %build-inputs "libc")
"/lib")
,@(if (string-prefix? "armhf-linux"
- (or (%current-target-system)
- (%current-system)))
+ (current-target-nix-system))
`("--triplet=arm-linux-gnueabihf")
'()))
#:test-target "test"))
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 7de85d10c148..14367bde82b5 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -1379,8 +1379,7 @@ including field and record folding.")))
#:test-target "check_some"
;; Many tests fail on 32-bit platforms. There are multiple reports about
;; this upstream, but it's not going to be supported any time soon.
- #:tests? (let ((system ,(or (%current-target-system)
- (%current-system))))
+ #:tests? (let ((system ,(current-target-nix-system)))
(or (string-prefix? "x86_64-linux" system)
(string-prefix? "aarch64-linux" system)))
#:phases
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 3a29886b0e40..c5fad64692ae 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -172,8 +172,7 @@ tools that process C/C++ code.")
(license license:ncsa)))
(define-public american-fuzzy-lop
- (let ((machine (match (or (%current-target-system)
- (%current-system))
+ (let ((machine (match (current-target-nix-system)
("x86_64-linux" "x86_64")
("i686-linux" "i386")
("aarch64-linux" "aarch64")
@@ -248,8 +247,7 @@ down the road.")
(define-public qemu-for-american-fuzzy-lop
;; afl only supports using a single afl-qemu-trace executable, so
;; we only build qemu for the native target.
- (let ((machine (match (or (%current-target-system)
- (%current-system))
+ (let ((machine (match (current-target-nix-system)
("x86_64-linux" "x86_64")
("i686-linux" "i386")
("aarch64-linux" "aarch64")
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 58688687bba3..939dbc83ce71 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -1046,8 +1046,7 @@ your Go binary to be later served from an http.FileSystem.")
(guix build utils)
(srfi srfi-1))
#:tests? #f ; Tests are run by the all.bash script.
- ,@(if (string-prefix? "aarch64-linux" (or (%current-target-system)
- (%current-system)))
+ ,@(if (string-prefix? "aarch64-linux" (current-target-nix-system))
'(#:system "armhf-linux")
'())
#:phases
@@ -1199,8 +1198,7 @@ in the style of communicating sequential processes (@dfn{CSP}).")
(arguments
(substitute-keyword-arguments (package-arguments go-1.4)
((#:system system)
- (if (string-prefix? "aarch64-linux" (or (%current-target-system)
- (%current-system)))
+ (if (string-prefix? "aarch64-linux" (current-target-nix-system))
"aarch64-linux"
system))
((#:phases phases)
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index ee43226ff091..6fd1cd55e009 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -347,8 +347,7 @@ supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
("libsigsegv" ,libsigsegv)))
(arguments
`(#:configure-flags '(,@(if (string-prefix? "armhf-linux"
- (or (%current-target-system)
- (%current-system)))
+ (current-target-nix-system))
'("CFLAGS=-falign-functions=4")
'())
"--with-dynamic-ffi"
diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index c66751bc7c74..d4a8278697ca 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -174,8 +174,7 @@ parsers to allow execution with Guile as extension languages.")))
("nyacc" ,nyacc-0.86)))
(native-inputs
`(("guile" ,guile-2.2)
- ,@(let ((target-system (or (%current-target-system)
- (%current-system))))
+ ,@(let ((target-system (current-target-nix-system)))
(cond
((string-prefix? "x86_64-linux" target-system)
;; Use cross-compiler rather than #:system "i686-linux" to get
next prev parent reply other threads:[~2021-07-21 1:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-21 0:46 [bug#49672] [PATCH 0/9] Target check fixes and cleanups Thiago Jung Bauermann via Guix-patches via
2021-07-21 1:00 ` [bug#49672] [PATCH 1/9] gnu: Fix check of ‘%current-system’ and ‘%current-target-system’ Thiago Jung Bauermann via Guix-patches via
2021-07-21 1:00 ` [bug#49672] [PATCH 2/9] utils: Add ‘current-target-nix-system’ helper Thiago Jung Bauermann via Guix-patches via
2021-07-21 1:00 ` [bug#49672] [PATCH 3/9] gnu: Query membership in ‘supported-systems’ list with Nix identifier Thiago Jung Bauermann via Guix-patches via
2021-07-21 1:00 ` [bug#49672] [PATCH 4/9] gnu: Use ‘current-target-nix-system’ in pattern matches Thiago Jung Bauermann via Guix-patches via
2021-07-21 1:00 ` Thiago Jung Bauermann via Guix-patches via [this message]
2021-07-21 1:00 ` [bug#49672] [PATCH 6/9] gnu: Fix GNU/Linux system detection Thiago Jung Bauermann via Guix-patches via
2021-07-21 1:00 ` [bug#49672] [PATCH 7/9] bootloader: grub: Fix mix of GNU triplet and Nix system identifier Thiago Jung Bauermann via Guix-patches via
2021-07-21 1:00 ` [bug#49672] [PATCH 8/9] gnu: ustr: Don’t pass default argument Thiago Jung Bauermann via Guix-patches via
2021-07-21 1:00 ` [bug#49672] [PATCH 9/9] gnu: Use existing target helpers from ‘(guix utils)’ Thiago Jung Bauermann via Guix-patches via
2021-11-07 11:23 ` [bug#49672] [PATCH 0/9] Target check fixes and cleanups Maxime Devos
2021-11-12 0:56 ` Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40 ` [bug#49672] [PATCH v2 0/6] Target check fixes for cross compilation Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40 ` [bug#49672] [PATCH v2 1/6] gnu: Fix GNU/Linux system detection Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40 ` [bug#49672] [PATCH v2 2/6] gnu: libgc: Use default argument in ‘target-hurd?’ call Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40 ` [bug#49672] [PATCH v2 3/6] utils: Introduce the ‘current-target-nix-system’ procedure Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40 ` [bug#49672] [PATCH v2 4/6] gnu: Use ‘current-target-nix-system’ for matches Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40 ` [bug#49672] [PATCH v2 5/6] gnu: Query membership in ‘supported-systems’ list with Nix identifier Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40 ` [bug#49672] [PATCH v2 6/6] gnu: Fix check of ‘%current-system’ and ‘%current-target-system’ Thiago Jung Bauermann via Guix-patches via
2022-03-28 12:10 ` [bug#49672] [PATCH v2 0/6] Target check fixes for cross compilation Maxime Devos
2022-03-29 0:12 ` Thiago Jung Bauermann via Guix-patches via
2022-04-29 4:17 ` Thiago Jung Bauermann via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210721010043.632012-5-bauermann@kolabnow.com \
--to=guix-patches@gnu.org \
--cc=49672@debbugs.gnu.org \
--cc=bauermann@kolabnow.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.