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

tools-python and tools-java behave differently #68

Open
yakuri opened this issue Jan 23, 2025 · 3 comments
Open

tools-python and tools-java behave differently #68

yakuri opened this issue Jan 23, 2025 · 3 comments

Comments

@yakuri
Copy link

yakuri commented Jan 23, 2025

Greetings, I used the attached tag:value SBOM and found that VALIDATE was NG in tools-python and VALIDATE was OK in tools-java.
Which VALIDATE is correct?

test-sbom.spdx.txt

What is unique about this SBOM is the presence of “FilesAnalyzed: false” on line 28 in the Relationships block.

> java -jar tools-java-2.0.0-RC1-jar-with-dependencies.jar Verify test-sbom.spdx
This SPDX Document is valid.

> pip install spdx-tools==0.8.3
> pyspdxtools -i test-sbom.spdx
Generating LALR tables
ERROR:root:There have been issues while parsing the provided document:
Element Package is not the current element in scope, probably the expected tag to start the element (PackageName) is missing. Line: 28

Sincerely,

@armintaenzertng
Copy link

Hi @yakuri, the SPDX spec states:

Annotations and relationships for the package may appear after the package information before any file information.

That is, your relationships should appear after any information about the package.
The FilesAnalyzed: false in line 28 is part of the package but appears after the relationships. Move it 3 lines up so that it appears before the relationships and all should be fine.

@yakuri
Copy link
Author

yakuri commented Jan 24, 2025

Hi @armintaenzertng,

Thanks for your reply.
Am I correct in understanding that it is not correct to display “This SPDX Document is valid.” when verify test-sbom.spdx.txt in tools-java?

@goneall
Copy link
Member

goneall commented Jan 25, 2025

Moving this issue to the tag/value store repository.

@goneall goneall transferred this issue from spdx/tools-java Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants