Subject: bug#45591: closed (Re: bug#45591: environment: gracefully handle unsupported system.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 16 Jan 2023 18:11:02 +0000

Your bug report

#45591: environment: gracefully handle unsupported system.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
45591: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45591
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#45591: environment: gracefully handle unsupported system.
From: Maxim Cournoyer <[email-masked]>
To: Ludovic Courtès <[email-masked]>
Cc: [email-masked], guy fleury iteriteka <[email-masked]>
Date: Mon, 16 Jan 2023 13:10:24 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Ludovic Courtès <[email-masked]> writes:

> Hi,
>
> guy fleury iteriteka <[email-masked]> 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

Subject: environment: gracefully handle unsupported system.
From: guy fleury iteriteka <[email-masked]>
To: [email-masked]
Date: Fri, 01 Jan 2021 12:53:08 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

hi guix,

if this patch looks good, feel free to change message diagnostic.

>From d9b4727885744abda8afc179182a2cc975122487 Mon Sep 17 00:00:00 2001
From: guy fleury iteriteka <[email-masked]>
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