From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id IKPJLFD/GWdAcAAAe85BDQ:P1 (envelope-from ) for ; Thu, 24 Oct 2024 08:03:28 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id IKPJLFD/GWdAcAAAe85BDQ (envelope-from ) for ; Thu, 24 Oct 2024 10:03:28 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=HOTMAIL.IT header.s=selector1 header.b=SDte9naW; dmarc=pass (policy=none) header.from=hotmail.it; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=2; s=key1; d=yhetil.org; t=1729757007; a=rsa-sha256; cv=pass; b=boXdXb7/9S5CUg4ol8+3aZ6h8uNB1nf8rC8KB88zgrXvAzKPYtdU1Ij9wGgS1FVpLbn7Or 6OqeQmDYrG2uw7m+d06AlAnySj+4k55yKQgNNgDuHC/Hb92TU+KQma0IrUDeYCkZCs9wOP RsXGpb59PRTxk6vYqRsnU0Gay+whf1tITJIm1vmVchbUayoUprUtEebwd1eqsU2V9glwsw IlWTIofk6b9fb7IYTnnfiDW2bnnDNzt5t+Ro5nbKC9MMwNPtHgLmIEIwFw8EywyBfq44gJ z2VAtLgctkbhk+luDKhaBcEMh1Ga9ZRF5kyBkYg3k67hGGni17S2MRRseRTeyQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=HOTMAIL.IT header.s=selector1 header.b=SDte9naW; dmarc=pass (policy=none) header.from=hotmail.it; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729757007; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=H3wiaXuMp7QrfDROLYWSjNXoYrewrVTGoMurm5Tv6B4=; b=jEjsiX45CTiY9Qo7CmOtVQsctkWZ5mWtUiDp32nBnIPpci3twCw0M1nMCFg+CvvChLOfdx HE+S61H8aCtsv7fwpvYPNqfl5UMc2X2m+gmsFbJWRefH2ZZl/QASPAXe5ghYlpm9P3tOm7 G/s4T9fNuz3KNfm1l0YntT+T7iyW+fBgtdAZz9u1E979iOsnTUk4rBaghi/1z7PuW1G3gS +KG8cogyIfsXPX1/cSCpA/Gq1YNskUwr29IBE81xHQqSTnZRBD3D34gOOtM9dc9qDdq/YT 6i+FBuBOAK3ocUl7zMI7wp7nfXq2lKnvS7gDdCbCHVqXR6eHMFWNLHPyQ0ZEOA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 43C761A8E0 for ; Thu, 24 Oct 2024 10:03:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3so1-0000fj-02; Thu, 24 Oct 2024 04:02:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3snx-0000fU-Qs for guix-devel@gnu.org; Thu, 24 Oct 2024 04:02:50 -0400 Received: from mail-db8eur05olkn2065.outbound.protection.outlook.com ([40.92.89.65] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3snv-0005hC-9g; Thu, 24 Oct 2024 04:02:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EF/mJEkPpW+rEMw0wWJuUNUhC1Ec6xE2qsTAncrAQc+CnXDmmnTkpkAokbfhFfxvAtpO3SLWjQFATz3o5em1JM0RErzQfXyzDhaUBMhwTENvIxN7LfU6ACTpmW+5pgNVMjviTb7QYDuYJ0wK+onZd6XJqbYwVSUC8KB00+TDsTaMl8kPAhnDh1je/ck4jkPYFOYem7HsfsbfTUxZZrOuX5nc24klFP1ovv8i7bQYnmDNVV1qv+UD8iZB2YFO7QVMo7eL3Jy5HNVyOEFJgyhsUVNX+K1h0hxIaox7IPwTmSDEfgt3TKfRHZsTtVFiVDaFhA5EIP2My3rZ/W/PuEzsLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H3wiaXuMp7QrfDROLYWSjNXoYrewrVTGoMurm5Tv6B4=; b=WCwLNnt5Mr1JIZJTsSDWCoxJiKdsiJe5+2uPZWKvcdn8S72VF1IRPTMilbIeRKePABcBzE9fKF/siN8gK3w3L02N18xhAueNVTCJ0sYn4Xp07Z2oSYvdcW2Hw36BMOaTdRCff/WwnkGnt0TerVy61kbJNvsekw9UqnOYnWPkjF8kDfytFAqUdJIi6d4VyIV+pkL543a1Ac5x4JnYo4ygEW2clySpsljpx/4zHUqbHgr9yTHiC0ioJn6oNU42bHjDkP2CGg6AaAaheU18V9cGuTx7oNoLu4s1tEVBV5xTwk4oZ8S/vIiRMUq2M8LMVIwHnj9POABgVzKikxCbX+5Zhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=HOTMAIL.IT; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H3wiaXuMp7QrfDROLYWSjNXoYrewrVTGoMurm5Tv6B4=; b=SDte9naWSUY+dUHUFVgP6Yo9Vzri7sUwUFEnVJJeO70KbKqqcgJssyJhGlgeXQOvFUyolJ1+AM/Gzsytq88r2G2/0q4rGEJCq0lk9vOwwLjSPToeZOTH8NjZoN+qKEsZyyvuAYuj8DvJKOmJk44rcRnIbSkxC2kaC0EGrESYnGLZo8TOJxfRLRNMUedo4KQneHZjnzpp2PwetdlBuVI4/FI+iRODLu7iTkgKOXxoPS8+w8xux9CKuyxytkble/G+z9vdPuClc0dialnIxB6pPnjgYbfTyhtk9oJl9VlS9xgsMwN6/Y18/of9ISq/1rL0zEZSsN7i+mnIsVbXY5Hg6A== Received: from AS8PR10MB5829.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:525::9) by VE1PR10MB3920.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:800:16b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17; Thu, 24 Oct 2024 08:02:43 +0000 Received: from AS8PR10MB5829.EURPRD10.PROD.OUTLOOK.COM ([fe80::a705:2fe4:69df:1e30]) by AS8PR10MB5829.EURPRD10.PROD.OUTLOOK.COM ([fe80::a705:2fe4:69df:1e30%6]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 08:02:43 +0000 From: Marco Fortina To: =?Windows-1252?Q?Ludovic_Court=E8s?= CC: "guix-devel@gnu.org" Subject: R: guix shell: error: symlink: File exists: "/bin/cc" Thread-Topic: guix shell: error: symlink: File exists: "/bin/cc" Thread-Index: AQHbHY7H10GreJbuuUWP3NEze+AQFLKU2IiGgADALpQ= Date: Thu, 24 Oct 2024 08:02:43 +0000 Message-ID: References: <875xpi4lcr.fsf@gnu.org> In-Reply-To: <875xpi4lcr.fsf@gnu.org> Accept-Language: it-IT, en-US Content-Language: it-IT X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AS8PR10MB5829:EE_|VE1PR10MB3920:EE_ x-ms-office365-filtering-correlation-id: f0f20ecd-1ea9-4ee5-36ba-08dcf4023d54 x-microsoft-antispam: BCL:0; ARA:14566002|19110799003|8062599003|461199028|8060799006|15030799003|7092599003|15080799006|102099032|3412199025|440099028; x-microsoft-antispam-message-info: oWCUzc9xN8wAo7x/7R6hhfbToXiLymSbaRQPO7U8M+5GmVlzZgOgpHR47fNL3iLKfH7unhGOK4oFg1fvZTtHXJgvkFcysM58slRE1DnYRIYWylz6+SWkZbB+tzfmRy6RvsXGnOkWVt1cOTP9j1tonBaDIRMkMaNShRczq8uGDjnc462Bws0Sg6FJjlwIQ67o+sW/KbgQAtV0poa0M8g8jaD+rw6J/ZjQm3d2Y1I+SlEp8nPy+7hGmnlxR2OWthyAymKNHyTLgp8aaBW0oRLFacqBl7/GXcawslst9jYSYTG8E6nppYMGRpbeu61GCq3OaYfVO2ANVbC+5MegjUJem6eQCCD3e+GGlCRralneoBGMhHvLlRccwf8Bk/W1J0mCKNEfbo5/kDqe1ouWBUEXBOFiDvcOrEiwqHtrb2b9Zzek5wu0zdXMJwj3mb65GljbOMdn+rU+CIodxNHfLHITqAZZBRoYto2iFWSjrNgJku3unf1vDgcrRF07v+58J8TkvyZ1ollPNFE6Pu1+NVKEQ8U4aBoBOmCyromyH5s3/kl3/1xOJM7zhd0slF8mjOGGvxfXHNml/ju/y22iNmm59XopkaBzA8CukLNpAHdDQTCzHD6dxkUVSZFFxGBfzvSP6aVMx9BKdF8Xh6DAwySleBu0uY5SehGd1OHmU0E8b6MsCeD/nX/4gcNCj67po4INK5t8KbR0PNoqfmO/NJQBYu0u6yCgq/QnKZIo0w4R8eaAN2hCH5Zeeg8UzM/CZa1rpupYpSTqFJHOMPAtc8xWuQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?6AdYD5EKduQQ0wj0UcM471A467w4845HGcx2pCk5BLSRcH9aFIy1XfKZ?= =?Windows-1252?Q?jzq/W1100m8PZVfkEwW/q9k/ur1vWOG5sy3w3mSQ3PfCiX4wD5B/NziT?= =?Windows-1252?Q?DJm3x7n15Fai/FUFrs8nQOgnMiVz21mXHoGVMEiQGJ1BwKsFiam1iC1u?= =?Windows-1252?Q?nwijfsK6EzK9VD5yul3BCUGeRnHQgntuDGNA2wTaNZxTM888+FydljZu?= =?Windows-1252?Q?4oGp77gQU9iwZnT13roHLKTylfijuCxuDSEMDqoCNqSgiQKXgUA94vT3?= =?Windows-1252?Q?hXOA4nh8iN4yDXDl/sY/iRLKTlEP0Ii0/nFcM40YkN6GepV35Vnbm3dI?= =?Windows-1252?Q?1BIHcDo0IN7M9wwF7T2AdRRtaNWdl+6ZoFs43d03WHZxMZqrFGRZJz/+?= =?Windows-1252?Q?/+xExNYGtkzWIHVCwAQH4iTVsIXthlnbu++sk2vslPzs/xIsK9z4JfYs?= =?Windows-1252?Q?46tRmhQlBVT9c9y34nWRTg3v20M3QWfqYf5csOy39qwGrzZUAT/5IK1W?= =?Windows-1252?Q?m0hsdIxA4WkTCQMUNNti2TppsRmGWH5M1uhIMN03YJyBsy1L+DnVUYgd?= =?Windows-1252?Q?rBmEdVVlms9rqwE8bBI55gUHVa+uX0le/LXg2Mrs8gDei1EhUaM5FXcU?= =?Windows-1252?Q?U19k3ZnOJVvMYXIfuq2c0b6pMxHhaa4Ml5OC7ZClUsnqP0RJtoFjw/h/?= =?Windows-1252?Q?8gRyB58tJGr//nsuu9aTzUfel7g5ZlCvu3m/CiCK4rsQf//6s4J1rlUh?= =?Windows-1252?Q?JMs9HWWPnt4XCfrwVorPW2GXdSwqAMKOME12RC0Iue7gNmsbjhpef47k?= =?Windows-1252?Q?3xFn3MzXHpuZCjjQyKlwUdDBqVmbEQpVE5VaBLvXRaiSOgcgJNBxYKNF?= =?Windows-1252?Q?my/3hyAXzNq4vCya11wEmwRGIzc7c+ZwowrZKGdE2MVK9BEdugh+PEqL?= =?Windows-1252?Q?z3tu3tyosawwQA8eTUVjdvI23uIFJUrQFzBo6nXCkq8lGSDZuZJJ2OhH?= =?Windows-1252?Q?MlLZbq6OpIVpPIvVzlIke30vDzoFJoai/ZYeFSjAm5i+2WSi/jb6s2nM?= =?Windows-1252?Q?i+XzpEKARdgcz9iHbUUbrdOg1WIgXhn+oidtLijb69BaaLVZo7GCIKG4?= =?Windows-1252?Q?3R2y2Al/YS69T60in8eBP2o2pmBsxq1nPZVvHBxDtTVXNyFb8Fp4ulTO?= =?Windows-1252?Q?jlFI5aHSXiuBUPjrc27wwByDfRPVxlbWoNgUwXB7QKpXzs6r/BfIyHap?= =?Windows-1252?Q?sn7KWGltcsS3mzCsGfAWqltx04feNDhXqlZpDWN6dNJtpHx/UnpnJQy8?= =?Windows-1252?Q?DhjslpJfIBl69BWUpMebHhMLt5c=3D?= Content-Type: multipart/alternative; boundary="_000_AS8PR10MB582917483C43AC0CB59FE23DF74E2AS8PR10MB5829EURP_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6b909.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8PR10MB5829.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: f0f20ecd-1ea9-4ee5-36ba-08dcf4023d54 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Oct 2024 08:02:43.5629 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR10MB3920 Received-SPF: pass client-ip=40.92.89.65; envelope-from=marco_fortina@hotmail.it; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-1.697, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.74 X-Spam-Score: -5.74 X-Migadu-Queue-Id: 43C761A8E0 X-Migadu-Scanner: mx10.migadu.com X-TUID: hdFMWU/xF5RB --_000_AS8PR10MB582917483C43AC0CB59FE23DF74E2AS8PR10MB5829EURP_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hello! Yes, only changes in the environment.scm files are required for fixing the = issue. Why did you make the patch so complex? > --- a/guix/scripts/environment.scm > +++ b/guix/scripts/environment.scm > @@ -464,8 +464,15 @@ (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) > - (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 anothe= r > + ;; package in PROFILE, such as 'clang-toolchain', leave it. > + (unless (=3D 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. was not enough ? 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) F= HS ;; 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 ________________________________ Da: Ludovic Court=E8s Inviato: mercoled=EC 23 ottobre 2024 22:26 A: Marco Fortina Cc: guix-devel@gnu.org Oggetto: Re: guix shell: error: symlink: File exists: "/bin/cc" Hi, Marco Fortina skribis: > 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 tried, and for those reading along, the problem is: --8<---------------cut here---------------start------------->8--- $ guix shell -CF gcc-toolchain clang-toolchain guix shell: error: symlink: File exists: "/bin/cc" --8<---------------cut here---------------end--------------->8--- > --- 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 a= nd > ;; 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++= "))) This part has no effect (there=92s no /bin/cc in the build environment.) > +++ 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")))) Good catch! I=92m proposing a slightly modified variant of this change: --_000_AS8PR10MB582917483C43AC0CB59FE23DF74E2AS8PR10MB5829EURP_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Hello!

Yes, only changes in the environment.scm files are required for fixing the = issue.

Why did you make the patch so complex?

> --- a/guix/scripts/environment.scm
> +++ b/guix/scripts/environment.scm
> @@ -464,8 +464,15 @@ (define (setup-fhs profile)
>    ;; /bin since that already has the sh symlink and the oth= er (optional) FHS
>    ;; bin directories will link to /bin.
>    (let ((gcc-path (string-append profile "/bin/gcc&quo= t;)))
> -    (if (file-exists? gcc-path)
> -        (symlink gcc-path "/bin/cc")))<= br> > +    (when (file-exists? gcc-path)
> +      (catch 'system-error
> +        (lambda ()
> +          (symlink gcc-path "/bin/= cc"))
> +        (lambda args
> +          ;; If /bin/cc already exists becau= se it was provided by another
> +          ;; package in PROFILE, such as 'cl= ang-toolchain', leave it.
> +          (unless (=3D EEXIST (system-error-= errno args))
> +            (apply throw args))))))
>  
>    ;; Guix's ldconfig doesn't search in FHS default location= s, so provide a
>    ;; minimal ld.so.conf.


was not enough ?

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 (o= ptional) 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/c= c")))
         (symlink gcc-path "/bin/cc")))<= /div>
 
   ;; Guix's ldconfig doesn't search in FHS default locations, so= provide a



Da: Ludovic = Court=E8s <ludo@gnu.org>
Inviato: mercoled=EC 23 ottobre 2024 22:26
A: Marco Fortina <marco_fortina@hotmail.it>
Cc: guix-devel@gnu.org <guix-devel@gnu.org>
Oggetto: Re: guix shell: error: symlink: File exists: "/bi= n/cc"
 
Hi,

Marco Fortina <marco_fortina@hotmail.it> skribis:

> I have this issue when with guix time-machine shell when using --emula= te-fhs option and having gcc-toolset and clang-toolset in my manifest.scm.<= br>
I tried, and for those reading along, the problem is:

--8<---------------cut here---------------start------------->8---
$ guix shell -CF gcc-toolchain clang-toolchain
guix shell: error: symlink: File exists: "/bin/cc"
--8<---------------cut here---------------end--------------->8---

> --- 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 re= placement for the default tool chain and
>            = ;           ;; have confi= gure scripts find the compiler.
> -           &nb= sp;         (symlink "clang&qu= ot; (string-append out "/bin/cc"))
> -           &nb= sp;         (symlink "clang++&= quot; (string-append out "/bin/c++"))
> +           &nb= sp;         (unless (file-exists? &= quot;/bin/cc")
> +           &nb= sp;            = (symlink "clang" (string-append out "/bin/cc")))
> +           &nb= sp;         (unless (file-exists? &= quot;/bin/c++")
> +           &nb= sp;            = (symlink "clang++" (string-append out "/bin/c++")))
This part has no effect (there=92s no /bin/cc in the build environment.)
> +++ 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/gc= c")))
>      (if (file-exists? gcc-path)
> -        (symlink gcc-path "/b= in/cc")))
> +        (unless (file-exists? &quo= t;/bin/cc")
> +            (s= ymlink gcc-path "/bin/cc"))))

Good catch!  I=92m proposing a slightly modified variant of this chang= e:

--_000_AS8PR10MB582917483C43AC0CB59FE23DF74E2AS8PR10MB5829EURP_--