From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mBBICpso3mKuGQEAbAwnHQ (envelope-from ) for ; Mon, 25 Jul 2022 07:22:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id mOVpCZso3mKpRgAAG6o9tA (envelope-from ) for ; Mon, 25 Jul 2022 07:22:35 +0200 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 9F9442D25D for ; Mon, 25 Jul 2022 07:22:34 +0200 (CEST) Received: from localhost ([::1]:55818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFqY5-0001Rf-Pn for larch@yhetil.org; Mon, 25 Jul 2022 01:22:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFqX4-0001RG-Cs for guix-devel@gnu.org; Mon, 25 Jul 2022 01:21:30 -0400 Received: from lepiller.eu ([89.234.186.109]:43222) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFqWz-0000b9-Cm for guix-devel@gnu.org; Mon, 25 Jul 2022 01:21:29 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id eb059152; Mon, 25 Jul 2022 05:21:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=b/3mMk+9I9k/ V1Q8Fc6cMx617Knio3tfHfPIEdWqJ7c=; b=C2ILEIZDHmZGdqEI+Gpib4gfBGoz PETeZ1lbFd9b7g34YlUTBFaLSIVfHRdNGlWaxdrF2QCvRUwxy7NZLSLT4lKIGWWJ f14wQyhGQDezFsg5UJKD4hrC+MHKJrTS2GjAzgjTwoMYULYQAeOJTRbN8iyfcALt I7/Wm7A2An/izdnDo4LXpxvG1D7WDCJPwzIqD4ZgWeT6wZPvZPtPA7GYu3JuhMq5 QUpjPviQGoHNfSdsd15w7D1FjPlG/l5kXM2lGlL3EovLVri/GrNz/eAmi3k88Svu xHRzTCWJbvGQgofOAr8SQNsQFx15RFSS3MScW8QGqAY/xwv1HkMOyoqokQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id bb36a3e9 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 25 Jul 2022 05:21:19 +0000 (UTC) Date: Mon, 25 Jul 2022 07:21:09 +0200 From: Julien Lepiller To: guix-devel@gnu.org, Maxime Devos , Guix-devel Subject: =?US-ASCII?Q?Re=3A_A_proposal_of_a_consistent_set_of_clear_rules_an?= =?US-ASCII?Q?d_guidelines_involving_snippets=2C_phases_and_patches=2E?= User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <291DF0C6-5C59-4F04-8959-E770841BF448@lepiller.eu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----GM0K2BKD1QE1N06AYDGMFSNWIQWMTW Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=89.234.186.109; envelope-from=julien@lepiller.eu; helo=lepiller.eu 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_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658726554; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=OL2/EK568MrO0+KC9o4qwx064yVdcH7gWvocF06pFQU=; b=Tpg+2cavCF5pGvRdZfGuqGQiTgRw7UFoOMGp0ikbt6NDodTUoJPiYl9IdYZpYhhn/fMeTB d46xhidqhj74E5tUnH9oSlqVGw3J4fOIK4BodzgX5/Wtc+1p5TXX5LNupmHuwsQRUiaJSG ETdOVXJ7KP/dLXDxe2DPULa5mA2yxTegbdYY5Du0Wmx100UtN1VQoiNytNSSiDen9IHuFW ajmQYawu1WUEWFavAJt/pMcsstVfRoM1V6MKvlmBeCGmYl/TPCg0wykl72P2EZMlPS7SiS LXTVk5u1LWj3Jn3ReF4cmVceuHUc5edk5mlW/UF9WjDPHdBeC9Cf4KD9H63WzQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658726554; a=rsa-sha256; cv=none; b=UMtyQJpy015hOHp/VG/bY2TRcR5E8Rnq5aOdkNQDx/spCvLNvF7pm5VSCcyW6+lA9PGozh L/Qm92Syn+5SLs5yLUTvS2YgaWIp98SdaPYnjS/PdmsfLFpajMCUkZ4Yq7oVCkd8XgetyW IZxlzUJdFo+XhT/bi46vZEfW1MvjecPHAmax8t1Qb/giGlVFnW56TGF1GaRSPNFtIrVfzw ogNEiMhTVGdSGPbM20IUERLh8o4KaKt8kLJ2jGgrQFxnX6G45JkbPL2Fy5WkxCvIe+4erH IMQ107frkrtEL45XvRDX85FYcR75zxMGUiT6z8G1QNSPKVxBjCPYBeVVsypSwQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lepiller.eu header.s=dkim header.b=C2ILEIZD; dmarc=pass (policy=none) header.from=lepiller.eu; 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-Migadu-Spam-Score: -2.73 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lepiller.eu header.s=dkim header.b=C2ILEIZD; dmarc=pass (policy=none) header.from=lepiller.eu; 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-Migadu-Queue-Id: 9F9442D25D X-Spam-Score: -2.73 X-Migadu-Scanner: scn1.migadu.com X-TUID: L94it63n/fjF ------GM0K2BKD1QE1N06AYDGMFSNWIQWMTW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I don't like the wording at all=2E You're mixing too many things together= =2E I think it would be better to first document the guiding principles (eg=2E= the goal that there are no non-free software in Guix, going for the simple= st thing, etc) and then derive rules for specific cases, based on these pri= nciples: How do I remove non-free software? -> snippet because =E2=80=A6 How do I remove bundled libraries? -> snippet or phase because =E2=80=A6 How do I fix a build issue? -> patch or snippet if this affects building f= rom source, can also be a phase if the result of --sources can still build A test issue? =E2=80=A6 This leaves some cases up to interpretation, but that's probably not so di= fferent from "it's not an absolute rule"=2E It's also much clearer and quic= ker to figure out in which case you are=2E If not documented as a case, you= can fall back to the general principles=2E Le 25 juillet 2022 05:17:33 GMT+02:00, Maxime Devos a =C3=A9crit=C2=A0: >Context: it's currently a mess:, and at times contradictory > > * There is policy involving those three, as can be seen from the > shepherd mess=2E > * This policy is partially secret, as can be seen by some people > treating some things as policy even if it's not in the manual=2E > * Some versions of the policy are based on archeology, e=2Eg=2E see the > 'snippets were introduced for this particular purpose, so don't use > it for other things=E2=80=99 which is not documented in the manual as = sole > legitimate reason and asking contributors to read all past > discussions seems too much for me=2E > * Sometimes, people refer to the manual (Snippets versus Phases) for > how things (should) work, but what they say is not actually present > in that section of the manual=2E > * Some variants of the policy are contradictory with each other (IIRC) > * Some of the policies are contradictory with current practice in > other Guix packages=2E > * '(guix)Snippets versus Phases says Phases' states that it is elusive= =2E > * The section name implies it's a =E2=80=98X versus Y=E2=80=99, which se= ems > polarizing? (Maybe?) > * The section neglects the is/ought-distinction -- it just says what > is typically used for what, not whether they should be used for them > and whether they are allowed to be used for other things, so that > section does not seem policy to me (except for the single 'should > produce' and 'must not' line), only matters of fact=2E > >I can't work with such a mess=2E As such, I've a proposal for a consisten= t, clear and non-elusive set of rules and guidelines, based on the followin= g principles: > > * It appears we cannot agree on what exactly the policy should be, but > having a single policy everyone can use even if some would rather > have the specifics be a tiny bit different, is much better than the > mess of everyone having their own policy=2E > * There are no absolutes, except that the result of "guix build > --source" must be free software; > * There can be more than one (acceptable) way to do things, but this > doesn't make things elusive, this just means there are multiple > acceptable options and you should probably go for the simplest=2E > >More concretely, I propose the following new contents for (guix)Snippets = versus Phases (the phrasing could use some work for smooth reading), which = I believe to be sufficiently clear (except for some phrasing that could be = tweaked, e=2Eg=2E the phrases are currently rather long), covers a sufficie= nt amount of cases (feel free to respond if you see a missing case), free o= f contradictions (likewise) and mostly in line with current practice: > >[start] > >@c: There is no opposition or such, so no versus, let's not start with po= larisation=2E > >20=2E4=2E5 Snippets, phases and patches > >Snippets, phases and patches at times serve overlapping purposes=2E To de= cide between the three, there are several considerations to keep in mind: > > * Patches must not be used to remove non-free files, because a patch > by construction contains the non-free file itself so the patch would > be non-free, which would not be acceptable to Guix=2E Likewise, > patches should not be used to remove bundled libraries, to avoid > large space usage, but this is not an absolute rule unlike as for > non-free files=2E > * Snippets are often convenient for removing unwanted files such as > bundled libraries, non-free sources and binaries=2E It is technically > also possible to use phases for this, albeit slightly less > convenient at times=2E However, phases must not be used to remove > non-free sources, as then the output of "guix build --source" would > still contain the non-free sources, which is incompatible with Guix' > stance on free software=2E Likewise, phases should not be used to > remove binaries; however, this is not strictly forbidden=2E > * Snippets must not embed store items in the source, as this is > incompatible with cross-compilation and prevents effectively sharing > the source code produced with "guix build --source" with people > using non-Guix systems=2E > * In principle, you can apply a patch from a phase=2E However, this > causes the result of "guix build --source" to not correspond to the > actual source code anymore (i=2Ee=2E, it doesn't act as corresponding > source anymore), so consider this a last resort for situations such > as avoiding causing a world-rebuild for a patch fixing a > target-specific bug by making the patching conditional upon > target-foo?=2E If you apply a patch from a phase, make sure that the > patch appears in the inputs or native-inputs, such that "guix build > --source=3Dall" will include the patch=2E > > @c this relaxes the old rule a little > > * Ideally, the source derived from the origin should be usable for > building on any system that the upstream package supports (even if > Guix does not support that system), as a courtesy to the people that > the source code is shared with=2E However, this is not an absolute > rule, most important is that it is usable on Guix and it is allowed > to neglect this recommendation when it is tricky to follow or a > large amount of work=2E For example, if some Windows-specific source > files are non-free, you can simply remove them without replacing > them by a free implementation, even if that would reduce the set of > systems the package can be built on=2E > >Sometimes, there remains more than one acceptable way to accomplish the g= oal=2E In that case, choose whatever appears to be most convenient=2E > >[end] > >(Comments welcome, and required to go forward) > >Greetings, >Maxime > ------GM0K2BKD1QE1N06AYDGMFSNWIQWMTW Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable I don't like the wording at all=2E You're mixing too many things t= ogether=2E

I think it would be better to first document the guiding = principles (eg=2E the goal that there are no non-free software in Guix, goi= ng for the simplest thing, etc) and then derive rules for specific cases, b= ased on these principles:

How do I remove non-free software? -> s= nippet because =E2=80=A6

How do I remove bundled libraries? -> sn= ippet or phase because =E2=80=A6

How do I fix a build issue? -> p= atch or snippet if this affects building from source, can also be a phase i= f the result of --sources can still build

A test issue?

=E2= =80=A6

This leaves some cases up to interpretation, but that's proba= bly not so different from "it's not an absolute rule"=2E It's also much cle= arer and quicker to figure out in which case you are=2E If not documented a= s a case, you can fall back to the general principles=2E

Le 25 juillet 2022 05:17:33 GMT+02:00, Maxime Devos <ma= ximedevos@telenet=2Ebe> a =C3=A9crit=C2=A0:

Context: it's currently a mess:, and at times contradictory

  • There is policy involving those three, as can be seen from the shepherd mess=2E
  • This policy is partially secret, as can be seen by some people treating some things as policy even if it's not in the manual=2E
  • Some versions of the policy are based on archeology, e=2Eg=2E se= e the 'snippets were introduced for this particular purpose, so don't use it for other things=E2=80=99 which is not documented in = the manual as sole legitimate reason and asking contributors to read all past discussions seems too much for me=2E
  • Sometimes, people refer to the manual (Snippets versus Phases) for how things (should) work, but what they say is not actually present in that section of the manual=2E
  • Some variants of the policy are contradictory with each other (IIRC)
  • Some of the policies are contradictory with current practice in other Guix packages=2E
  • '(guix)Snippets versus Phases says Phases' states that it is elusive=2E
  • The section name implies it's a =E2=80=98X versus Y=E2=80=99, wh= ich seems polarizing? (Maybe?)
  • The section neglects the is/ought-distinction -- it just says what is typically used for what, not whether they should be used for them and whether they are allowed to be used for other things, so that section does not seem policy to me (except for the single 'should produce' and 'must not' line), only matters of fact=2E

I can't work with such a mess=2E As such, I've a proposal for a consistent, clear and non-elusive set of rules and guidelines, based on the following principles:

  • It appears we cannot agree on what exactly the policy should be, but having a single policy everyone can use even if some would rather have the specifics be a tiny bit different, is much better than the mess of everyone having their own policy=2E
  • There are no absolutes, except that the result of "guix build --source" must be free software;
  • There can be more than one (acceptable) way to do things, but this doesn't make things elusive, this just means there are multiple acceptable options and you should probably go for the simplest=2E

More concretely, I propose the following new contents for (guix)Snippets versus Phases (the phrasing could use some work for smooth reading), which I believe to be sufficiently clear (except for some phrasing that could be tweaked, e=2Eg=2E the phrases are currently rather long), covers a sufficient amount of cases (feel free to respond if you see a missing case), free of contradictions (likewise) and mostly in line with current practice:

[start]

@c: There is no opposition or such, so no versus, let's not start with polarisation=2E

20=2E4=2E5 Snippets, phases and patches

Snippets, phases and patches at times serve overlapping purposes=2E To decide between the three, there are several considerations to keep in mind:

  • Patches must not be used to remove non-free files, because a patch by construction contains the non-free file itself so the patch would be non-free, which would not be acceptable to Guix=2E Likewise, patches should not be used to remove bundled libraries, to avoid large space usage, but this is not an absolute rule unlike as for non-free files=2E
  • Snippets are often convenient for removing unwanted files such as bundled libraries, non-free sources and binaries=2E It is technically also possible to use phases for this, albeit slightly less convenient at times=2E However, phases must not be used to remove non-free sources, as then the output of "guix build --source" would still contain the non-free sources, which is incompatible with Guix' stance on free software=2E Likewise, phases should not be used to remove binaries; however, this is not strictly forbidden=2E
  • Snippets must not embed store items in the source, as this is incompatible with cross-compilation and prevents effectively sharing the source code produced with "guix build --source" with people using non-Guix systems=2E
  • In principle, you can apply a patch from a phase=2E However, this causes the result of "guix build --source" to not correspond to the actual source code anymore (i=2Ee=2E, it doesn't act as corresponding source anymore), so consider this a last resort for situations such as avoiding causing a world-rebuild for a patch fixing a target-specific bug by making the patching conditional upon target-foo?=2E If you apply a patch from a phase, make sure that the patch appears in the inputs or native-inputs, such that "guix build --source=3Dall" will include the patch=2E
    @c this relaxes the old rule a little
  • Ideally, the source derived from the origin should be usable for building on any system that the upstream package supports (even if Guix does not support that system), as a courtesy to the people that the source code is shared with=2E However, this is not an absolute rule, most important is that it is usable on Guix and it is allowed to neglect this recommendation when it is tricky to follow or a large amount of work=2E For example, if some Windows-specific source files are non-free, you can simply remove them without replacing them by a free implementation, even if that would reduce the set of systems the package can be built on=2E

Sometimes, there remains more than one acceptable way to accomplish the goal=2E In that case, choose whatever appears to be most convenient=2E

[end]

(Comments welcome, and required to go forward)

Greetings,
Maxime

=20
------GM0K2BKD1QE1N06AYDGMFSNWIQWMTW--