From unknown Sat Sep 06 09:45:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60200: Incompatibilities between gcc-toolchain and R packages Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 19 Dec 2022 12:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60200 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 60200@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167145122919994 (code B ref -1); Mon, 19 Dec 2022 12:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Dec 2022 12:00:29 +0000 Received: from localhost ([127.0.0.1]:38338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Eom-0005CQ-FL for submit@debbugs.gnu.org; Mon, 19 Dec 2022 07:00:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:45904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Eok-0005CK-Id for submit@debbugs.gnu.org; Mon, 19 Dec 2022 07:00:27 -0500 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 1p7Eoi-0002B0-Bx for bug-guix@gnu.org; Mon, 19 Dec 2022 07:00:26 -0500 Received: from mout-p-102.mailbox.org ([80.241.56.152]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1p7Eof-0001DM-Gr for bug-guix@gnu.org; Mon, 19 Dec 2022 07:00:23 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4NbJDN1tJ2z9sqw for ; Mon, 19 Dec 2022 13:00:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1671451204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=Cw7Ngt0BeLW1uCi/DST1K8dgA7JHcIN5i8JGlBSOav4=; b=1OdVOr+aMp3qRceYJgbEsOTuwLo+Rq7N83SRlY0WnIlAyJhQ517D9vHMNmj8NKE7xHTOjQ F91LMpVJhswp5s7ak6zlh+mzum/dMEHROCdRos0hwt9F5dLhf1EofevpBdBh+WcDcSOrBO 9fLjmvAXrgtgiVcBFec90W1GAhEB4Z936xbgfJMSIpK3yY1y/Pb/ia/BF2UwKu72McpXjd o7uHnRcz5UFZYDWbZRR1eYYgAeKDLTYEXdI3zi8ZNnDhJaVLR4h1wgiMuHSdfSEBW+OapJ F8SG8EuhaNB4aJNJlIz1Qkn2+FsVSZ1yM4cXRX0N6ZuHqSrwt2z/QZSA3txbLg== Date: Mon, 19 Dec 2022 13:00:02 +0100 From: Lars-Dominik Braun Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 4NbJDN1tJ2z9sqw Received-SPF: pass client-ip=80.241.56.152; envelope-from=lars@6xq.net; helo=mout-p-102.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Hi, I ran into issues with the package r-brms. Take the following reproducer as an example: $ guix shell r-brms r make sed gcc-toolchain bash -C --no-cwd --share=/tmp $ R > library(brms) > fit1 <- brm(count ~ zAge + zBase * Trt + (1|patient), data = epilepsy, family = poisson()) Compiling Stan program... Error in dyn.load(libLFile) : unable to load shared object '/tmp/RtmpKqzbYg/file3245e787c.so': /gnu/store/vqhamsanmlm8v6f90a635zc6gmhwlphp-gfortran-10.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /tmp/RtmpKqzbYg/file3245e787c.so) Error in sink(type = "output") : invalid connection The same code works well with gcc-toolchain@10 instead of gcc-toolchain (@12, which is the default). As we can see the generated shared library above depends on GCC 12, 10 and GFortran 10 at the same time: $ ldd /tmp/RtmpKqzbYg/file3245e787c.so | grep -e gcc -e fortran libstdc++.so.6 => /gnu/store/4zvswpr2h3b7dvqpvjcdam8vfhyjrmgl-gcc-12.2.0-lib/lib/libstdc++.so.6 (0x00007f69bd9fc000) libgcc_s.so.1 => /gnu/store/4zvswpr2h3b7dvqpvjcdam8vfhyjrmgl-gcc-12.2.0-lib/lib/libgcc_s.so.1 (0x00007f69bd898000) libgfortran.so.5 => /gnu/store/vqhamsanmlm8v6f90a635zc6gmhwlphp-gfortran-10.3.0-lib/lib/libgfortran.so.5 (0x00007f69bd3e6000) libquadmath.so.0 => /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libquadmath.so.0 (0x00007f69bd39b000) libgomp.so.1 => /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgomp.so.1 (0x00007f69bccf9000) The command used to link that .so is revealed by strace to be (filenames are random and may differ between runs): ["g++", "-std=gnu++14", "-shared", "-L/gnu/store/145dmr8drw3yzrdhzbsksi05p599hrs6-r-minimal-4.2.2/lib/R/lib", "-L/usr/local/lib", "-o", "file3373276d0.so", "file3373276d0.o", "/gnu/store/5rdg6sv1nrg1ikqxcykvdh9g4yd2xjvy-r-rstan-2.21.7/site-library/rstan/lib//libStanServices.a", "-L/gnu/store/y7rvp47mz3hcnpvnqsx42qz5yvs10pnl-r-stanheaders-2.21.0-7/site-library/StanHeaders/lib/", "-lStanHeaders", "-L/gnu/store/01lhjrrkvrnsjd8xh4ssdn3bgxc422jl-r-rcppparallel-5.1.5/site-library/RcppParallel/lib/", "-ltbb", "-L/gnu/store/145dmr8drw3yzrdhzbsksi05p599hrs6-r-minimal-4.2.2/lib/R/lib", "-lR"] So it links against libStanServices.a, libStanHeaders(.a), libtbb(.so) and libR(.so) of which only libR has a reference to gfortran: $ ldd /gnu/store/145dmr8drw3yzrdhzbsksi05p599hrs6-r-minimal-4.2.2/lib/R/lib/libR.so | grep -i fortran libgfortran.so.5 => /gnu/store/vqhamsanmlm8v6f90a635zc6gmhwlphp-gfortran-10.3.0-lib/lib/libgfortran.so.5 (0x00007f5be49db000) That means every software linking against R is also incompatible with the current default gcc-toolchain (when using the command line or specifications; different story when writing package recipes). Possible solutions: - Make gcc-toolchain@10 the default and rename gcc-toolchain@12 to gcc-toolchain-next@12, like we do for Haskell and (sometimes) Python. - Update, both, the default GCC and GFortran to version 12. - Explicitly depend on the correct gcc-toolchain in packages that need a compiler. Cheers, Lars From unknown Sat Sep 06 09:45:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60200: Incompatibilities between gcc-toolchain and R packages Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 19 Dec 2022 23:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60200 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Lars-Dominik Braun , 60200@debbugs.gnu.org Received: via spool by 60200-submit@debbugs.gnu.org id=B60200.16714929041762 (code B ref 60200); Mon, 19 Dec 2022 23:36:01 +0000 Received: (at 60200) by debbugs.gnu.org; 19 Dec 2022 23:35:04 +0000 Received: from localhost ([127.0.0.1]:41037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Pex-0000SM-LI for submit@debbugs.gnu.org; Mon, 19 Dec 2022 18:35:04 -0500 Received: from mail-wm1-f42.google.com ([209.85.128.42]:37731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Peu-0000Ru-1T for 60200@debbugs.gnu.org; Mon, 19 Dec 2022 18:35:02 -0500 Received: by mail-wm1-f42.google.com with SMTP id r67-20020a1c4446000000b003d35acb0f9fso590244wma.2 for <60200@debbugs.gnu.org>; Mon, 19 Dec 2022 15:34:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=SdWxe5g7oJNyRaUIbC+W9p2+2DkaJmv92aERKuUSXYI=; b=E6rCe6zB4vKPwU859ZJG4fdiJCuHlA44XvOFou/F7V9IIigYWla6xWf5w7mll3pGkh tYcAieRUeyUCt/zPsRs2P+WNLtkrYGrmiEnrJmuz2LPxrufByVB+SCMeFUn6/lVUOIGE 3fZwt6y9hFnQKmoFyxejF668iUi/z/xMfwzMQB/1rAhgEeJ+EhPHOzkzWIRrgVzFp6tE OrmMbsEtxarlZt2pmL3oKct4ToUehvOqiwKD2cU37w+OEQ5PzdEMtr5VaKnz7QidsAx4 R0M9F8fEgoBj6lNGLjEljTRZP2dowi2CDJhx7hN0HUNKGxcguumZfEiZ0MZVRyZuCSNI Jhow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=SdWxe5g7oJNyRaUIbC+W9p2+2DkaJmv92aERKuUSXYI=; b=uu9XPkGSKKLmacZLELUt9gCJnn1ttHakoF91hWDgbzWW3N7W9l3A59jOE++q+SeK1z b+jj3t7MC+yuO6h5vWoBwc/zgWWbsXr7EGL+wsMem7AvF451JudiIru/3zRf/QzFZvMH ZZo+2bnEboPG2bzAq6Uh8odupajnKUR1C91iDuPXW++fzMLZMCyL+YwTfnPbffYdwtfB bAcrjGKcBqVqhz6q7PMFVYusQkFYlMftDXuZh0jyWM7pKtQ0eRQUdlynqdwobtP73pkP 9Mwk0mVZV8VVYHlBw4gd06jbb/Vl9maxAlBiaEbnG3BUQ6P3MvkdMMdmlQcaMRe2+WXK yAcw== X-Gm-Message-State: ANoB5pm05h9lJ8Lok/pfD+CTDTL3tukkXLcyE1uW0Wkn2W0Pnub2Zh18 WTVHbhh/ueCjcELsqdjxLrVimAkzRK0= X-Google-Smtp-Source: AA0mqf5YO39Bwy0apw7R3BVxc1teq94ijQp/+St84CL6C+z2DHDIlBcplgvBvMzCslvP+RdGd/9DXw== X-Received: by 2002:a05:600c:540c:b0:3cf:e850:4444 with SMTP id he12-20020a05600c540c00b003cfe8504444mr8017000wmb.1.1671492894056; Mon, 19 Dec 2022 15:34:54 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id x33-20020a05600c18a100b003d1cc0464a2sm13200949wmp.8.2022.12.19.15.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 15:34:53 -0800 (PST) From: zimoun In-Reply-To: References: Date: Tue, 20 Dec 2022 00:32:26 +0100 Message-ID: <86wn6nynp1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Lars, On Mon, 19 Dec 2022 at 13:00, Lars-Dominik Braun wrote: > $ guix shell r-brms r make sed gcc-toolchain bash -C --no-cwd --share= =3D/tmp > $ R > > library(brms) > > fit1 <- brm(count ~ zAge + zBase * Trt + (1|patient), data =3D epileps= y, family =3D poisson()) > Compiling Stan program... > Error in dyn.load(libLFile) : > unable to load shared object '/tmp/RtmpKqzbYg/file3245e787c.so': > /gnu/store/vqhamsanmlm8v6f90a635zc6gmhwlphp-gfortran-10.3.0-lib/lib/li= bstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /tmp/RtmpKqzb= Yg/file3245e787c.so) > Error in sink(type =3D "output") : invalid connection > > The same code works well with gcc-toolchain@10 instead of gcc-toolchain > (@12, which is the default). As we can see the generated shared library > above depends on GCC 12, 10 and GFortran 10 at the same time: [...] > Possible solutions: > > - Make gcc-toolchain@10 the default and rename gcc-toolchain@12 to > gcc-toolchain-next@12, like we do for Haskell and (sometimes) Python. > - Update, both, the default GCC and GFortran to version 12. > - Explicitly depend on the correct gcc-toolchain in packages that need > a compiler. It depends on what you are naming default. :-) The default GCC toolchain for compiling is provided by the package gcc-toolchain@10. Without any specification about the version, if a package name is defined at several versions, then the command-line uses the higher version of this package. To avoid the kind of confusing error as you are observing, usually, the suffix =E2=80=99-next=E2=80=99 is applied to th= e package name for higher versions. For instance, python-numpy-next. To add a data point to the confusion, consider the package =E2=80=99gcc=E2= =80=99 instead of =E2=80=99gcc-toolchain=E2=80=99. As noticed earlier [1], there is a bug= . Consider: --8<---------------cut here---------------start------------->8--- $ guix show gcc@6 guix show: error: gcc@6: package not found $ guix show gcc@7 name: gcc version: 7.5.0 outputs: + lib: shared libraries + debug: debug information + out: everything else systems: x86_64-linux i686-linux dependencies: gmp@6.2.1 isl@0.23 libelf@0.8.13 libstdc++-headers@10.3.0 mpc= @1.2.1 mpfr@4.1.0 perl@5.34.0 texinfo@6.7 zlib@1.2.11 location: gnu/packages/gcc.scm:601:2 homepage: https://gcc.gnu.org/ license: GPL 3+ synopsis: GNU Compiler Collection=20=20 description: GCC is the GNU Compiler Collection. It provides compiler fron= t-ends for several languages, including C, C++, Objective-C, Fortran, Ada, = and + Go. It also includes runtime support libraries for these languages. --8<---------------cut here---------------end--------------->8--- It is because the =E2=80=99properties=E2=80=99 field of gcc@7 is rewritten, --8<---------------cut here---------------start------------->8--- (define-public gcc-7 (package (inherit gcc-6) (version "7.5.0") [...] (properties `((compiler-cpu-architectures ("aarch64" ,@%gcc-7.5-aarch64-micro-architectures) ("armhf" ,@%gcc-7.5-armhf-micro-architectures) ("x86_64" ,@%gcc-7.5-x86_64-micro-architectures)))))) --8<---------------cut here---------------end--------------->8--- and thus, it looses =E2=80=99hidden=E2=80=99, as shown here: --8<---------------cut here---------------start------------->8--- $ guix repl GNU Guile 3.0.8 Copyright (C) 1995-2021 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guix-user)> ,use(gnu packages gcc) scheme@(guix-user)> (package-properties gcc-6) $1 =3D ((hidden? . #t) (gcc-libc . #f)) scheme@(guix-user)> (package-properties gcc-7) $2 =3D ((compiler-cpu-architectures ("aarch64" "armv8-a" "armv8.1-a" "armv8= .2-a" "armv8.3-a") ("armhf" "armv7" "armv7-a" "armv7-m" "armv7-r" "armv7e-m= " "armv7ve" "armv8-a" "armv8-a+crc" "armv8.1-a" "armv8.1-a+crc" "armv8-m.ba= se" "armv8-m.main" "armv8-m.main+dsp" "iwmmxt" "iwmmxt2") ("x86_64" "core2" "ne= halem" "westmere" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake"= "bonnell" "silvermont" "knl" "skylake-avx512" "k8" "k8-sse3" "barcelona" "= bdver1" "bdver2" "bdver3" "bdver4" "znver1" "btver1" "btver2" "geode"))) scheme@(guix-user)> --8<---------------cut here---------------end--------------->8--- Because the intent of, --8<---------------cut here---------------start------------->8--- (define-public gcc-toolchain-aka-gcc ;; It's natural for users to try "guix install gcc". This package ;; automatically "redirects" them to 'gcc-toolchain'. (deprecated-package "gcc" gcc-toolchain-10)) --8<---------------cut here---------------end--------------->8--- is to return the default GCC toolchain when typing =E2=80=99gcc=E2=80=99 at= the command line. And error for any other version than @10. 1: Update the default GCC toolchain from 10 to 12 is a core-updates change and a (almost) full world rebuild. When the issue you are describing is an issue about an inconsistency with the command-line. >From my point of view, an option would to rename the packages gcc-toolchain@11 and gcc-toolchain@12 as gcc-toolchain-next@11 and gcc-toolchain-next@12. Which would be consistent with the rest. And also fix the bug with the package =E2=80=99gcc=E2=80=99. :-) Cheers, simon From unknown Sat Sep 06 09:45:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60200: Incompatibilities between gcc-toolchain and R packages Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 21 Dec 2022 09:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60200 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: zimoun Cc: 60200@debbugs.gnu.org Received: via spool by 60200-submit@debbugs.gnu.org id=B60200.167161465716829 (code B ref 60200); Wed, 21 Dec 2022 09:25:02 +0000 Received: (at 60200) by debbugs.gnu.org; 21 Dec 2022 09:24:17 +0000 Received: from localhost ([127.0.0.1]:50579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7vKj-0004NN-3j for submit@debbugs.gnu.org; Wed, 21 Dec 2022 04:24:17 -0500 Received: from mout-p-202.mailbox.org ([80.241.56.172]:50792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7vKg-0004NB-GO for 60200@debbugs.gnu.org; Wed, 21 Dec 2022 04:24:15 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4NcSgT3H0mz9sZr; Wed, 21 Dec 2022 10:24:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1671614645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UDR2P9oPwiuUYq4Yj4Pav5uin3GrIXsEmQDEtw/Y+9Q=; b=if+RDQrvmBOjELuBnbx4LR/zwSbarOiKmIituYF73QWZkXRc1WxT6G74tgST1+eCuHVPuq F0uo5HdEs76stBkMNWYhb24f7g/kK/t4qo9ybTIN9G2VNZ7qHyqdoOvdG4Jt20paKGRf1a Z3FkqH64OZu7mb1ZB2B3KiBXzOIr8SkawkyAcdZTC72PsKrJf6iNZRy2S0ucg+iZJZ3R93 GHdstkB0xk//Imm/v9tE7vnZ6KGjNvi3n4Is0bhjUleKr1uKbI7SZOMiJfy4+ERk7vazyk TNFMMDakA7zNp3D7CQ0cfG3hTGpI+Fw85rwd9nlyMQ700IzosigFFGwd2lUTcw== Date: Wed, 21 Dec 2022 10:24:03 +0100 From: Lars-Dominik Braun Message-ID: References: <86wn6nynp1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="lX0Rd041EaxB9xpF" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86wn6nynp1.fsf@gmail.com> X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --lX0Rd041EaxB9xpF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi Simon, > Without any specification about the version, if a package name is > defined at several versions, then the command-line uses the higher > version of this package. minor nit-pick: Not the command-line, but everything that uses specifications. So manifests via SPECIFICATIONS->MANIFEST are also affected, see: (use-modules (gnu packages) (guix profiles)) (manifest-entries (specifications->manifest '("gcc-toolchain"))) $2 = (#< name: "gcc-toolchain" version: "12.2.0" …) The -next suffix has the obvious disadvantage that specifications may become invalid as we move -next to the “regular” package. So maybe marking packages “default” like the attached patch does could improve the current situation. Not just for gcc, but also Haskell and Python come to mind. Cheers, Lars --lX0Rd041EaxB9xpF Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="default-gcc-toolchain.patch" diff --git a/gnu/packages.scm b/gnu/packages.scm index 61345f75a9..7e5a6d49c2 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -356,20 +356,24 @@ (define cache (find-packages-by-name/direct name version)))) (define (find-best-packages-by-name name version) - "If version is #f, return the list of packages named NAME with the highest -version numbers; otherwise, return the list of packages named NAME and at -VERSION." + "If version is #f, return the list of packages named NAME with only +packages marked default? or, if none exist, the highest version numbers; +otherwise, return the list of packages named NAME and at VERSION." (if version (find-packages-by-name name version) (match (find-packages-by-name name) (() '()) ((matches ...) - ;; Return the subset of MATCHES with the higher version number. - (let ((highest (package-version (first matches)))) - (take-while (lambda (p) - (string=? (package-version p) highest)) - matches)))))) + ;; Return the subset of MATCHES which are marked default or those with + ;; the higher version number. + (let ((highest (package-version (first matches))) + (default (filter (lambda (p) (assoc-ref (package-properties p) 'default?)) matches))) + (if (not (null? default)) + default + (take-while (lambda (p) + (string=? (package-version p) highest)) + matches))))))) ;; Prevent Guile 3 from inlining this procedure so we can mock it in tests. (set! find-best-packages-by-name find-best-packages-by-name) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index b4566b41cc..2d5e0add26 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3855,7 +3855,10 @@ (define* (make-gcc-toolchain gcc ("libc-static" ,libc "static")))))) (define-public gcc-toolchain - (make-gcc-toolchain gcc-final)) + (let ((parent (make-gcc-toolchain gcc-final))) + (package + (inherit parent) + (properties (alist-cons 'default? #t (package-properties parent)))))) (define-public gcc-toolchain-4.8 (make-gcc-toolchain gcc-4.8)) --lX0Rd041EaxB9xpF--