From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id BmMEEyMVtF8SYQAA0tVLHw (envelope-from ) for ; Tue, 17 Nov 2020 18:23:31 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id qK6uDiMVtF/7YQAAB5/wlQ (envelope-from ) for ; Tue, 17 Nov 2020 18:23:31 +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 9D90C940222 for ; Tue, 17 Nov 2020 18:23:30 +0000 (UTC) Received: from localhost ([::1]:49788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf5dZ-0003qf-IQ for larch@yhetil.org; Tue, 17 Nov 2020 13:23:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf5UT-0007eR-Bo for guix-devel@gnu.org; Tue, 17 Nov 2020 13:14:05 -0500 Received: from mail.ecloud.global ([2a01:4f9:c010:c4fd:d00b::2]:43960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf5UQ-0003SJ-GP; Tue, 17 Nov 2020 13:14:05 -0500 Received: from authenticated-user (mail.ecloud.global [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.ecloud.global (Postfix) with ESMTPSA id AE4A61000262702B; Tue, 17 Nov 2020 18:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=e.email; s=mail1; t=1605636834; 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=juZVIhR4ijdfYGzd2vI39YthybLe96IkGjhTNEpnJ0s=; b=xBiBhVbmEgCrFSyjrml0oOpbpXk1Dy4yN0u1E9bNPWS8iB4Tkf0mqORrtvuEI11EXfsZib DOCa/H6hjzsTMile8wxlDs0oBgPnIsvrri+VVLkqWtTmAvhv0/lLQkWxGjygNf9cusL08w Ba8R7VL87SLGwEdRJdZL06uQ1+jGaKQ= Date: Tue, 17 Nov 2020 13:13:44 -0500 In-Reply-To: <87r1osov9b.fsf@gnu.org> References: <8BB50B81-762F-4701-8A60-AAC323E4324A@e.email> <87r1osov9b.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----DVM2TB9435IGYPZOGGQLS0PCK5F7JX" Content-Transfer-Encoding: 7bit Subject: Re: A plan for parameterized packages To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= CC: mail@ambrevar.xyz,guix-devel@gnu.org From: Stephen Christie Message-ID: <3E722E84-E8E7-4A52-B410-0A424963CA57@e.email> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=e.email; s=mail1; t=1605636834; 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=juZVIhR4ijdfYGzd2vI39YthybLe96IkGjhTNEpnJ0s=; b=GIgJFAS/1bb6vQJ0gD47DLJQ/FLO5jKP09QpIySYXbVZNM0aRj2cXr9jmA/XtTgedxLseU yH0MIkO9wR0AsgPw9h6yqw/TKRl5WucRZvu94mRunbThCPmtFMR+KzcFd2u+q79GO8dsY5 /mr/71CsAVIeo550VSwZR66hzOdXPnA= ARC-Seal: i=1; s=mail1; d=e.email; t=1605636834; a=rsa-sha256; cv=none; b=glYJTQoMGDnJcFq8emaS6B1UinoCnY2ti3ovYOWSlHdq1uqjfsHKu5bnc/DgDD/OlBwDvt doNLyVNl/CbNhApNpMXCAz5P0p4E2yHWyBncwpask3roiP0t5HYSdFarK5yNaMhAM+qP9v E/oQUOKyHEvt3buZ/7RqefVwsN2dL1Y= ARC-Authentication-Results: i=1; mail.ecloud.global; auth=pass smtp.mailfrom=spc@e.email Received-SPF: pass client-ip=2a01:4f9:c010:c4fd:d00b::2; envelope-from=spc@e.email; helo=mail.ecloud.global X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 17 Nov 2020 13:23:18 -0500 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: , 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=pass header.d=e.email header.s=mail1 header.b=xBiBhVbm; arc=pass (e.email:s=mail1:i=1); dmarc=pass (policy=quarantine) header.from=e.email; 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: -2.71 X-TUID: ML1cBDkLHx1m ------DVM2TB9435IGYPZOGGQLS0PCK5F7JX Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludo, The self=2Eoptions["openssl"]=2Eshared does set the option for openssl, bu= t this is not different than providing `-o openssl:shared` on the command l= ine; it uses this to determine which package was actually requested=2E Cona= n packages are also non-configurable in the end, stored as the hash of it's= name and parameters=2E This is probably done while calculating the tree be= fore installing/building everything, but once that tree is calculated, it i= s fixed=2E Besides parameters determining the hash of the package, OpenSSL/2=2E1@mems= harded/testing and openssl/1=2E0=2E2u are most certainly separate packages= =2E Conan has this name/version@username/channel structure to help find alt= ernatives (semver is supported), but otherwise those are completely differe= nt=2E On November 17, 2020 10:31:12 AM EST, "Ludovic Court=C3=A8s" wrote: >Hi Stephen, > >(+Cc: guix-devel@gnu=2Eorg=2E You can post without being subscribed=2E) > >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=2E It is not >> fully functional, but works on the hash of the key parameters of the >> package (name, version, etc=2E) to find the right reproducible >> binary=2E Two important parameters are "options" and "settings"=2E >> >> Options are per-package, and generally affect none below it=2E You can >> specify defaults for the options in the package, and also call for >> specific options on dependencies in package "recipes"=2E There are also >> ways to define incompatibilities and substitutes=2E 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=2E 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"=2E The same settings are applied >to >> the whole tree during an install, and are usually things like >> compiler, architecture, and build type=2E These settings are chosen >> through a profile file, of which there is a default generated for a >> given computer=2E Settings can also be set at the command line during >> install with -s,--settings, but of course there is no namespacing=2E >> >> https://docs=2Econan=2Eio/en/latest/mastering/conditional=2Ehtml >> >> I think there is a lot of good stuff in Conan that Guix could learn >> from=2E It's a lot closer in architecture than any of the traditional >> system package managers=2E > >Thanks for sharing Conan=E2=80=99s perspective on these issues! > >The settings/options distinction looks like a useful one=2E Like Pierre >suggested, it=E2=80=99d be nice to have options that apply to the whole g= raph >in >addition to per-package options like I was focusing on=2E > >Conan=E2=80=99s approach to conflicting options may not be applicable to = Guix=2E >For instance, the manual above has this example: > > def configure(self): > # =E2=80=A6 > if self=2Esettings=2Eos =3D=3D "Windows": > self=2Eoptions["openssl"]=2Eshared =3D True > > def requirements(self): > # Or add a new requirement! > if self=2Eoptions=2Etesting: > self=2Erequires("OpenSSL/2=2E1@memsharded/testing") > else: > self=2Erequires("openssl/1=2E0=2E2u") > >In Guix, instead of stating that OpenSSL 1=2E0=2E2u is required or that i= t >needs to include shared libraries, you=E2=80=99d actually depend on a var= iant >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=2E) > >As for the syntax=E2=80=A6 yeah, we could find a shorthand=2E :-) The v= erbosity >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=2E 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= the packages >that have such a parameter=2E > >Thanks, >Ludo=E2=80=99=2E --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E ------DVM2TB9435IGYPZOGGQLS0PCK5F7JX Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludo,

The self=2Eoptions["openssl"]=2Eshare= d does set the option for openssl, but this is not different than providing= `-o openssl:shared` on the command line; it uses this to determine which p= ackage was actually requested=2E Conan packages are also non-configurable i= n the end, stored as the hash of it's name and parameters=2E This is probab= ly done while calculating the tree before installing/building everything, b= ut once that tree is calculated, it is fixed=2E

Besides parameters d= etermining the hash of the package, OpenSSL/2=2E1@memsharded/testing and op= enssl/1=2E0=2E2u are most certainly separate packages=2E Conan has this nam= e/version@username/channel structure to help find alternatives (semver is s= upported), but otherwise those are completely different=2E

On November 17, 2020 10:31:12 AM EST, "Ludovic Court=C3= =A8s" <ludo@gnu=2Eorg> wrote:
Hi Stephen,

(+Cc: guix-devel@gnu=2Eorg=2E Yo= u can post without being subscribed=2E)

Stephen Christie <spc@e= =2Eemail> skribis:

I have done a lot of work with the Conan package manager, a c++
lan= guage package manager, that has grown in capability=2E It is not
fully = functional, but works on the hash of the key parameters of the
package = (name, version, etc=2E) to find the right reproducible
binary=2E Two im= portant parameters are "options" and "settings"=2E

Options are per-= package, and generally affect none below it=2E You can
specify defaults= for the options in the package, and also call for
specific options on = dependencies in package "recipes"=2E There are also
ways to define inco= mpatibilities and substitutes=2E On the command line,
you can specify o= ptions with -o,--options, with no namespace needed
for the package you = are installing, and package:option to specify for
other packages pulled= in=2E I prefer this syntax to all the equal signs
you proposed (though= I defer if this is standard throughout
Guix/Guile)

Settings ar= e more "system-wide", though being a language package
manager, it does = not have a "system"=2E The same settings are applied to
the whole tree = during an install, and are usually things like
compiler, architecture, = and build type=2E These settings are chosen
through a profile file, of = which there is a default generated for a
given computer=2E Settings can= also be set at the command line during
install with -s,--settings, but= of course there is no namespacing=2E

https://docs=2Econan=2Eio/e= n/latest/mastering/conditional=2Ehtml

I think there is a lot of= good stuff in Conan that Guix could learn
from=2E It's a lot closer in= architecture than any of the traditional
system package managers=2E

Thanks for sharing Conan=E2=80=99s perspective on these i= ssues!

The settings/options distinction looks like a useful one=2E = Like Pierre
suggested, it=E2=80=99d be nice to have options that apply t= o the whole graph in
addition to per-package options like I was focusing= on=2E

Conan=E2=80=99s approach to conflicting options may not be ap= plicable to Guix=2E
For instance, the manual above has this example:
=
def configure(self):
# =E2=80=A6
if self=2Esettings=2Eo= s =3D=3D "Windows":
self=2Eoptions["openssl"]=2Eshared =3D True
def requirements(self):
# Or add a new requirement!
= if self=2Eoptions=2Etesting:
self=2Erequires("OpenSSL/2=2E1@= memsharded/testing")
else:
self=2Erequires("openssl/1= =2E0=2E2u")

In Guix, instead of stating that OpenSSL 1=2E0=2E2u is r= equired or that it
needs to include shared libraries, you=E2=80=99d actu= ally depend on a variant of
OpenSSL that fulfills these constraints; by = construction, you can be
sure you have the intended OpenSSL variant (gen= erally speaking, a Guix
package dependency graph has zero degrees of lib= erty, unlike an
apt/Spack/Conan graph=2E)

As for the syntax=E2=80= =A6 yeah, we could find a shorthand=2E :-) The verbosity
in the exampl= es I gave partly stems from the fact that these are
per-package paramete= rs, so you need to specify which package it applies
to=2E 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 the packages
that have such a parameter=2E
<= br>Thanks,
Ludo=E2=80=99=2E

--
Sent = from my Android device with K-9 Mail=2E Please excuse my brevity=2E<= /html> ------DVM2TB9435IGYPZOGGQLS0PCK5F7JX--