all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#58231] [PATCH 0/2] Checking the 'license' field of packages
@ 2022-10-01 16:19 Ludovic Courtès
  2022-10-01 16:20 ` [bug#58231] [PATCH 1/2] licenses: Let 'license?' expand to #t in trivial cases Ludovic Courtès
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Ludovic Courtès @ 2022-10-01 16:19 UTC (permalink / raw)
  To: 58231; +Cc: Ludovic Courtès

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





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-10-15 22:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-01 16:19 [bug#58231] [PATCH 0/2] Checking the 'license' field of packages Ludovic Courtès
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

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.