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

feat: update gradle 8.7 and use Java 21 to build armeria #5644

Closed
wants to merge 5 commits into from

Conversation

Dogacel
Copy link
Contributor

@Dogacel Dogacel commented Apr 27, 2024

Motivation:

For some reason my IDE tried to use java-21, however it threw an error! When I looked into it, I realized gradle was kinda a old and decided to do the update.

Modifications:

The command I run to upgrade gradle is gradle wrapper --gradle-version 8.7.

  • Update gradle wrapper to 8.7
  • Update CI/CD pipelines to use Java 21
  • Update Proguard to 7.4+ for Java 21 support

Also did changes regarding the deprecation warnings:

WARNING: The following functionality has been deprecated and will be removed in the next major release of the Develocity Gradle plugin. For assistance with migration, see https://gradle.com/help/gradle-plugin-develocity-migration.
- The deprecated "gradleEnterprise.buildScan.tag" API has been replaced by "develocity.buildScan.tag"
- The deprecated "gradleEnterprise.buildScan.buildFinished" API has been replaced by "develocity.buildScan.buildFinished"
- The deprecated "gradleEnterprise.buildScan.background" API has been replaced by "develocity.buildScan.background"
- The deprecated "gradleEnterprise.server" API has been replaced by "develocity.server"
- The deprecated "gradleEnterprise.buildScan.publishIfAuthenticated" API has been replaced by "develocity.buildScan.publishing.onlyIf { it.authenticated }"
- The deprecated "gradleEnterprise.buildScan.uploadInBackground" API has been replaced by "develocity.buildScan.uploadInBackground"
- The deprecated "gradleEnterprise.buildScan.capture.taskInputFiles" API has been replaced by "develocity.buildScan.capture.fileFingerprints"
- The deprecated "gradleEnterprise.buildCache" API has been replaced by "develocity.buildCache"
- The deprecated "gradleEnterprise.buildScan.value" API has been replaced by "develocity.buildScan.value"
- The deprecated "gradleEnterprise.buildScan.link" API has been replaced by "develocity.buildScan.link"
- The deprecated "predictiveSelection.enabled" API has been replaced by "develocity.predictiveTestSelection.enabled"
- The "com.gradle.enterprise" plugin has been replaced by "com.gradle.develocity"
- The "buildScan.publishAlways" API has been removed, the updated Develocity "buildScan.publishing" API publishes a Build Scan by default

And please update the repository secrets to fix this issue,

  • The deprecated "GRADLE_ENTERPRISE_ACCESS_KEY" environment variable has been replaced by "DEVELOCITY_ACCESS_KEY"

Result:

  • Support JDK-21 for building armeria.
  • Use latest gradle version 8.7.

Copy link
Contributor

github-actions bot commented Apr 27, 2024

🔍 Build Scan® (commit: 80b70e3)

Job name Status Build Scan®

@Dogacel
Copy link
Contributor Author

Dogacel commented Apr 27, 2024

This is why CI is failing 🙂

@Dogacel is not a maintainer. Disallowed to change GitHub Actions workflows.

@ikhoon
Copy link
Contributor

ikhoon commented Apr 27, 2024

We use self-hosted runners for which GitHub does not support Docker environments. An attacker may install malicious code to steal our credentials when GitHub actions jobs using sensitive information are running.

Let us take over this PR. I will create a new branch based on your PR and add you as a co-author.

@Dogacel
Copy link
Contributor Author

Dogacel commented Apr 28, 2024

We use self-hosted runners for which GitHub does not support Docker environments. An attacker may install malicious code to steal our credentials when GitHub actions jobs using sensitive information are running.

Let us take over this PR. I will create a new branch based on your PR and add you as a co-author.

That's pretty fair 🙂 Thanks for the explanation! Good security measures 👍

@Dogacel
Copy link
Contributor Author

Dogacel commented Apr 28, 2024

@ikhoon Just letting you know, the existing GitHub runners are successfully building as of yesterday. I had to upgrade ProGuard because 7.3 did not support Java 21. Please LMK if anything comes up.

@trustin
Copy link
Member

trustin commented Apr 30, 2024

Thanks @Dogacel for trying to keep things up-to-date! 🙇

Comment on lines +56 to +58
capture {
fileFingerprints = true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe I was migrating the old taskInputFiles parameter and found this one as the replacement. We can remove it if it is no longer needed.

@@ -370,7 +370,7 @@ class TestsReportTask extends DefaultTask {
}

def graalLauncher = javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(rootProject.ext.buildJdkVersion))
Copy link
Contributor

Choose a reason for hiding this comment

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

Let me revert this change in my local branch because GraalVM does not fully support 21.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':installGraalNativeImage'.
> A problem occurred starting process 'command '/Users/ikhoon/.gradle/jdks/graalvm_community-21-aarch64-os_x/graalvm-community-openjdk-21.0.2+13.1/Contents/Home/lib/installer/bin/gu''

Copy link
Contributor

@ikhoon ikhoon May 8, 2024

Choose a reason for hiding this comment

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

After checking further, I found that there were changes in GraalVM packaging. lib/svm/bin/rebuild-images and lib/installer/bin/gu do not exist in version 21.
Upgrading GraalVM needs to be handled as a separate issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting, I think in that sense graal builds should be optional based on JVM version. Otherwise it gave me an error regarding class version incompatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might not be a required change, I think I got confused because of the warnings proguard threw. I hope it is gonna build after you revert the changes 👍

ikhoon added a commit to ikhoon/armeria that referenced this pull request May 8, 2024
Motivation:

As non-maintainer users can't update GitHub workflow files, this PR
supersedes @Dogacel's work (line#5644)

Modifications:

- Use JDK 21 to run Armeria CI and other jobs
- Upgrade Gradle version to 8.7

Result:

You can now use Java 21 to build Armeria

Co-Author: Dogacel <dogacel@gmail.com>
ikhoon added a commit to ikhoon/armeria that referenced this pull request May 8, 2024
Motivation:

As non-maintainer users can't update GitHub workflow files, this PR
supersedes @Dogacel's work (line#5644)

Modifications:

- Use JDK 21 to run Armeria CI and other jobs
- Upgrade Gradle version to 8.7

Result:

You can now use Java 21 to build Armeria

Co-authored-by: Dogacel <dogacel@gmail.com>
ikhoon added a commit to ikhoon/armeria that referenced this pull request May 8, 2024
Motivation:

As non-maintainer users can't update GitHub workflow files, this PR
supersedes @Dogacel's work (line#5644)

Modifications:

- Use JDK 21 to run Armeria CI and other jobs
- Upgrade Gradle version to 8.7

Result:

You can now use Java 21 to build Armeria

Co-authored-by: Dogacel <dogacel@gmail.com>
minwoox pushed a commit that referenced this pull request May 10, 2024
Motivation:

As non-maintainer users can't update GitHub workflow files, this PR
supersedes @Dogacel's work (#5644)

Modifications:

- Use JDK 21 to run Armeria CI and other jobs
- Upgrade Gradle wrapper version to 8.7

Result:

You can now use Java 21 to build Armeria

Co-authored-by: Dogacel <dogacel@gmail.com>
@minwoox
Copy link
Member

minwoox commented May 17, 2024

Superseded by #5667

@minwoox minwoox closed this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants