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

build with jdk 19 and Gradle 7.6 #4466

Merged
merged 13 commits into from Dec 21, 2022
Merged

Conversation

jimexist
Copy link
Contributor

@jimexist jimexist commented Oct 5, 2022

Motivation:

we can enable jdk 19 builds and test out project loom features

Modifications:

  • include jdk 19 in the GitHub action build matrix

Result:

@jimexist
Copy link
Contributor Author

jimexist commented Oct 5, 2022

ideally if this passes then we can get rid of jdk 16 in the build

@codecov
Copy link

codecov bot commented Oct 5, 2022

Codecov Report

Base: 74.08% // Head: 74.04% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (9635988) compared to base (c34c6b5).
Patch has no changes to coverable lines.

❗ Current head 9635988 differs from pull request most recent head 6a7fd27. Consider uploading reports for the commit 6a7fd27 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4466      +/-   ##
============================================
- Coverage     74.08%   74.04%   -0.04%     
+ Complexity    18185    18165      -20     
============================================
  Files          1537     1536       -1     
  Lines         67469    67379      -90     
  Branches       8537     8520      -17     
============================================
- Hits          49987    49894      -93     
+ Misses        13419    13416       -3     
- Partials       4063     4069       +6     
Impacted Files Coverage Δ
...ria/internal/client/dns/DelegatingDnsResolver.java 81.25% <0.00%> (-18.75%) ⬇️
...armeria/internal/common/stream/SubscriberUtil.java 72.22% <0.00%> (-11.12%) ⬇️
...rmeria/internal/client/dns/CachingDnsResolver.java 78.37% <0.00%> (-8.11%) ⬇️
...corp/armeria/common/stream/AggregationSupport.java 76.00% <0.00%> (-6.00%) ⬇️
...a/internal/client/dns/SearchDomainDnsResolver.java 87.14% <0.00%> (-5.72%) ⬇️
.../main/java/com/linecorp/armeria/server/Server.java 76.71% <0.00%> (-5.14%) ⬇️
...com/linecorp/armeria/client/BlockingWebClient.java 29.62% <0.00%> (-3.71%) ⬇️
...ia/common/stream/ConcatPublisherStreamMessage.java 78.29% <0.00%> (-2.33%) ⬇️
...rmeria/common/stream/ConcatArrayStreamMessage.java 83.14% <0.00%> (-2.25%) ⬇️
...rp/armeria/common/stream/DefaultStreamMessage.java 88.42% <0.00%> (-2.11%) ⬇️
... and 46 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ikhoon
Copy link
Contributor

ikhoon commented Nov 29, 2022

Gradle 7.6 has been released. https://docs.gradle.org/7.6/release-notes.html
We may continue to upgrade to Java 19.

@ikhoon ikhoon added this to the 1.21.0 milestone Dec 16, 2022
@ikhoon
Copy link
Contributor

ikhoon commented Dec 16, 2022

I forget to set 1.21.0 milestone for this PR. PTAL. 🙇‍♂️

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Thanks a lot for taking care of this @ikhoon! 😄
Thanks, @jimexist for starting this issue. 😄

build-${{ matrix.java }}-${{ runner.os }}-${{ secrets.CACHE_VERSION }}-
build-${{ matrix.java }}-${{ runner.os }}-
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
Copy link
Member

Choose a reason for hiding this comment

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

So it works now? 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked the GitHub Actions log and it does not seem to work.
Both the original one and the new one also didn't work on GitHub-managed hosts.

  • Original

image

  • gradle-build-actions

image

Copy link
Contributor

Choose a reason for hiding this comment

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

I found that the cache occasionally works with the old configuration.
Anyway, it does not affect our self-hosted machines that cache by default in the local storage. Let me keep gradle-build-action configuration and check the caching result for multiple builds.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to work now. There might be some complicate conditions to use cache.
image

build.gradle Outdated
@@ -70,6 +70,13 @@ allprojects {
jvmArgs '-XX:+HeapDumpOnOutOfMemoryError'
jvmArgs "-XX:HeapDumpPath=${rootProject.buildDir}"

// The default value of the java.security.manager system property is changed to disallow in Java 18.
Copy link
Member

Choose a reason for hiding this comment

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

Let's also add why we also need this in 17.

project.dependencies.add(shadedTestRuntime.name, dep)
// Do not use `project.dependencies.add(name, dep)` that discards the classifier of
// a dependency. See https://github.com/gradle/gradle/issues/23096
project.configurations.getByName(shadedTestRuntime.name).dependencies.add(dep)
Copy link
Member

Choose a reason for hiding this comment

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

Please also send a PR to line/gradle-scripts. 😉

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

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

Left some minor nits but looks good! Thanks @ikhoon ! 🙇 👍 🚀

Comment on lines +74 to +75
// - https://openjdk.org/jeps/411
// - https://bugs.openjdk.org/browse/JDK-8270380
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL 🙇

@@ -1,11 +1,13 @@
def buildJdkVersion = 17
def buildJdkVersion = Integer.parseInt(JavaVersion.current().getMajorVersion())
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: I believe this is a slight change in behavior since the jvm version which gradle is run with will be used by default instead of 17.

I agree with this change though, since I dislike having the most recent jdk version fragmented across multiple files 🙇 Just wanted to note this change 👍

gradle/scripts/lib/kotlin.gradle Outdated Show resolved Hide resolved
@minwoox minwoox self-requested a review December 19, 2022 02:23
minwoox pushed a commit to line/gradle-scripts that referenced this pull request Dec 21, 2022
- Kotlin does not support Java 19 as the target bytecode. As the default version follows the current Java version, a specific target is necessary for release.
- Add a workaround that handles a regression in dependency in Gradle 7.6 See gradle/gradle#23096 for details.
The PR reviewed in line/armeria#4466
@minwoox
Copy link
Member

minwoox commented Dec 21, 2022

line/gradle-scripts#139 is merged. 😉

subrepo:
  subdir:   "gradle/scripts"
  merged:   "2844de2af"
upstream:
  origin:   "https://github.com/line/gradle-scripts"
  branch:   "master"
  commit:   "2844de2af"
git-subrepo:
  version:  "0.4.5"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "dbb99be"
@ikhoon
Copy link
Contributor

ikhoon commented Dec 21, 2022

It is likely that the flaky Scala build is fixed.
We need to check it more but it looks promising. 😆

@jrhee17
Copy link
Contributor

jrhee17 commented Dec 21, 2022

Yay 😎 Procrastinating paid off 🥳

@ikhoon
Copy link
Contributor

ikhoon commented Dec 21, 2022

Any comments on this @minwoox?

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Thanks!!!! 🎉 🎉 🎉

@ikhoon ikhoon changed the title build with jdk 19 build with jdk 19 and Gradle 7.6 Dec 21, 2022
@ikhoon ikhoon merged commit 2ff218b into line:master Dec 21, 2022
@ikhoon
Copy link
Contributor

ikhoon commented Dec 21, 2022

Thanks again @jimexist for the initial work of this PR. 🙇‍♂️🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build and run with JDK 19 and possible enable loom (preview required) as well
4 participants