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

Clearing Go main module version makes creating a CycloneDX 1.3 JSON document difficult #959

Closed
ryanmoran opened this issue Apr 13, 2022 · 2 comments · Fixed by #981
Closed
Assignees
Labels
bug Something isn't working

Comments

@ryanmoran
Copy link
Contributor

One of the minor changes between CycloneDX JSON 1.3 and 1.4 is that the requirement of the version field for a component has been removed.

Additionally, there was a recent set of changes that resulted in the decision to convert a Go main modules' version from the value reported by Go, (devel), to an empty string.

Unfortunately, we are now in a state where generating a CycloneDX JSON 1.3 document from the latest codebase means we need to reverse engineer whether the package we are looking at is the main module by looking for the presence of build settings. This feels like a kludge.

Would it be possible to consider a value other than empty string in this case? Maybe latest?

@spiffcs
Copy link
Contributor

spiffcs commented Apr 27, 2022

@jonasagx I tagged you on this issue since I saw you had done a lot of deep work on #894

@luhring
Copy link
Contributor

luhring commented May 1, 2022

Hi @ryanmoran, I agree, we should be explicit about whether a given package is a main module. We're tracking that in #908:

This output doesn't explicitly communicate to users [...] whether a given package is a main module or not

IMHO, I think Syft should be explicit about whether a module is the main module, rather than communicate this through a particular version value.


Re: the removal of the version field, it looks like the CycloneDX library has set the version field to omitempty, so it disappears when we use an empty string value.

At the moment, I can't think of a better solution here than to put back the (devel) value in these cases (meaning, read this value "as is" from the buildinfo section).

@luhring luhring assigned luhring and unassigned jonasagx May 1, 2022
@luhring luhring added bug Something isn't working and removed enhancement New feature or request labels May 1, 2022
@jonasagx jonasagx assigned jonasagx and unassigned luhring May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants