GNU bug report logs - #63839
[PATCH] gnu: riscv-pk: don't target riscv64-linux-gnu when current system is riscv64.

Previous Next

Package: guix-patches;

Reported by: Z572 <873216071 <at> qq.com>

Date: Fri, 2 Jun 2023 12:11:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 63839 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#63839; Package guix-patches. (Fri, 02 Jun 2023 12:11:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Z572 <873216071 <at> qq.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 02 Jun 2023 12:11:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Z572 <873216071 <at> qq.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: riscv-pk: don't target riscv64-linux-gnu when current
 system is riscv64.
Date: Fri,  2 Jun 2023 20:10:09 +0800
* gnu/packages/virtualization.scm (riscv-pk): don't target riscv64-linux-gnu
when current system is riscv64.
---
 gnu/packages/virtualization.scm | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index c88fd31146..1257bb531d 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -28,6 +28,7 @@
 ;;; Copyright © 2022 Ekaitz Zarraga <ekaitz <at> elenq.tech>
 ;;; Copyright © 2022 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2022 Zhu Zihao <all_but_last <at> 163.com>
+;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2554,16 +2555,21 @@ (define-public riscv-pk
          "1cc0rz4q3a1zw8756b8yysw8lb5g4xbjajh5lvqbjix41hbdx6xz"))))
     (build-system gnu-build-system)
     (arguments
-     (list #:out-of-source? #t
-           ;; riscv-pk can only be built for riscv64.
-           #:target "riscv64-linux-gnu"
-           #:make-flags #~(list (string-append "INSTALLDIR=" #$output))
-           ;; Add flags to keep symbols fromhost and tohost. These symbols are
-           ;; required for the correct functioning of pk.
-           #:strip-flags #~(list "--strip-unneeded"
-                                 "--keep-symbol=fromhost"
-                                 "--keep-symbol=tohost"
-                                 "--enable-deterministic-archives")))
+     (append
+      ;; riscv-pk can only be built for riscv64.
+      (if (string-prefix? "riscv64" (%current-system))
+          '()
+          (list
+           #:target "riscv64-linux-gnu"))
+      (list #:out-of-source? #t
+
+            #:make-flags #~(list (string-append "INSTALLDIR=" #$output))
+            ;; Add flags to keep symbols fromhost and tohost. These symbols are
+            ;; required for the correct functioning of pk.
+            #:strip-flags #~(list "--strip-unneeded"
+                                  "--keep-symbol=fromhost"
+                                  "--keep-symbol=tohost"
+                                  "--enable-deterministic-archives"))))
     (home-page "https://github.com/riscv-software-src/riscv-pk")
     (synopsis "RISC-V Proxy Kernel")
     (description "The RISC-V Proxy Kernel, @command{pk}, is a lightweight

base-commit: 75bdd4b05253c0e6ca5399f60e424f0f00fdb673
-- 
2.40.1





Information forwarded to guix-patches <at> gnu.org:
bug#63839; Package guix-patches. (Tue, 06 Jun 2023 15:49:01 GMT) Full text and rfc822 format available.

Message #8 received at 63839 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Z572 <873216071 <at> qq.com>, 63839 <at> debbugs.gnu.org
Subject: Re: [bug#63839] [PATCH] gnu: riscv-pk: don't target
 riscv64-linux-gnu when current system is riscv64.
Date: Tue, 06 Jun 2023 17:48:40 +0200
[Message part 1 (text/plain, inline)]
Hi,

Z572 via Guix-patches via <guix-patches <at> gnu.org> writes:


> +      ;; riscv-pk can only be built for riscv64.
> +      (if (string-prefix? "riscv64" (%current-system))
> +          '()
> +          (list
> +           #:target "riscv64-linux-gnu"))

I don't think that's a good idea, in general, consumers of the package
should be the ones specifying for which arch this package builds.  For
that purpose, there's the supported-systems field of the package record
type.  It's not good in general to hardcode targets in package
definitions.

Best,
-- 
Josselin Poiret
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#63839; Package guix-patches. (Sun, 11 Jun 2023 14:57:01 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Z572 <873216071 <at> qq.com>
To: Josselin Poiret <dev <at> jpoiret.xyz>
Cc: 63839 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#63839] [PATCH] gnu: riscv-pk: don't target
 riscv64-linux-gnu when current system is riscv64.
Date: Sun, 11 Jun 2023 22:48:20 +0800
Josselin Poiret via Guix-patches via <guix-patches <at> gnu.org> writes:

> [[PGP Signed Part:Undecided]]
> Hi,
>
> Z572 via Guix-patches via <guix-patches <at> gnu.org> writes:
>
>
>> +      ;; riscv-pk can only be built for riscv64.
>> +      (if (string-prefix? "riscv64" (%current-system))
>> +          '()
>> +          (list
>> +           #:target "riscv64-linux-gnu"))
>
> I don't think that's a good idea, in general, consumers of the package
> should be the ones specifying for which arch this package builds.  For
> that purpose, there's the supported-systems field of the package record
> type.  It's not good in general to hardcode targets in package
> definitions.
look it's name.

because it doesn't make sense to target other targets, like `u-boot-sifive-unmatched' or `opensbi-generic'.

>
> Best,


-- 
over





Information forwarded to guix-patches <at> gnu.org:
bug#63839; Package guix-patches. (Sun, 11 Jun 2023 15:02:01 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#63839; Package guix-patches. (Fri, 25 Aug 2023 13:12:01 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Z572 <873216071 <at> qq.com>
Cc: 63839 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#63839] [PATCH] gnu: riscv-pk: don't target
 riscv64-linux-gnu when current system is riscv64.
Date: Fri, 25 Aug 2023 15:11:07 +0200
[Message part 1 (text/plain, inline)]
Hi,

Any news on this patch?  I still stand by what I said: I believe it's
wrong for packages to force a target, this should be specified by the
caller instead, using `--target=`.  One can add the supported systems to
supported-systems to note that this package only works for some systems
though.

Best,
-- 
Josselin Poiret
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#63839; Package guix-patches. (Fri, 25 Aug 2023 13:12:02 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 302 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.