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

update Gradle to 8.7 #203

Merged
merged 6 commits into from
Jun 26, 2024
Merged

update Gradle to 8.7 #203

merged 6 commits into from
Jun 26, 2024

Conversation

adam-enko
Copy link
Member

@adam-enko adam-enko commented Apr 10, 2024

  • replace deprecated Project.buildDir with layout.buildDirectory
  • replace deprecated createTempFile with Files.createTempFile
  • change NativeBenchmarkExec from open to abstract to avoid does not implement abstract base class member public abstract fun acceptServiceReferences error

Part of KT-66949

On hold - waiting for #204

@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please clarify why this change was necessary?
Does advancing the Gradle version constrain which Gradle versions users of the plugin can use?

Copy link
Member Author

@adam-enko adam-enko Apr 15, 2024

Choose a reason for hiding this comment

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

Some of the KT-66949 refactoring would benefit from newer Gradle features, or fixed Gradle bugs. It's also nicer to write build scripts which have newer features, like property assignment.

Updating shouldn't affect the Gradle compatibility (despite its reputation for constantly changing, Gradle actually has a pretty solid deprecation cycle - assuming the build scripts are kept up-to-date!)

However, you're right that we should test it. We can specify the Gradle version being tested, and then we can be more confident about the changes. I'll make a new commit specify a fixed version for testing...

Copy link
Member Author

@adam-enko adam-enko Apr 15, 2024

Choose a reason for hiding this comment

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

I've had a quick check and I think that, while Benchmark Plugin says it supports Gradle 7.0, some of the tests fail when tested using Gradle 7.0...

Copy link
Member Author

@adam-enko adam-enko Apr 15, 2024

Choose a reason for hiding this comment

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

I've pushed a commit to bump the minimum supported & tested version to Gradle 7.6.3 7.6.4.

Context: BenchmarksPlugin says it supports, at minimum, Gradle 7.0. However, when the tests run using 7.0, some fail! Conclusion: BenchmarksPlugin hasn't supported 7.0 for a long time.

The README says the minimum supported Gradle version is 7.4.

So, rather than fixing the code to support a really, really, old Gradle version, let's just bump the supported & tested version to be the latest 7.x Gradle version (which is also the approach KGP takes).

Copy link
Member Author

@adam-enko adam-enko Apr 16, 2024

Choose a reason for hiding this comment

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

I've made a new PR that standardises and tests the supported Gradle version, without making changes to the actual Gradle version used to build & test the project.

#204

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's go ahead and merge that PR first, and rebase this PR onto those changes. If the newer Gradle version (8.7) does not require raising the minimum supported version (7.4), I would suggest we keep the minimum supported version unchanged. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense to me 👍

Copy link
Member

Choose a reason for hiding this comment

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

tested version to be the latest 7.x Gradle version (which is also the approach KGP takes).

Not exactly. In KGP, we support Gradle 6.8.3+ and aim to keep as much as possible if it's reasonably possible. I would suggest not bumping the minimal version even higher. The best strategy is to keep the minimal versions in sync between all the ecosystem plugins to minimize the effort user should put into dealing with all our plugins

Copy link
Member Author

Choose a reason for hiding this comment

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

tested version to be the latest 7.x Gradle version (which is also the approach KGP takes).

Not exactly. In KGP, we support Gradle 6.8.3+ and aim to keep as much as possible if it's reasonably possible. I would suggest not bumping the minimal version even higher. The best strategy is to keep the minimal versions in sync between all the ecosystem plugins to minimize the effort user should put into dealing with all our plugins

Ah, my mistake. What I meant was KGP supports the latest version of each minor release. Am I right in thinking that KGP tests and supports 7.4.2, but not 7.4?

It'd be good to align the supported Gradle version across JB projects. I'm concerned that supporting and testing 6/7/8 would be a large amount of work though!

Gradle stopped bug/security fixes for Gradle 6 over a year ago, so it'd help to drop it. And, so long as Benchmark supports Gradle 7, then it should be compatible with Gradle 8 projects without significant issues.

@adam-enko adam-enko requested a review from qurbonzoda April 15, 2024 13:03
@adam-enko adam-enko requested review from dkrasnoff and removed request for ALikhachev April 24, 2024 15:57
@adam-enko adam-enko marked this pull request as draft April 24, 2024 15:58
- replace deprecated Project.buildDir with layout.buildDirectory
- replace deprecated createTempFile with Files.createTempFile
- change NativeBenchmarkExec from `open` to `abstract` to avoid `does not implement abstract base class member public abstract fun acceptServiceReferences` error
Context: BenchmarksPlugin says it supports, at minimum, Gradle 7.0. However, when the tests run using 7.0, some fail! Conclusion: BenchmarksPlugin hasn't supported 7.0 for a long time.

So, rather than fixing the code to support a really, really, old Gradle version, let's just bump the supported & tested version to be the latest 7.x Gradle version (which is also the approach KGP takes).
@adam-enko adam-enko force-pushed the update/gradle-8-7 branch from c5ce4e5 to af4da4e Compare June 24, 2024 09:52
@adam-enko adam-enko marked this pull request as ready for review June 24, 2024 10:02
) {
/** Defaults to the minimum Gradle version specified in [kotlinx.benchmark.gradle.BenchmarksPlugin] */
private val gradleVersion: GradleTestVersion = gradleVersion ?: GradleTestVersion.v7
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please clarify why v7("7.6.4") is used instead of the MinSupportedGradleVersion("7.4")?

Copy link
Member Author

Choose a reason for hiding this comment

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

it was a typo, thanks for spotting it

@adam-enko adam-enko merged commit 1aefc62 into master Jun 26, 2024
@adam-enko adam-enko deleted the update/gradle-8-7 branch June 26, 2024 13:38
fzhinkin added a commit that referenced this pull request Jul 9, 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.

3 participants