-
Notifications
You must be signed in to change notification settings - Fork 134
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
baseline-reproducibility validates that sourceCompatibility is set explicitly #1574
Conversation
Generate changelog in
|
getProject(), | ||
getProject().getRootProject().relativePath(getProject().getBuildFile()), | ||
JavaVersion.current(), | ||
getPath())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I broke tracing-java and tried it out, error message looks like this:
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':tracing-jaxrs:checkExplicitSourceCompatibility'.
> project ':tracing-jaxrs' must set sourceCompatibility explicitly in 'tracing-jaxrs/build.gradle', otherwise compilation will not be reproducible but instead depends on the Java version that Gradle is currently running with (11). To auto-fix, run
./gradlew :tracing-jaxrs:checkExplicitSourceCompatibility --fix
This will automatically add a suggested line (you may need to adjust the number, e.g. to '1.8' for maximum compatibility).
...e-java/src/main/groovy/com/palantir/baseline/tasks/CheckExplicitSourceCompatibilityTask.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on having sourceCompat set explicitly.
Looks good to me! Feel free to merge after fixing the nit 🚀
…ks/CheckExplicitSourceCompatibilityTask.java Co-authored-by: David Schlosnagle <schlosna@gmail.com>
Released 3.58.0 |
How does this work with https://docs.gradle.org/current/userguide/toolchains.html ? Would I have to specify source compat even if I specify my jvm? |
Currently yes - although as soon as they expose a way to extract the toolchain stuff we can update this plugin https://github.com/palantir/gradle-baseline/pull/1574/files#diff-14d5052a9b7ac4fa7663ebf9a728428314e468cc84e6a420f0de25aacaebbc57R81-R82 |
Before this PR
To get a new JVM rolled out fleet wide, we blast out excavators which just dial up the JVM used at CI time. This has been pretty much fine so far as most projects set
sourceCompatibility
explicitly, but nothing actually validates this right now.Occasionally, this manifests as a question in
#dev-foundry-infra
about the product-dependencies.lock file differing locally on CI (because on CI it's inferring java 15) and locally it's inferring whatever JVM the dev is using, often 11.After this PR
==COMMIT_MSG==
baseline-reproducibility validates that sourceCompatibility is set explicitly using a new
checkExplicitSourceCompatibility
task.==COMMIT_MSG==
Possible downsides?