--- Begin Message ---
Subject: |
[PATCH 0/2] Checking the 'license' field of packages |
Date: |
Sat, 1 Oct 2022 18:19:11 +0200 |
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
--- End Message ---
--- Begin Message ---
Subject: |
Heads-up: Run “make clean-go && make” |
Date: |
Mon, 10 Oct 2022 11:20:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) |
Hi,
Ludovic Courtès <ludo@gnu.org> skribis:
> licenses: Let 'license?' expand to #t in trivial cases.
> packages: Raise an exception for invalid 'license' values.
I pushed these two patches as b6bc4c109b807c646e99ec40360e681122d85b2c
(see <https://issues.guix.gnu.org/58231> for context).
Now we all need to run “make clean-go && make”!
Thank you for your understanding. :-)
Ludo’.
--- End Message ---