From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MFw7JJYmv2NYCAAAbAwnHQ (envelope-from ) for ; Wed, 11 Jan 2023 22:13:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WJp1JJYmv2PMSwAA9RJhRA (envelope-from ) for ; Wed, 11 Jan 2023 22:13:58 +0100 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 3220DE8D3 for ; Wed, 11 Jan 2023 22:13:58 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFiPc-0006jO-PG; Wed, 11 Jan 2023 16:13:32 -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 1pFiPb-0006h3-0g for guix-devel@gnu.org; Wed, 11 Jan 2023 16:13:31 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFiPZ-0005TQ-2f for guix-devel@gnu.org; Wed, 11 Jan 2023 16:13:30 -0500 Received: by mail-wm1-x334.google.com with SMTP id z8-20020a05600c220800b003d33b0bda11so3166586wml.0 for ; Wed, 11 Jan 2023 13:13:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=Wb9hFBAnffQjdbpjFY8JnC5zt7snubNwre4kCHMelAc=; b=EO6jt75V/R7iYwTRzB09Z6CHAXNiT6SJvAbXzXmJ35fQ0Qj005V6zlGudttv0VD0WN tEXAGSSinAAijz76uUxwICgzf9UfUKS5F4ETTp2TpSbP6zYWxNI8zNkruA2+1HY2kyqn +P6HdV3ch6arDWHcDLL9QrkALPvMn1/1F6mQjBIkgeXNEshszrooEbM0KX6K6F8Q9J2l ugVzIEIDvLTSZTqSA3Ckuin/qYXw+x4kAyIpnmt05tPxyDjICRXoyttYM8zrR00pg1yg glbTjUCbQjgeyGry5s0kITROnEOhtR6/8XMGqkAQtD/P9H1V3YWCf6CXQssog2HlKdC7 wgtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Wb9hFBAnffQjdbpjFY8JnC5zt7snubNwre4kCHMelAc=; b=pOeNJ3qeDbSQ+YCOTlC6tjM/SxwcmUuW6UPokYPfcOsSy7G3+ktAUQrJGuisuqN5vB x6Op0ci6enV4tNx2NRc6j4+/4BWUlaEQhDpj96VMjZmEMy6BiMXX6gE27evMO39Ht0ud BNVF0h7W8DFeCV20G7276+xPvwnZRGPEntSt9qrCaYkB0SijjkvC2TfzCbG9RatIidGP t/WxjA9EmmQ4Sh11My6xEFGatYGs3Oz7cP1hZLAzMJdxmMcK5sjbTt4A2pBeBINv7IFr JR50gb2IdIc8chffAUSoh5hJqPS/1IGKuSxArktCiLvWab+G1eS5hMkKdLP3t5yEMk+t NPwA== X-Gm-Message-State: AFqh2krRJJpif/Vo93M5cDIwQU5tKXGghzyIVZa6lDMg5d5jFAVLrUSh aEoiHI3jfeXE/uBo0kjRK6M= X-Google-Smtp-Source: AMrXdXuHmoMert0tjn38bdcyrSTBDL9xvIcpjkLWaHR+2pj/ovVHZmiesYjBh/Q623W0/kHQWMEG6g== X-Received: by 2002:a05:600c:3d8a:b0:3cf:cfce:9d93 with SMTP id bi10-20020a05600c3d8a00b003cfcfce9d93mr13530254wmb.2.1673471606424; Wed, 11 Jan 2023 13:13:26 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id f12-20020a05600c154c00b003d9fba3c7a4sm6206597wmg.16.2023.01.11.13.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 13:13:25 -0800 (PST) From: Simon Tournier To: Guix Devel Cc: Lars-Dominik Braun Subject: properties for default version? (was bug#60200: Incompatibilities between gcc-toolchain and R packages) References: Date: Wed, 11 Jan 2023 22:13:17 +0100 Message-ID: <86pmbk3hci.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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 ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=EO6jt75V; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673471638; a=rsa-sha256; cv=none; b=nOL1vulVqmXKVUem8nkxtGmLjbWhPtmgDH75jd8onPGB4VtD6IKxAM+y0aN0CaA3umpHrq Df0jfcvQsEqjcJOMo0SfV2E9hVI/+OhwtJkOpd+CDLkiI/krC00G3EshJUzugRx/wTvmm5 KsQMnqWyOn1WmCCfqY+sAEPbeElPCbAiHdJU2/6JKJIZjn0qW1ddOPYfHq8xFgWjahV0+m qcsYmuYFcqKIrHO8yW09FG2qJgLeIcVXUI2FDngcXFzqR7aMTIyrOULf6VviDiVDArJLvJ 9+BGBFGHQgnXJBMGmp4B1f7weUnOAgATcIE9PROv0g8xiPUcrlsS/ABr3XNMYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673471638; 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:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Wb9hFBAnffQjdbpjFY8JnC5zt7snubNwre4kCHMelAc=; b=eg/Ot7CHBPWcimkeCrwmP6OeZ6A36P02oSIxYBTWwjnz/dl0VT+FLjwzxXJCEYTC9NOTQy h2bHMjLFGhOMHLy2SHlWvNy+O/+jGSfPELb2d6IPqPY2bIpKtRSnUGaIPQKb7naAUcLPhw o6L6UT3JtcKNnTHRJgBv+efYxiEYwjkT3QMMMHY/cY9t5hcB1F4Ck5Mjv8g98Xz0fhO0ee dYdBQmew29GL96dZapDxmogIwsjs1sO5oPdOkyY/MpmAtY2lylGo3v/ybq+bjOmoisoOIx ieZ6D9nQM2+wZhQDGp3vyZduw/obPvfIHG18ZTu5dqGkjBUPaJEKeYr9jPS8dw== X-Migadu-Queue-Id: 3220DE8D3 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=EO6jt75V; 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"; dmarc=pass (policy=none) header.from=gmail.com X-Migadu-Spam-Score: -7.53 X-Spam-Score: -7.53 X-TUID: 4mr4MFdxwCHh --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, As bug#60200 [1], the issue is one that many of us often hit: packages with several versions and when the highest one is not the default. Other said, build systems use some version for compiler and tools but Guix can also offer more recent versions for these very same compilers and tools. It leads to the issue when selecting the name of a compiler or tool (command line or manifest). The user does not get the ones used as default by build system. In addition to [1], another example: --8<---------------cut here---------------start------------->8--- $ guix shell ocaml ocaml-ppxlib -- ocaml --version The OCaml toplevel, version 5.0.0 --8<---------------cut here---------------end--------------->8--- But the OCaml libraries are built using OCaml compiler v4.14, thus it leads to error as: --8<---------------cut here---------------start------------->8--- Error: /gnu/store/vglxlc8riynj1g937clvwv8yg40lln6z-profile/lib/ocaml/site-l= ib/ppxlib/ppxlib.cmi is not a compiled interface for this version of OCaml. It seems to be for an older version of OCaml. --8<---------------cut here---------------end--------------->8--- For other cases, such issue is avoided by appending the suffix -next to package name; as with ghc-next, python-numpy-next, emacs-next, etc. Personally, I find the -next trick useful because the package name reflects that it is not the default. However, it can be annoying to update manifest files when this -next is becoming default. Well, what do people think about this Lars=E2=80=99s patch? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=p.patch Content-Description: 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)) --=-=-= Content-Type: text/plain 1: Cheers, simon --=-=-=--