-
Notifications
You must be signed in to change notification settings - Fork 152
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
reuse spdx: also output the full SPDX-License-Identifier
#586
Comments
I think this is just a straight mis-parse. I'm not 100% sure what the spdx file should look like, but I'm pretty sure that Would be nice to have a "round-trip" test - make sure that the parsed license info turns back into an identical spdx-license-identifier line as the input, though I don't remember if there's any license-expression-formatting in the codebase yet. |
Looks like the relevant code is either https://github.com/fsfe/reuse-tool/blob/master/src/reuse/_util.py#L260 or called by it |
In the SPDX community it is understood that:
would equate to:
I would say, it should simply directly translate |
Oh, so it's AND by default, not OR, that makes sense. (Think my tool or the Rust spdx-expression crate has a bug...) Yeah, the reuse tool is definitely doing too much work here and losing the details. (I think it's parsing further so it can check for the presence of the right license files, but that code probably shouldn't be used when generating spdx output) |
Yes, we're reinventing the wheel here and should instead use standard libs for that. See #394 |
Also got bitten by this when trying to integrate REUSE with Rust. The Rust standard license is
Would this something that would be accepted while we wait for the next generation of output? |
So, I looked into this issue more, and it turns out the behavior of REUSE adheres to the SPDX 2.1 specification:
Still, SPDX assumes someone would also populate reuse-tool/src/reuse/report.py Lines 148 to 150 in 2b0d470
The options I could see are:
|
I'm not exactly sure anymore why the behaviour is what it is. For LicenseInfoInFile, I think it's reasonable to do the following: # SPDX-License-Identifier: MIT OR 0BSD
# SPDX-License-Identifier: Apache-2.0 ->
I think The concluded licence in the above case would probably be |
Opened a PR populating |
That would indeed be useful, and super thanks for the PR @pietroalbini. There is just one caveat I would like us to address – namely that (even if perhaps the spec’s might not be super explicit about it; and if so, that is likely a bug in the spec), within SPDX it is understood that:
As such, if we implement
see:
https://spdx.github.io/spdx-spec/v2.3/file-information/#85-concluded-license-field |
Sounds good @silverhook, thanks for the prompt feedback! I updated the PR accordingly. |
The output of
reuse spdx
has theLicenseInfoInFile
field.However, with this field it is not always possible to determine the original value of
SPDX-License-Identifier
For example if the input file has
The output will be
Which is not sufficient to determine the
SPDX-License-Identifier
This information would be useful when using the
reuse spdx
output as input of another script (for example to build a DEP5 file)The text was updated successfully, but these errors were encountered: