guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#64929] [PATCH] gnu: gcc-toolchain: Create a 'bin/cc' symlink.


From: Maxime Devos
Subject: [bug#64929] [PATCH] gnu: gcc-toolchain: Create a 'bin/cc' symlink.
Date: Mon, 21 Aug 2023 17:08:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Op 21-08-2023 om 16:30 schreef Attila Lendvai:
ok, i see why this won't work.

CC=(cc-for-target) is fine for packages, but the use-case that i'd like to 
facilitate is `guix shell gcc-toolchain some-other-deps` and then build a 
project manually from the opened shell.

any ideas how to help/handle that use-case without disrupting cross-compilation 
for packages?


IIUC, gcc-toolchain isn't used for "guix build" (I'm not really sure though), so if that's your use case, your current patch would work without problems w.r.t. cross-compilation. Rhetorical question: why didn't I think of this when writing my previous message?

However, (assuming my assumption about gcc-toolchain is correct), applying the patch would create a discrepancy between the build environment from "guix build/guix shell -D ..." and "guix shell gcc-toolchain more-deps", which isn't nice and is potentially confusing.

I was going to suggest that the solution would be to modify your script to look for TARGET-cc when cross-compiling, but while that would be an improvement it wouldn't solve anything as Guix doesn't have TARGET-cc.

For an alternate proposal (which I think has been proposed before, but I don't recall where), it might be possible to create 'symlink' packages "symlink-cc-gcc" and "symlink-cc-clang", that respectively have the cc->gcc and cc->clang symlink (also cc->clang should be removed from the clang package, otherwise there is a collision and a preference for clang).

(I'm thinking of Debian's alternative system, but simplified (no priorities!) and based on packages.)

For --with-c-toolchain (*) (**) and the cross-compilation issue I mentioned, these should be forbidden for use in Guix packages (as in, "guix lint" doesn't like it/not accepted in Guix proper, if some other channel does it anyway, it's not recommended, but also not really any of Guix' concern).

(*) I don't know if clang and cross-compilation is supported yet by --with-c-toolchain. (**) though with-c-toolchain isn't truly a concern, as it could simply adjust the symlink inputs ...

(I have the impression that I previously was against such symlink packages, but I don't recall actually writing a message about it.)

Best regards,
Maxime Devos.

Attachment: OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]