-
Notifications
You must be signed in to change notification settings - Fork 149
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
time value not valid per SPDX spec or validator
#918
Comments
Is it possible to bump this? Your SPDX tool is outputting non-conformant SPDX files. Seems an important bug to fix. |
When generating a Bill Of Materials, the SPDX specification for the [Created field] expect the date with format `YYYY-MM-DDThh:mm:ssZ`. The current implementation does the transformation to express the current time in UTC, but this has the side effect to add `+00:00` at the end of the date when formatting it. The resulting date `YYYY-MM-DDThh:mm:ss+00:00Z` does not match the SPDX specification and validation using the SPDX online tools fail because of this invalid format. Make sure to remove `tzinfo` from the date so that time zone information is not output when formatting the date, so that we can safely append a `Z` at the end to indicate UTC time-zone. Other formats for the time-zone (e.g. `+00:00`) is not allowed by the SPDX specification. Fixes: fsfe#918 [Created field]: https://spdx.github.io/spdx-spec/v2.3/document-creation-information/#69-created-field
When generating a Bill Of Materials, the SPDX specification for the [Created field] expect the date with format `YYYY-MM-DDThh:mm:ssZ`. The current implementation does the transformation to express the current time in UTC, but this has the side effect to add `+00:00` at the end of the date when formatting it. The resulting date `YYYY-MM-DDThh:mm:ss+00:00Z` does not match the SPDX specification and validation using the SPDX online tools fail because of this invalid format. Make sure to remove `tzinfo` from the date so that time zone information is not output when formatting the date, so that we can safely append a `Z` at the end to indicate UTC time-zone. Other formats for the time-zone (e.g. `+00:00`) is not allowed by the SPDX specification. Fixes: fsfe#918 [Created field]: https://spdx.github.io/spdx-spec/v2.3/document-creation-information/#69-created-field Signed-off-by: Romain Tartière <romain@blogreen.org>
Found the cause of this bug. Thanks for reporting @KlfJoat With |
The time value output by
reuse spdx
is wrong.reuse --version
=reuse 3.0.1
Steps to reproduce
reuse lint
passes as okay.reuse spdx > myfile
myfile
to have the same time value as me:Created: 2024-02-22T01:21:17+00:00Z
myfile
Expected result
A pop-up saying...
Actual result
An error pop-up with the following message...
ISO 8601 conformance
For one, I'm pretty sure that using
+00:00Z
is not allowed in ISO 8601. IIRC either+00:00
(or acceptable variants like+0000
&+00
) is allowed ORZ
is allowed, but not both. So that's one bug for sure.Spec conformance
Per the spec, only
Z
is allowed, not a timeshift offset.The text was updated successfully, but these errors were encountered: