all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* guix shell: error: symlink: File exists: "/bin/cc"
@ 2024-10-13 16:45 Marco Fortina
  2024-10-13 23:11 ` bug#73799: " Marco Fortina
  2024-10-23 20:26 ` Ludovic Courtès
  0 siblings, 2 replies; 8+ messages in thread
From: Marco Fortina @ 2024-10-13 16:45 UTC (permalink / raw)
  To: guix-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1931 bytes --]

Hello there.

I have this issue when with guix time-machine shell when using --emulate-fhs option and having gcc-toolset and clang-toolset in my manifest.scm.

I this this could be solved with this patch:

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 9f851a478e..7a276569e9 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -512,8 +512,10 @@ (define-public (make-clang-toolchain clang libomp)
                      ;; Create 'cc' and 'c++' so that one can use it as a
                      ;; drop-in replacement for the default tool chain and
                      ;; have configure scripts find the compiler.
-                     (symlink "clang" (string-append out "/bin/cc"))
-                     (symlink "clang++" (string-append out "/bin/c++"))
+                     (unless (file-exists? "/bin/cc")
+                         (symlink "clang" (string-append out "/bin/cc")))
+                     (unless (file-exists? "/bin/c++")
+                         (symlink "clang++" (string-append out "/bin/c++")))

                      (union-build (assoc-ref %outputs "debug")
                                   (list (assoc-ref %build-inputs
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index a219b2ac89..72e56367a8 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -465,7 +465,8 @@ (define* (link-contents dir #:key (exclude '()))
   ;; bin directories will link to /bin.
   (let ((gcc-path (string-append profile "/bin/gcc")))
     (if (file-exists? gcc-path)
-        (symlink gcc-path "/bin/cc")))
+        (unless (file-exists? "/bin/cc")
+            (symlink gcc-path "/bin/cc"))))

   ;; Guix's ldconfig doesn't search in FHS default locations, so provide a
   ;; minimal ld.so.conf.


This patch will create the symlinks only if destination files is not already present.

Thanks

[-- Attachment #2: Type: text/html, Size: 7271 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-10-26 14:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-13 16:45 guix shell: error: symlink: File exists: "/bin/cc" Marco Fortina
2024-10-13 23:11 ` bug#73799: " Marco Fortina
2024-10-14 19:13   ` Rutherther via Bug reports for GNU Guix
2024-10-23 20:26 ` Ludovic Courtès
2024-10-23 20:26   ` Rutherther
2024-10-24  8:02   ` R: " Marco Fortina
2024-10-24 13:28     ` Greg Hogan
2024-10-26 14:20     ` R: " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.