Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alternative signee to GPL licenses #2632

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

szepeviktor
Copy link
Contributor

@xsuchy
Copy link
Collaborator

xsuchy commented Dec 16, 2024

This is good start. It fact, it seems to be correct. But for some reason the test fails. I tracked it to the first alt, but I could not find what is the problem there. It seems correct to me, but the test thinks otherwise. :(

@swinslow
Copy link
Member

Thank you @szepeviktor and @xsuchy! I'll take a look and see if I can figure anything out from the failing tests.

@swinslow
Copy link
Member

I think the tests here are failing because of some combination of issues in the license matcher involving:

  1. the spacing attribute for <alt> tags (see the XML schema line 262); and
  2. the lt&; / gt&; entities being used for the < / > characters in the signature block.

I believe the reference to line 70 in the test error message is because the above failures to match are causing the entire "END OF TERMS AND CONDITIONS" + Appendix <optional> block to fail to match. (Line 70 is the "END OF TERMS AND CONDITIONS" line in the test text file.)

From my understanding of the spacing attribute, I would expect that putting spacing="before" within both of the <alt> tags in this line ought to make the match work... but it seems to still be failing.

Removing the &lt; / &gt; entities from the XML, and the < / > characters from the test text, makes it pass successfully. But that doesn't seem to be the right answer either.

@goneall I'm afraid we may need your help on this one. I'm not certain whether I'm misunderstanding something in how the spacing attribute works; or whether this might be a bug in the license matcher.

In any case, I'm going to move this PR to 3.27.0. Once we get this issue sorted out, we can replicate this to the other L/A/GPL licenses as well. Thank you @szepeviktor and @xsuchy for your help on this so far!

@goneall
Copy link
Member

goneall commented Dec 31, 2024

@swinslow - I'll take a look this week. It could also be a bug in the license compare software.

@goneall
Copy link
Member

goneall commented Dec 31, 2024

I've narrowed down the problem - but a solution would be somewhat difficult.

The problem is with the < and > characters before and after the match. It looks like the tokenizer is not splitting these characters out as separate characters. Normally, to solve this we would just move the characters into the match and alt text (e.g. <alt match="<(Ty Coon|Moe Ghoul)>" name="sample-signee">&lt;Ty Coon&gt;</alt>). However, the < and > characters are special characters in our original template language and can't be used in the match pattern.

I can think of two possible solutions - none of them easy:

  1. Drop support for the legacy template and require all the tools folks to use the now supported XML format.
  2. Change the license matcher to tokenize the < and > characters to match the original

I've added an issue to the license list publisher for 2: spdx/Spdx-Java-Library#269

It may be a while before I get to working on 2 - likely the easier solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants