scripts: check every operand of an OR license expression #2307

pull FlashWayne wants to merge 1 commits into bitcoin:master from FlashWayne:buildtable-license-or changing 1 files +5 −3
  1. FlashWayne commented at 12:06 PM on September 25, 2026: none

    The License / License-Code check in buildtable.pl does $val =~ s/ OR .*//, so only the first license in an SPDX OR expression is checked. That has two effects:

    • License: GPL-2.0 OR MIT fails with "Unacceptable license GPL-2.0", although BIP-3 allows any expression that is "L" or equivalent to "L OR E" for an acceptable L. Order shouldn't matter.
    • License: MIT OR Bogus-License passes, because the second identifier is never looked at.

    This splits the value on OR, requires every operand to be in %DefinedLicenses, and requires at least one operand to be acceptable (or grandfathered PD / CC-BY-SA-4.0 for the BIPs listed). Results with a temporarily edited header on bip-0341:

    License before after
    BSD-3-Clause ok ok
    GPL-2.0 OR MIT Unacceptable license GPL-2.0 ok
    MIT OR Bogus-License ok Undefined license Bogus-License
    GPL-2.0 OR AGPL-3.0 Unacceptable Unacceptable
    CC0-1.0 OR MIT OR Apache-2.0 ok ok

    The script still runs cleanly over the whole repo, and diffcheck.sh has no changes.

  2. scripts: check every operand of an OR license expression
    buildtable.pl dropped everything after the first " OR " in License and
    License-Code, so only the first license was looked at. "GPL-2.0 OR MIT"
    was rejected as unacceptable even though BIP-3 accepts any expression
    equivalent to "L OR E" with an acceptable L, and "MIT OR Foo" passed
    without Foo being a known license.
    
    Require every operand to be a defined license, and at least one of them
    to be acceptable (or grandfathered for that BIP).
    e66162da68
  3. in scripts/buildtable.pl:198 in e66162da68
     191 | @@ -192,10 +192,12 @@
     192 |  			$layer = $val;
     193 |  		} elsif ($field =~ /^License(?:\-Code)?$/) {
     194 |  			die "License continued across lines in $fn, use SPDX expression (... OR $val) instead" if $continuation;
     195 | -			$val =~ s/ OR .*//;
     196 | -			die "Undefined license $val in $fn" unless exists $DefinedLicenses{$val};
     197 | +			my @licenses = split / OR /, $val;
     198 | +			for my $license (@licenses) {
     199 | +				die "Undefined license $license in $fn" unless exists $DefinedLicenses{$license};
     200 | +			}
    


    murchandamus commented at 2:13 PM on September 25, 2026:

    This does not match the requirements of BIP3. BIPs must be made available under at least one acceptable license, but may be licensed additionally under other terms. We prefer that the acceptable license is positioned first, hence the existing check.

  4. murchandamus added the label CI on Sep 25, 2026
  5. murchandamus commented at 2:14 PM on September 25, 2026: member

    Thanks for the submission, but I don’t think this change is necessary.

  6. murchandamus closed this on Sep 25, 2026

  7. FlashWayne deleted the branch on Sep 25, 2026
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-27 08:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me