From: Efraim Flashner <efraim@flashner.co.il>
To: Christopher Baines <mail@cbaines.net>
Cc: 70985@debbugs.gnu.org
Subject: [bug#70985] [PATCH v2 5/6] gnu: rust: Guard against cross-libc returning #f.
Date: Sun, 7 Jul 2024 19:26:35 +0300 [thread overview]
Message-ID: <ZorBu8Qi1799cAPs@pbp> (raw)
In-Reply-To: <0c15a853521c4a9cfa8f4c3558e3aee9fb0a9d91.1720195563.git.mail@cbaines.net>
[-- Attachment #1: Type: text/plain, Size: 2728 bytes --]
On Fri, Jul 05, 2024 at 06:06:02PM +0200, Christopher Baines wrote:
> * gnu/packages/rust.scm (make-rust-sysroot/implementation): Guard against
> cross-libc returning #f.
>
> Change-Id: Ia0d5c889c6f5cd3478ad985c79feb9ba1c472c29
> ---
> gnu/packages/rust.scm | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
> index a385344473..f1de34b277 100644
> --- a/gnu/packages/rust.scm
> +++ b/gnu/packages/rust.scm
> @@ -73,7 +73,9 @@ (define-module (gnu packages rust)
> #:use-module (ice-9 match)
> #:use-module (ice-9 optargs)
> #:use-module (srfi srfi-1)
> - #:use-module (srfi srfi-26))
> + #:use-module (srfi srfi-26)
> + #:use-module (srfi srfi-34)
> + #:use-module (srfi srfi-35))
>
> ;; This is the hash for the empty file, and the reason it's relevant is not
> ;; the most obvious.
> @@ -1464,7 +1466,11 @@ (define make-rust-sysroot/implementation
> (modify-inputs (package-native-inputs base-rust)
> (prepend (cross-gcc target
> #:libc (cross-libc target))
> - (cross-libc target)
> + (or (cross-libc target) ; could be #f
> + (raise (condition
> + (&package-unsupported-target-error
> + (package (libc-for-target target))
> + (target target)))))
> (cross-binutils target)))))
> (properties
> `((hidden? . #t)
> --
> 2.45.2
rust does support architectures without a libc, for example the mingw
targets a few lines above this snippet. I think it would make more sense
to only include (cross-libc target) and not if not.
I just tried building zoxide for powerpc-linux-gnu without (cross-libc
target) and it tried to link with the x86_64 libc, so it looks like it
is necessary where it is available.
How about we make this section even worse with:
(if (false-if-exception (cross-libc target))
(modify-inputs ...
(cross-libc target)
...)
(modify-inputs ...)) ; no (cross-libc target)
In the meantime, I'll try to figure something out for actually putting
everything inside one modify-inputs so we don't have an ever expanding
number of them.
--
Efraim Flashner <efraim@flashner.co.il> רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-07-07 16:31 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 14:59 [bug#70985] [PATCH 0/4] Use specific errors for unsupported targets Christopher Baines
2024-05-16 15:06 ` [bug#70985] [PATCH 1/4] guix: packages: Add new &package-unsupported-target-error Christopher Baines
2024-05-16 15:06 ` [bug#70985] [PATCH 2/4] gnu: tls: Raise conditions from target->openssl-target Christopher Baines
2024-05-16 15:06 ` [bug#70985] [PATCH 3/4] gnu: cross-libc*: Raise conditions rather than returning #f Christopher Baines
2024-05-16 15:15 ` Ludovic Courtès
2024-05-16 16:16 ` Christopher Baines
2024-05-16 15:06 ` [bug#70985] [PATCH 4/4] guix: build-system: meson: Don't error on unsupported targets Christopher Baines
2024-05-16 15:13 ` Ludovic Courtès
2024-05-16 16:10 ` Christopher Baines
2024-05-16 15:16 ` [bug#70985] [PATCH 0/4] Use specific errors for " Ludovic Courtès
2024-05-17 9:53 ` [bug#70985] [PATCH 3/4] gnu: cross-libc*: Raise conditions rather than returning #f Jean-Pierre De Jesus Diaz
2024-07-05 16:05 ` [bug#70985] [PATCH v2 1/6] guix: packages: Add new &package-unsupported-target-error Christopher Baines
2024-07-05 16:05 ` [bug#70985] [PATCH v2 2/6] gnu: tls: Raise conditions from target->openssl-target Christopher Baines
2024-07-05 16:06 ` [bug#70985] [PATCH v2 3/6] guix: packages: Add &unsupported-cross-compilation-target-error Christopher Baines
2024-07-05 16:06 ` [bug#70985] [PATCH v2 4/6] build-system: meson: Use a more specific exception Christopher Baines
2024-07-05 16:06 ` [bug#70985] [PATCH v2 5/6] gnu: rust: Guard against cross-libc returning #f Christopher Baines
2024-07-07 16:26 ` Efraim Flashner [this message]
2024-07-07 16:57 ` Efraim Flashner
2024-07-09 9:25 ` Christopher Baines
2024-07-09 15:21 ` Efraim Flashner
2024-07-12 13:56 ` Christopher Baines
2024-07-05 16:06 ` [bug#70985] [PATCH v2 6/6] build-system: go: Properly handle when a target is unsupported Christopher Baines
2024-07-12 13:41 ` [bug#70985] [PATCH v3 1/6] guix: packages: Add new &package-unsupported-target-error Christopher Baines
2024-07-12 13:41 ` [bug#70985] [PATCH v3 2/6] gnu: tls: Raise conditions from target->openssl-target Christopher Baines
2024-07-12 13:41 ` [bug#70985] [PATCH v3 3/6] guix: packages: Add &unsupported-cross-compilation-target-error Christopher Baines
2024-07-12 13:41 ` [bug#70985] [PATCH v3 4/6] build-system: meson: Use a more specific exception Christopher Baines
2024-07-12 13:41 ` [bug#70985] [PATCH v3 5/6] gnu: rust: Guard against unsupported rust targets Christopher Baines
2024-07-12 14:28 ` Efraim Flashner
2024-07-18 14:16 ` bug#70985: " Christopher Baines
2024-07-12 13:41 ` [bug#70985] [PATCH v3 6/6] build-system: go: Properly handle when a target is unsupported Christopher Baines
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZorBu8Qi1799cAPs@pbp \
--to=efraim@flashner.co.il \
--cc=70985@debbugs.gnu.org \
--cc=mail@cbaines.net \
/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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).