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

Stop targeting JDK 8 #187

Merged
merged 11 commits into from
Apr 16, 2022
Merged

Stop targeting JDK 8 #187

merged 11 commits into from
Apr 16, 2022

Conversation

Stephan202
Copy link
Member

@Stephan202 Stephan202 commented Jan 4, 2022

❗ This PR is currently stacked on top of #186. ❗

Suggested commit message:

Stop targeting JDK 8 (#187)

@Stephan202 Stephan202 added this to the 0.0.4 milestone Jan 4, 2022
@@ -1,12 +1,12 @@
language: java
matrix:
include:
- jdk: openjdk8
Copy link
Contributor

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?

Copy link
Member Author

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>
Copy link
Member

@rickie rickie Jan 4, 2022

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> ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I need a coffee.

Copy link
Member Author

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.)

@ferdinand-swoboda
Copy link
Contributor

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
Copy link
Contributor

@ferdinand-swoboda ferdinand-swoboda Jan 4, 2022

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>
Copy link
Contributor

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. 😕

Copy link
Member

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 😄.

Copy link
Member Author

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.

@ferdinand-swoboda
Copy link
Contributor

There are 2 hits for "JDK 8". These are comments indicating some simplification might be possible now.

Pushed 2 commits that drop JDK 8 workarounds. There might be more outdated comments that we can address in a separate PR.

@rickie rickie self-requested a review January 5, 2022 08:05
Copy link
Member Author

@Stephan202 Stephan202 left a 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
Comment on lines 1035 to 1046
<!-- 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>
Copy link
Member Author

@Stephan202 Stephan202 Jan 5, 2022

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.

Copy link
Member

@rickie rickie Jan 6, 2022

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>
Copy link
Member Author

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.

@ferdinand-swoboda ferdinand-swoboda mentioned this pull request Jan 14, 2022
@ferdinand-swoboda
Copy link
Contributor

ferdinand-swoboda commented Jan 14, 2022

I filed #192 for JDK 17 support. We should keep this PR about dropping JDK 8 support.

@ferdinand-swoboda ferdinand-swoboda changed the title Stop targeting JDK 8, add support for JDK 17 Stop targeting JDK 8 Jan 14, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ferdinand-swoboda ferdinand-swoboda mentioned this pull request Jan 14, 2022
Base automatically changed from sschroevers/drop-lint-maven-plugin to master April 16, 2022 11:32
Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

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

LGTM!

@Stephan202 Stephan202 force-pushed the sschroevers/raise-build-baseline branch from 424c9fb to dc2d262 Compare April 16, 2022 11:35
Copy link
Member Author

@Stephan202 Stephan202 left a 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
Comment on lines 900 to 904
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>${version.error-prone}</version>
</path>
Copy link
Member Author

Choose a reason for hiding this comment

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

Just tested against reactive-support: it seems we can omit this. (Perhaps because I just merged #197, which does introduce an Error Prone/Guava dependency convergence error, but we'll fix that in #175.)

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Stephan202 Stephan202 merged commit 7fce171 into master Apr 16, 2022
@Stephan202 Stephan202 deleted the sschroevers/raise-build-baseline branch April 16, 2022 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants