* [bug#45591] environment: gracefully handle unsupported system.
@ 2021-01-01 10:53 guy fleury iteriteka via Guix-patches via
2021-01-13 14:37 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: guy fleury iteriteka via Guix-patches via @ 2021-01-01 10:53 UTC (permalink / raw)
To: 45591
[-- Attachment #1: Type: text/plain, Size: 77 bytes --]
hi guix,
if this patch looks good, feel free to change message diagnostic.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-environment-gracefully-handle-unsupported-system.patch --]
[-- Type: text/x-diff, Size: 1074 bytes --]
From d9b4727885744abda8afc179182a2cc975122487 Mon Sep 17 00:00:00 2001
From: guy fleury iteriteka <gfleury@disroot.org>
Date: Fri, 1 Jan 2021 11:01:49 +0200
Subject: [PATCH] environment: gracefully handle unsupported system.
* guix/scripts/environment.scm(guix-environment): Add a test
to ensure that the system is supported.
---
guix/scripts/environment.scm | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index e435bf0..40af012 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -719,6 +719,10 @@ message if any test fails."
(mappings (pick-all opts 'file-system-mapping))
(white-list (pick-all opts 'inherit-regexp)))
+ (when (not (member system '("armhf-linux" "aarch64-linux"
+ "i686-linux" "x86_64-linux" "i586-gnu")))
+ (leave (G_ "guix does not support ~A system~%") system))
+
(when container? (assert-container-features))
(when (and (not container?) link-prof?)
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [bug#45591] environment: gracefully handle unsupported system.
2021-01-01 10:53 [bug#45591] environment: gracefully handle unsupported system guy fleury iteriteka via Guix-patches via
@ 2021-01-13 14:37 ` Ludovic Courtès
2023-01-16 18:10 ` bug#45591: " Maxim Cournoyer
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2021-01-13 14:37 UTC (permalink / raw)
To: guy fleury iteriteka; +Cc: 45591
Hi,
guy fleury iteriteka <gfleury@disroot.org> skribis:
> diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
> index e435bf0..40af012 100644
> --- a/guix/scripts/environment.scm
> +++ b/guix/scripts/environment.scm
> @@ -719,6 +719,10 @@ message if any test fails."
> (mappings (pick-all opts 'file-system-mapping))
> (white-list (pick-all opts 'inherit-regexp)))
>
> + (when (not (member system '("armhf-linux" "aarch64-linux"
> + "i686-linux" "x86_64-linux" "i586-gnu")))
> + (leave (G_ "guix does not support ~A system~%") system))
The system list should not be hardcoded (there’s already such a list in
(guix packages)).
Currently the error one gets is:
$ guix environment -s does-not-exist --ad-hoc coreutils
guix environment: error: could not find bootstrap binary 'tar' for system 'does-not-exist'
I suppose that’s what you intended to improve, right?
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#45591: environment: gracefully handle unsupported system.
2021-01-13 14:37 ` Ludovic Courtès
@ 2023-01-16 18:10 ` Maxim Cournoyer
0 siblings, 0 replies; 3+ messages in thread
From: Maxim Cournoyer @ 2023-01-16 18:10 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 45591-done, guy fleury iteriteka
Hi,
Ludovic Courtès <ludo@gnu.org> writes:
> Hi,
>
> guy fleury iteriteka <gfleury@disroot.org> skribis:
>
>> diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
>> index e435bf0..40af012 100644
>> --- a/guix/scripts/environment.scm
>> +++ b/guix/scripts/environment.scm
>> @@ -719,6 +719,10 @@ message if any test fails."
>> (mappings (pick-all opts 'file-system-mapping))
>> (white-list (pick-all opts 'inherit-regexp)))
>>
>> + (when (not (member system '("armhf-linux" "aarch64-linux"
>> + "i686-linux" "x86_64-linux" "i586-gnu")))
>> + (leave (G_ "guix does not support ~A system~%") system))
>
> The system list should not be hardcoded (there’s already such a list in
> (guix packages)).
>
> Currently the error one gets is:
>
> $ guix environment -s does-not-exist --ad-hoc coreutils
> guix environment: error: could not find bootstrap binary 'tar' for system 'does-not-exist'
>
> I suppose that’s what you intended to improve, right?
Thanks to the recent work of Mathieu, we now get:
guix environment: error: 'does-not-exist' is not a supported system
hint: Try `--list-systems' to view available system types.
Closing.
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-16 18:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01 10:53 [bug#45591] environment: gracefully handle unsupported system guy fleury iteriteka via Guix-patches via
2021-01-13 14:37 ` Ludovic Courtès
2023-01-16 18:10 ` bug#45591: " Maxim Cournoyer
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).