From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WJHZHmPIxmMs2AAAbAwnHQ (envelope-from ) for ; Tue, 17 Jan 2023 17:10:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gJfJHmPIxmPhQwEAauVa8A (envelope-from ) for ; Tue, 17 Jan 2023 17:10:11 +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 4EC818475 for ; Tue, 17 Jan 2023 17:10:11 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHoWX-0006PH-PD; Tue, 17 Jan 2023 11:09:21 -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 1pHoWW-0006P7-Sv for guix-devel@gnu.org; Tue, 17 Jan 2023 11:09:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHoWV-000373-Rl; Tue, 17 Jan 2023 11:09:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=xUlZf05mcvEHbemlPCJxvvqYKd1irhayPILPb9yBjm8=; b=Zgn6mmoNus9c1AETLF6R j8aN7ax+GTEdKIq/rzvcGq6jrSFO9PNh9h8te4RIQboHa7G+uIXKzkGNKsFJS19W237FolaA1XgEI E95rPQbwOkQ7dFLaZr5QsLCFL1lbVI/DCk+og/rtUif23mjYuUZhNl66GJbW4ITIl9Qx6nFRS9/fe V0hk6wLxzqo+Pel7rSeuESfT9rXjr3lgtH6f7Iw7rhQjqZp412r56AGHCMPl7v2PbBgNtRPUz6tNe AUrQMH5baVP2Y6ozFW1LwzV11acAnvigsLvpBNrwGbm6Z1FRDE4+YR8ZXOEw9aT7O7stayD8Die6g ilCKRUVFivfeWg==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHoWV-0001JP-4I; Tue, 17 Jan 2023 11:09:19 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Simon Tournier Cc: Guix Devel , Lars-Dominik Braun Subject: Re: properties for default version? (was bug#60200: Incompatibilities between gcc-toolchain and R packages) References: <86pmbk3hci.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Octidi 28 =?utf-8?Q?Niv=C3=B4se?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Zinc X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 17 Jan 2023 17:09:16 +0100 In-Reply-To: <86pmbk3hci.fsf@gmail.com> (Simon Tournier's message of "Wed, 11 Jan 2023 22:13:17 +0100") Message-ID: <87v8l5dtxv.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Seal: i=1; s=key1; d=yhetil.org; t=1673971811; a=rsa-sha256; cv=none; b=qGoSYqXTailcjZB/AaBIf0XTuEiHtL4jM/C9jYepMPE3h+zpeoE2/836nDlEZQL6Bj3Tjk YYWG2n4m4n1biF41G5PArPcOiLLT6l3lVzTD95shI6aqKPK59lwGUFQreZ3auBLiuT/Ggv crRQcRVV+ntiYzWyvuNbb/GASQN8Gkg7m0ficnxkaJ1cgz2FGvXS3o+6s+uMLIFJRPkvut Y5blF+RTaP1cHa6Ptc1i1jHfFoHYVqlIuwxE1AT2KKtRTHDJtWgH3gbusy4cPllCNZbXhZ PYDtf6sKEnonmY7vmIoPqlf2hVHYheJW5hJCPkVxB2m7SeHMIvbETEluR0Yzcg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=Zgn6mmoN; dmarc=pass (policy=none) header.from=gnu.org; 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=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673971811; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=xUlZf05mcvEHbemlPCJxvvqYKd1irhayPILPb9yBjm8=; b=tiHswdP08IonGGANrsMI+5VcaI2Yrm8+6X0iea883L9Thtg2CDSyrOdlEnosNyVINH8Ckk IzCYbwARXo+x25octL090X7FW2l6m5pHVEYmvbORWryByHTOR8QV8yuPqvIobR5tN93WkV 8f2eHheaU01m0oDwlMhFlHpK4pt16igtMIlO7NhMH9fC5d3Ktar+kh6w6ZwCs+VVw/moJI wd0dpkmlFe8s7pTdPN5jUMIWFdo0LMcz5Mf7qTBDMuz+lHw3EfPcdt2muluOf4IWUtf3ir 68g0EAFP/yYt6JNhSfGpX00a5D2qg5lMknetd7CF0Ojwo5E3LgeDTK+uT7suVw== X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -9.19 X-Spam-Score: -9.19 X-Migadu-Queue-Id: 4EC818475 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=Zgn6mmoN; dmarc=pass (policy=none) header.from=gnu.org; 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" X-TUID: pREe4TCRhiKe Hello, Simon Tournier skribis: > 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: > > $ guix shell ocaml ocaml-ppxlib -- ocaml --version > The OCaml toplevel, version 5.0.0 > > > But the OCaml libraries are built using OCaml compiler v4.14, thus it > leads to error as: > > Error: /gnu/store/vglxlc8riynj1g937clvwv8yg40lln6z-profile/lib/ocaml/site= -lib/ppxlib/ppxlib.cmi > is not a compiled interface for this version of OCaml. > It seems to be for an older version of OCaml. > > 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. To me it=E2=80=99s mostly a packaging issue: I would expect =E2=80=98ocaml= =E2=80=99 to be able to use =E2=80=98ocaml-ppxlib=E2=80=99. If not, then it should indeed be = =E2=80=98-next=E2=80=99. > Well, what do people think about this Lars=E2=80=99s 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)))) >=20=20 > (define (find-best-packages-by-name name version) > - "If version is #f, return the list of packages named NAME with the hig= hest > -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=3D? (package-version p) highest)) > - matches)))))) > + ;; Return the subset of MATCHES which are marked default or tho= se with > + ;; the higher version number. > + (let ((highest (package-version (first matches))) > + (default (filter (lambda (p) (assoc-ref (package-properti= es p) 'default?)) matches))) > + (if (not (null? default)) > + default > + (take-while (lambda (p) > + (string=3D? (package-version p) highest)) > + matches))))))) I=E2=80=99m slightly reluctant because then you can have several packages t= hat declare themselves as =E2=80=9Cdefault=E2=80=9D, which looks weird. Reason= ing about why a given package was chosen would now involve more than version strings. Thoughts? Ludo=E2=80=99.