Subject: bug#58231: closed (Heads-up: Run “makeclean-go && make”)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 10 Oct 2022 09:21:02 +0000

Your bug report

#58231: [PATCH 0/2] Checking the 'license' field of packages

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
58231: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58231
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Heads-up: Run “make clean-go && make”
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Cc: Guix-devel <[email-masked]>
Date: Mon, 10 Oct 2022 11:20:30 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Ludovic Courtès <[email-masked]> 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’.

Subject: [PATCH 0/2] Checking the 'license' field of packages
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Cc: Ludovic Courtès <[email-masked]>
Date: Sat, 1 Oct 2022 18:19:11 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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