-
Notifications
You must be signed in to change notification settings - Fork 3
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
Stop targeting JDK 8 #187
Stop targeting JDK 8 #187
Conversation
@@ -1,12 +1,12 @@ | |||
language: java | |||
matrix: | |||
include: | |||
- jdk: openjdk8 |
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.
Then we should also bump version.jdk
, right?
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.
@ferdinand-swoboda good point. Without this the PR would only about not supporting JDK 8 for building, but indeed my intention was to also raise the baseline. Pushed a commit.
pom.xml
Outdated
@@ -100,7 +100,7 @@ | |||
<version.error-prone-javac>9+181-r4173-1</version.error-prone-javac> | |||
<version.guava-beta-checker>1.0</version.guava-beta-checker> | |||
<version.immutables>2.8.8</version.immutables> | |||
<version.jdk>1.8</version.jdk> | |||
<version.jdk>1.11</version.jdk> |
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.
Shouldn't it be: <version.jdk>11</version.jdk>
?
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 need a coffee.
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.
(And this also shows we should prioritize #4 or some other solution that allows us to verify most/all changes in this repo.)
There are 2 hits for "JDK 8". These are comments indicating some simplification might be possible now. |
.travis.yml
Outdated
- jdk: openjdk11 | ||
# This is the primary target platform. In this build perform a SonarQube | ||
# analysis. | ||
script: ./mvnw install sonar:sonar | ||
- jdk: openjdk17 |
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.
In order to build with JDK 16+ some changes to the error-prone profile are required; at least when I mvn clean verify
Jolo. -> Pushed some changes
pom.xml
Outdated
--> -XepAllErrorsAsWarnings <!-- | ||
We want to enable almost all Error | ||
encountered. --> | ||
<arg>-XepAllErrorsAsWarnings</arg> |
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.
For some reason this causes error: invalid flag: -XepAllErrorsAsWarnings
on Jolo. 😕
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.
In PSM we don't wrap every flag in <arg>..</arg>
so I tried it there and got the same error message as you mention here.
I found a message posted by @Stephan202 here with a small summary:
All -Xplugin:ErrorProne arguments must be specified inside the same . So on JDK 8 one either has to put them all on one line (like here) or hide the newlines inside XML comments, like so.
So I'd say that reverting the <arg>
changes should fix the issue 😄.
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.
Indeed. More generally: where possible we should match the setup of the Picnic-internal Maven parent.
Pushed 2 commits that drop JDK 8 workarounds. There might be more outdated comments that we can address in a separate PR. |
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 clearly should have tested this PR in downstream projects before opening it. Please don't spend more time on this for now.
pom.xml
Outdated
<!-- Required to work with JDK 16+; | ||
see also https://errorprone.info/docs/installation#jdk-16. --> | ||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg> | ||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> | ||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> | ||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> | ||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> | ||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> | ||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> | ||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> | ||
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> | ||
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> |
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.
We should not do this, but instead define a .mvn/jvm.config
file; that yields more performant builds (#2786) and also avoids issues such as #106. More generally, we should port changes from internal builds that are already compatible with JDK 17; that could has already been carefully reviewed and tested.
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.
Fixed the link 😉
pom.xml
Outdated
--> -XepAllErrorsAsWarnings <!-- | ||
We want to enable almost all Error | ||
encountered. --> | ||
<arg>-XepAllErrorsAsWarnings</arg> |
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.
Indeed. More generally: where possible we should match the setup of the Picnic-internal Maven parent.
I filed #192 for JDK 17 support. We should keep this PR about dropping JDK 8 support. |
Kudos, SonarCloud Quality Gate passed!
|
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.
LGTM!
424c9fb
to
dc2d262
Compare
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.
Updated suggested commit message:
Target JDK 11 by default, drop JDK 8 support (#187)
pom.xml
Outdated
<path> | ||
<groupId>com.google.errorprone</groupId> | ||
<artifactId>error_prone_annotations</artifactId> | ||
<version>${version.error-prone}</version> | ||
</path> |
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.
Kudos, SonarCloud Quality Gate passed!
|
❗ This PR is currently stacked on top of #186. ❗
Suggested commit message: