[PATCH] gnu: riscv-pk: don't target riscv64-linux-gnu when current system is riscv64.

  • Open
  • quality assurance status badge
Details
2 participants
  • Z572
  • Josselin Poiret
Owner
unassigned
Submitted by
Z572
Severity
normal
Z
(address . guix-patches@gnu.org)
tencent_D0FFDA97CD8454B0ACE9BF6F9DB7F29E1207@qq.com
* 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(-)

Toggle diff (48 lines)
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@elenq.tech>
;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
+;;; Copyright © 2023 Zheng Junjie <873216071@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
J
J
Josselin Poiret wrote on 6 Jun 2023 17:48
87ilc08ucn.fsf@jpoiret.xyz
Hi,

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


Toggle quote (6 lines)
> + ;; 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
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmR/VVgQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5FhcaihBoC/98OZmmPkD0dHy5lKQPDcIUPv+u7GAsejos
42KetAPPye6vmQp/oUNiSq4n2VN49zto4SlLlIFPfV41CmYz2Tj/K7DPOIQznD6Z
6ft8nMlxP0qQoveQqJxnuXTseZVeIFpu/0gnqJjI2eNwhNceA3GfASJ9Fs8lOmel
KuSHh4o/KauDHDUHVIrYPnCTic0ECGZdlRvKFPVGYXtzwd5KNGWOnVSBbOB6P6L0
dCGe5G9D7687rxZFrPmdQ4QoZxyN2rOUBxlBkOyfFYwQJjKQNWLY1GSg3kesBvy5
H+oQyYQmT657jrXeiaauYnArBxq9mG48RgK3FVo8tcXz8evF8KTBNIEcH/ZTX5nN
CBfI7DobQWfXyeyGfip7z2KrNnTdmEJgWUm+Y5wLM25VGnsMuih5G7/2Vp4utoRm
PE3fwfbBk55IEQOs0YGy3+mhzDg51fjwsZSZwfGxGUqTxDXjLqbBR3ih1GyO3HqT
etH4HKAnrIUVTXXOvryMhVX73FiJOg4=
=HiqF
-----END PGP SIGNATURE-----

Z
(name . Josselin Poiret)(address . dev@jpoiret.xyz)
tencent_1AFC29EB9C973794BCD4C66F2EA45E67050A@qq.com
Josselin Poiret via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (17 lines)
> [[PGP Signed Part:Undecided]]
> Hi,
>
> Z572 via Guix-patches via <guix-patches@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'.

Toggle quote (4 lines)
>
> Best,


--
over
J
J
Josselin Poiret wrote on 25 Aug 2023 15:11
(name . Z572)(address . 873216071@qq.com)
87ttsntggk.fsf@jpoiret.xyz
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
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmToqGsQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5Fhcaiu48C/0aYvqvUTd6AenlCfVDd9a/Mk5YWwRjOEqU
KVSN4luVmHTWZYgqtdi2Q14JvjMIbaURKV2SZVlOcRgdkbNUIoHtEMxzu23PkYTy
WBWoFiAulostMCKN2NWMnqAwoKGAcx+iSHgvgqQCSmRgtZzqN4+OCmSKDZqeBoKY
vi83KzpW0rvVH3P9gUrgbX+oMB5AvogSqCxWnZZPuZh6TpFpUtTs7ss1ktq2DWDu
Ienuci1E2RxIMuJIfPm1GUugN4s5ruXdHNOGcnNMuA3Nd3QXpcAq7axYkEVW3+Me
S4cNfBVbhaHRyty0tWRo7gqQHJJ01T4NQpcGcebGHzfcp0/x/I7uIO3s+0tQ5vUo
JkvkybMlveEF9yjajiY3ebzLBGFgqOSwByExQz1PRIPUVq6SFxBNUcIMULjnvybg
aHzVJRNAaMJQhBZIlq+QkSFe2I1RcEwi1etze6V1xkXUDxO7I6SHaqaxL9INYGyi
jEwY3PA9YcF6I7hiZYOf+OvZ08njKzU=
=3VMt
-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 63839@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 63839
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch