gcc-toolchain does not provide cc in PATH #556

Closed
opened 2025-06-13 14:35:29 +02:00 by hebasto · 3 comments
Contributor

guix describe output:

Generation 4	Jun 02 2025 11:21:02	(current)
  guix e7ddeac
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: e7ddeacc0c122564990f3a5ff6b45e3fc7dd1106

The gcc-toolchain package does not provide cc in PATH, as might be expected:

$ guix shell --pure --container gcc-toolchain
[env]$ cc --version
sh: cc: command not found
[env]$ c++ --version
c++ (GCC) 15.1.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

`guix describe` output: ```text Generation 4 Jun 02 2025 11:21:02 (current) guix e7ddeac repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: e7ddeacc0c122564990f3a5ff6b45e3fc7dd1106 ``` The `gcc-toolchain` package does not provide `cc` in `PATH`, as might be expected: ``` $ guix shell --pure --container gcc-toolchain [env]$ cc --version sh: cc: command not found [env]$ c++ --version c++ (GCC) 15.1.0 Copyright (C) 2025 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ```
Contributor

I'm sorry if my response is not very helpful. I've came across this issue as well while learning about GUIX, in my notes I saved this link from a report made 8 years ago:

https://issues.guix.gnu.org/28629

However, if using guix shell I think you can add this to the top of your manifest.scm files in case you are working with projects of your own:

(setenv "cc" (getenv "gcc")) ;; adapt to your needs

I found placing this before any module/use-module definitions is enough for LD_LIBRARY_PATH issues that arise with other programs out there.

If you don't like that approach I would suggest looking the SRFI-98 section in the Guile Scheme manual if you want a "cleaner" approach. Happy hacking!

I'm sorry if my response is not very helpful. I've came across this issue as well while learning about GUIX, in my notes I saved this link from a report made 8 years ago: https://issues.guix.gnu.org/28629 However, if using `guix shell` I think you can add this to the top of your `manifest.scm` files in case you are working with projects of your own: ```scheme (setenv "cc" (getenv "gcc")) ;; adapt to your needs ``` I found placing this before any module/use-module definitions is enough for `LD_LIBRARY_PATH` issues that arise with other programs out there. If you don't like that approach I would suggest looking the [SRFI-98](https://www.gnu.org/software/guile/manual/html_node/SRFI_002d98.html) section in the Guile Scheme manual if you want a "cleaner" approach. Happy hacking!
Contributor

This is intended behaviour. see also

(BTW, I hope @mhw can provide a link to the discussion about not adding cc symlink for gcc-toolchain

This is intended behaviour. see also - https://issues.guix.gnu.org/64929 - https://issues.guix.gnu.org/28629 (BTW, I hope @mhw can provide a link to the discussion about not adding `cc` symlink for `gcc-toolchain`
Member
Here are some of the early discussions on this topic that I found: - https://issues.guix.gnu.org/21214 - https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00188.html - https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00225.html - https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00227.html
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
guix/guix#556
No description provided.