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

[Gradle] SBOM generation didn't work on Windows #1615

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

malice00
Copy link
Contributor

@malice00 malice00 commented Feb 3, 2025

cdxgen didn't generate SBOM for Gradle on Windows. This PR fixes this.

Since Windows also has a maximum character count in the CLI, this was also fixed. This unfortunately means that generating a gradle SBOM on Windows could be slower, because we potentially have to run multiple commands instead of just the one!

Signed-off-by: Roland Asmann <roland.asmann@gmail.com>
Signed-off-by: Roland Asmann <roland.asmann@gmail.com>
Signed-off-by: Roland Asmann <roland.asmann@gmail.com>
Signed-off-by: Roland Asmann <roland.asmann@gmail.com>
@malice00 malice00 requested a review from prabhu as a code owner February 3, 2025 01:26
Signed-off-by: Roland Asmann <roland.asmann@gmail.com>
}
}
allOutputs.push(result.stdout);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are we handling the case where stdout could be null?

"--build-cache",
"--console",
"plain",
"--no-parallel",
].concat(gradleArguments);
const maxCliArgsLength = isWin
? 7500 - gradleCommandLength - mainGradleArguments.join(" ").length - 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 7500 the maximum gradle supports on windows?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with creating a temporary powershell script and executing the same if it could yield good performance instead of batching.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't thought about that yet. Let me check that out, it might make this, and your question above, moot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just can't figure out how to get powershell to return the output... @prabhu, do you have any idea/experience with powershell?

@malice00 malice00 marked this pull request as draft February 3, 2025 19:16
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

Successfully merging this pull request may close these issues.

2 participants