diff options
author | Ludovic Courtès <ludo@gnu.org> | 2024-10-23 22:26:34 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-10-24 14:50:08 +0200 |
commit | 23ab6fc29f28b0fa9ad94bf2ceed135ee3fdea34 (patch) | |
tree | 4828d7ecb2a0d70cae4391e9ceea92be8d0531de | |
parent | 573a07b689fedcf3f36fa46a4625153fda273344 (diff) | |
download | guix-23ab6fc29f28b0fa9ad94bf2ceed135ee3fdea34.tar.gz guix-23ab6fc29f28b0fa9ad94bf2ceed135ee3fdea34.zip |
environment: Gracefully handle preexistence of /bin/cc in FHS.
* guix/scripts/environment.scm (setup-fhs): When /bin/cc already exists,
keep it.
Reported-by: Marco Fortina <marco_fortina@hotmail.it>
Change-Id: I73d39d2aa6fbafd236061a0e3b8d1fe327b2bb19
-rw-r--r-- | guix/scripts/environment.scm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index a219b2ac89..fc7fa84be7 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -464,8 +464,15 @@ providing a symlink for CC if GCC is in the container PROFILE, and writing ;; /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) - (symlink gcc-path "/bin/cc"))) + (when (file-exists? gcc-path) + (catch 'system-error + (lambda () + (symlink gcc-path "/bin/cc")) + (lambda args + ;; If /bin/cc already exists because it was provided by another + ;; package in PROFILE, such as 'clang-toolchain', leave it. + (unless (= EEXIST (system-error-errno args)) + (apply throw args)))))) ;; Guix's ldconfig doesn't search in FHS default locations, so provide a ;; minimal ld.so.conf. |