all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 58231@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#58231] [PATCH 0/2] Checking the 'license' field of packages
Date: Sat,  1 Oct 2022 18:19:11 +0200	[thread overview]
Message-ID: <20221001161911.8116-1-ludo@gnu.org> (raw)

Hello Guix!

We already have ‘guix lint -c license’ but that hasn’t prevented
us from occasionally having invalid licenses committed.  This patch
adds add a ‘sanitize’ option to the ‘license’ field of <package> to
detect invalid licenses early on, as zimoun suggested at:

  https://lists.gnu.org/archive/html/guix-devel/2022-09/msg00067.html

The funny part of this patch is that the license validation expands
to #t in the majority of cases, meaning that it comes without
run-time overhead (there is macro-expansion overhead, but I didn’t
measure it).  Kinda like static type checking, except that we can
only tell when a value is definitely a valid license and cannot
conclude in other cases.

Feedback welcome!

Thanks,
Ludo’.

Ludovic Courtès (2):
  licenses: Let 'license?' expand to #t in trivial cases.
  packages: Raise an exception for invalid 'license' values.

 guix/licenses.scm  | 58 +++++++++++++++++++++++++++++++++++++++-------
 guix/packages.scm  | 40 +++++++++++++++++++++++++++++++-
 tests/packages.scm |  7 ++++++
 3 files changed, 95 insertions(+), 10 deletions(-)


base-commit: d9b7982ba58fdea0934b60a81f507440a56c82ee
-- 
2.37.3





             reply	other threads:[~2022-10-01 16:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-01 16:19 Ludovic Courtès [this message]
2022-10-01 16:20 ` [bug#58231] [PATCH 1/2] licenses: Let 'license?' expand to #t in trivial cases Ludovic Courtès
2022-10-01 16:20   ` [bug#58231] [PATCH 2/2] packages: Raise an exception for invalid 'license' values Ludovic Courtès
2022-10-10 10:22     ` zimoun
2022-10-10 14:52       ` Ludovic Courtès
2022-10-15 22:12         ` Philip McGrath
2022-10-08 11:44 ` [bug#58231] [PATCH 0/2] Checking the 'license' field of packages pelzflorian (Florian Pelz)
2022-10-10  7:36   ` Ludovic Courtès
2022-10-10  7:51 ` Ludovic Courtès
2022-10-10  9:20 ` Heads-up: Run “make clean-go && make” Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=20221001161911.8116-1-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=58231@debbugs.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.