[Gradle] Don't use full multi-threading, SBOMs can be completely wrong #1376
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using the feature
GRADLE_MULTI_THREADED
on large projects, the output of the dependency-tree can be mangled and there is no guarantee the same SBOM is generated between multiple runs!To fix this, I added the parameter '--no-parallel' to the Gradle-command, which in my tests didn't show a significant difference in duration. The output SBOM however was consistent every time, although in one of the projects there is a difference with the non-multithreaded version in the versions of dependencies!
Unfortunately this is caused by Gradle itself -- manual inspection of the outputs of all commands shows, that Gradle is actually reporting different versions of dependencies for some modules in the project! I assume this is something similar to Maven: because there can only be 1 version of a JAR in the classpath, it gets corrected to specific version (by whatever kind of resolution). This would mean, that the current non-multithreaded version would actually be reporting false dependencies in some cases...