Subject: bug#62917: closed (Re: [bug#62917] [bug#73799] [PATCH] Fix 'guix shell: error: symlink: File exists: "/bin/cc"')

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 15 Dec 2024 06:05:02 +0000

Your bug report

#62917: ‘guix shell -CH’ should be able to contain both GCC and Clang

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

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

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

Subject: Re: [bug#62917] [bug#73799] [PATCH] Fix 'guix shell: error: symlink: File exists: "/bin/cc"'
From: John Kehayias <[email-masked]>
To: [email-masked]
Cc: Ludovic Courtès <[email-masked]>, Marco Fortina <[email-masked]>, Maxim Cournoyer <[email-masked]>
Date: Sun, 15 Dec 2024 06:04:15 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

On Sun, Dec 15, 2024 at 01:36 PM, Maxim Cournoyer wrote:

> Hi Marco,
>
> Marco Fortina <[email-masked]> writes:
>
>> This patch closes issue when running "guix shell --container --emulate-fhs clang-toolchain gcc-toolchain" or "guix shell --container --emulate-fhs clang-toolchain gcc-toolchain":
>>
>>
>> diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
>> index a219b2ac89..37f11395f9 100644
>> --- a/guix/scripts/environment.scm
>> +++ b/guix/scripts/environment.scm
>> @@ -464,7 +464,8 @@ (define (setup-fhs profile)
>>    ;; /bin since that already has the sh symlink and the other (optional) FHS
>>    ;; bin directories will link to /bin.
>>    (let ((gcc-path (string-append profile "/bin/gcc")))
>> -    (if (file-exists? gcc-path)
>> +    (if (and (file-exists? gcc-path)
>> +             (not (file-exists? "/bin/cc")))
>>          (symlink gcc-path "/bin/cc")))
>>
>>    ;; Guix's ldconfig doesn't search in FHS default locations, so provide a
>
> I see Ludovic pushed a variant of the above fix with
> 23ab6fc29f28b0fa9ad94bf2ceed135ee3fdea34, and attributed your discovery
> of the problem.
>
> Good.  Thanks for the report and patch!

Thanks for the followup, closing this.

John

Subject: ‘guix shell -CH’ should be able to contain both GCC and Clang
From: zamfofex <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Mon, 17 Apr 2023 21:14:15 -0300 (BRT)
List-Id: <debbugs-submit.debbugs.gnu.org>

When I add ‘gcc-toolchain’, it seems to try to create a ‘/bin/cc’ symlink to GCC, but the Clang package also has a ‘cc’ executable, so it fails.

- - - - - - - - -
% guix shell -CF clang-toolchain gcc-toolchain
guix shell: error: symlink: File exists: "/bin/cc"
- - - - - - - - -