From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2M48EtXss1/WWgAA0tVLHw (envelope-from ) for ; Tue, 17 Nov 2020 15:31:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id IOg5DtXss1/bfwAA1q6Kng (envelope-from ) for ; Tue, 17 Nov 2020 15:31:33 +0000 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 7CF089403C9 for ; Tue, 17 Nov 2020 15:31:32 +0000 (UTC) Received: from localhost ([::1]:43682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf2x9-0001uf-DQ for larch@yhetil.org; Tue, 17 Nov 2020 10:31:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf2wy-0001tW-2h for guix-devel@gnu.org; Tue, 17 Nov 2020 10:31:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56088) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf2wv-0004LI-Lo; Tue, 17 Nov 2020 10:31:17 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38606 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kf2wt-0007fz-Np; Tue, 17 Nov 2020 10:31:17 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Stephen Christie Subject: Re: A plan for parameterized packages References: <8BB50B81-762F-4701-8A60-AAC323E4324A@e.email> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 27 Brumaire an 229 de la =?utf-8?Q?R=C3=A9volution?= 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 Nov 2020 16:31:12 +0100 In-Reply-To: <8BB50B81-762F-4701-8A60-AAC323E4324A@e.email> (Stephen Christie's message of "Tue, 17 Nov 2020 09:25:37 -0500") Message-ID: <87r1osov9b.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (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.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -1.51 X-TUID: 528lE4r6/p4k Hi Stephen, (+Cc: guix-devel@gnu.org. You can post without being subscribed.) Stephen Christie skribis: > I have done a lot of work with the Conan package manager, a c++ > language package manager, that has grown in capability. It is not > fully functional, but works on the hash of the key parameters of the > package (name, version, etc.) to find the right reproducible > binary. Two important parameters are "options" and "settings". > > Options are per-package, and generally affect none below it. You can > specify defaults for the options in the package, and also call for > specific options on dependencies in package "recipes". There are also > ways to define incompatibilities and substitutes. On the command line, > you can specify options with -o,--options, with no namespace needed > for the package you are installing, and package:option to specify for > other packages pulled in. I prefer this syntax to all the equal signs > you proposed (though I defer if this is standard throughout > Guix/Guile) > > Settings are more "system-wide", though being a language package > manager, it does not have a "system". The same settings are applied to > the whole tree during an install, and are usually things like > compiler, architecture, and build type. These settings are chosen > through a profile file, of which there is a default generated for a > given computer. Settings can also be set at the command line during > install with -s,--settings, but of course there is no namespacing. > > https://docs.conan.io/en/latest/mastering/conditional.html > > I think there is a lot of good stuff in Conan that Guix could learn > from. It's a lot closer in architecture than any of the traditional > system package managers. Thanks for sharing Conan=E2=80=99s perspective on these issues! The settings/options distinction looks like a useful one. Like Pierre suggested, it=E2=80=99d be nice to have options that apply to the whole gra= ph in addition to per-package options like I was focusing on. Conan=E2=80=99s approach to conflicting options may not be applicable to Gu= ix. For instance, the manual above has this example: def configure(self): # =E2=80=A6 if self.settings.os =3D=3D "Windows": self.options["openssl"].shared =3D True def requirements(self): # Or add a new requirement! if self.options.testing: self.requires("OpenSSL/2.1@memsharded/testing") else: self.requires("openssl/1.0.2u") In Guix, instead of stating that OpenSSL 1.0.2u is required or that it needs to include shared libraries, you=E2=80=99d actually depend on a varia= nt of OpenSSL that fulfills these constraints; by construction, you can be sure you have the intended OpenSSL variant (generally speaking, a Guix package dependency graph has zero degrees of liberty, unlike an apt/Spack/Conan graph.) As for the syntax=E2=80=A6 yeah, we could find a shorthand. :-) The verbo= sity in the examples I gave partly stems from the fact that these are per-package parameters, so you need to specify which package it applies to. With =E2=80=9Cglobal=E2=80=9D parameters, we could have, say: guix install -P x11=3Dfalse emacs meaning that the =E2=80=98x11=E2=80=99 parameter will be set to #f in all t= he packages that have such a parameter. Thanks, Ludo=E2=80=99.