unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Guix-devel <guix-devel@gnu.org>
Subject: v2: A proposal of a consistent set of clear rules and guidelines involving snippets, phases and patches.
Date: Fri, 5 Aug 2022 15:59:14 +0200	[thread overview]
Message-ID: <98da36a2-d0cc-77da-77bf-6984253131ac@telenet.be> (raw)
In-Reply-To: <c4c0a071-2e03-d4d6-6718-05424d21d146@telenet.be>


[-- Attachment #1.1.1.1: Type: text/plain, Size: 5177 bytes --]

Here's a v2. I've changed the structure to something close to what 
Julien proposed, it looks a lot better now to me!

The (^) should probably be tested before the final version.

I don't think the list of 'guiding principles' is worded well, probably 
needs more work.

[something I wrote previously]

>> Feel free to try to separate the things, but going previous 
>> discussions, many tings are important, and they appear all to be 
>> inseparable. 
Well seems like I was wrong, it splits nicely in three subsections!

> I’d suggest starting with a patch against that section to address one
> specific point that you think is the most pressing one.  From there we
> can continue the discussion.
As written in another response, I don't really have an opinion on what's 
more pressing than another. I have written three 'points', but we don't 
have to discuss them all at once, maybe first 20.4.5.2? That one sounds 
relatively simple to me.

--- [start]

20.4.5 Snippets, phases and patches.

Snippets, phases and patches at times serve overlapping purposes. To 
decide between the three, there are a few guiding principles:

  * In principle, Guix only has free software; when the upstream source
    contains some non-free software, it has to be removed such that
    ‘guix build --source’ returns the "freed" source code rather than
    the unmodified upstream source (see: 28.4.1 Software Freedom).
  * The source of the package needs to correspond to what is actually
    built (i.e., act as the corresponding source), to fulfill our
    ethical and legal obligations.
  * It is convenient for the source derived from an origin to build on
    any system that the upstream package supports.
  * The source needs to actually work, not only on your Guix system but
    also for other systems; this requires some care for substitutions
    involving store items and other architecture-specific changes.
  * Sometimes, there is more than one way to do it. Let's go for the
    simplest one. Sometimes, which tool is the simplest, is subjective,
    that's fine too.

To make things more concrete and to resolve conflicts between the 
principles, a few cases have been worked out:

20.4.5.1 Removing non-free software.

Non-free software has to be removed in a snippet; the reason is that a 
patch or phase will not work.

For a patch, the problem is that a patch removing a non-free file 
automatically contains the non-free file (^), and we do not want 
anything non-free to appear in Guix even if only in its patches.

For a phase, the problem is that phases do not influence the result of 
‘guix build --source’.

(^) It has been noted that git patches support removing files without 
including the file in the patch in <insert link to Philip McGrath's 
e-mail>. If it is verified that the 'patch' utility supports such 
patches, this method can be used and this policy adjusted appropriately.

20.4.5.2 Removing bundled libraries.

Bundled libraries should not be removed with a patch, because then the 
patch would contain the full bundled library, which can be large. They 
can be removed either in a snippet or a phase, often using the procedure 
'delete-file-recursively'. There are a few benefits for snippets here:

When using snippets, the bundled library does not occur in the source 
returned by ‘guix build --source’, so users and reviewers do not have to 
worry about whether the bundled library contains malware, whether it is 
non-free, if it contains pre-compiled binaries ... There are also less 
licensing concerns: if the bundled libraries are removed, it becomes 
less likely that the licensing conditions apply to people sharing the 
source returned by ‘guix build --source’, especially if the bundled 
library is not actually used on Guix systems. (*)

As such, snippets are recommended here.

(*) This is _not_ a claim that you can simply ignore the licenses of 
libraries when they are unbundled and replaced by Guix packages -- there 
are less concerns, not none.

20.4.5.3 Fixing technical issues (compilation errors, test failures, 
other bugs ...)

Usually, a bug fix comes in the form of a patch copied from upstream or 
another distribution. In that case, simply adding the patch to the 
'patches' field is the most convenient and usually does not cause any 
problems; there is no need to rewrite it as a snippet or a phase.

If no ready-made patch already exists, then choosing between a patch or 
a snippet is a matter of convenience. However, there are two things to 
keep in mind:

First, when the fix is not Guix-specific, it is strongly desired to 
upstream the fix to avoid the additional maintenance cost to Guix. As 
upstreams cannot accept a snippet, writing a patch can be a more 
efficient use of time. Secondly, if the fix of a technical issue embeds 
a store file name, then it has to be a phase. Otherwise, if a store file 
name was embedded in the source, the result of 'guix build --source' 
would be unusable on non-Guix systems and likely also unusable on Guix 
systems of another architecture.


[-- Attachment #1.1.1.2: Type: text/html, Size: 6186 bytes --]

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  parent reply	other threads:[~2022-08-05 13:59 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25  3:17 A proposal of a consistent set of clear rules and guidelines involving snippets, phases and patches Maxime Devos
2022-07-25  5:21 ` Julien Lepiller
2022-07-25 11:18   ` Maxime Devos
2022-07-25 11:37     ` Julien Lepiller
2022-08-04  8:51 ` Ludovic Courtès
2022-08-05  3:23 ` Philip McGrath
2022-08-05  8:13   ` Maxime Devos
2022-08-05  3:38 ` Philip McGrath
2022-08-05  8:09   ` Maxime Devos
2022-08-05 10:18 ` Maxime Devos
2022-08-05 13:59 ` Maxime Devos [this message]
2022-08-06  6:55   ` [PATCH] doc: Update contribution guidelines on patches, etc Liliana Marie Prikler
2022-08-06  6:55     ` [PATCH v2] " Liliana Marie Prikler
2022-09-02 13:12       ` Ludovic Courtès
2022-09-02 18:05         ` Maxime Devos
2022-09-05  9:47           ` Ludovic Courtès
2022-09-05 13:12             ` Maxime Devos
2022-09-05 16:05               ` Maxime Devos
2022-08-09 16:45     ` [PATCH] " Maxime Devos
2022-08-09 17:05       ` Liliana Marie Prikler
2022-08-09 18:19         ` Maxime Devos
2022-08-09 19:08           ` Liliana Marie Prikler
2022-08-09 20:30             ` Maxime Devos
2022-08-10  4:25               ` Liliana Marie Prikler
2022-08-09 20:40             ` Maxime Devos
2022-08-08 21:51   ` v2: A proposal of a consistent set of clear rules and guidelines involving snippets, phases and patches Andreas Enge
2022-08-09 15:06     ` Maxime Devos
2022-08-09 17:10       ` Andreas Enge
2022-09-05 13:03     ` Maxime Devos
2022-09-07 12:17       ` Andreas Enge
2022-09-07 18:08         ` Maxime Devos
2022-08-09 18:58   ` david larsson
2022-08-09 20:53     ` Maxime Devos
2022-08-10 11:23       ` david larsson
2022-08-05 16:59 ` blake
2022-08-09 16:30   ` Maxime Devos
2022-09-05 14:06     ` Maxime Devos
2022-08-10  6:10   ` blake
2022-08-10  9:06     ` Maxime Devos
2022-08-10 10:33     ` blake
2022-08-10 10:44       ` Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98da36a2-d0cc-77da-77bf-6984253131ac@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).