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

Enable Gradle's stable configuration cache feature flag #3390

Merged

Conversation

izeye
Copy link
Contributor

@izeye izeye commented Sep 5, 2022

This PR enables Gradle's stable configuration cache feature flag.

See spring-projects/spring-boot#32061

@shakuzen shakuzen added type: task A general task build A change in our build-system labels Sep 7, 2022
@shakuzen shakuzen added this to the 1.8.10 milestone Sep 7, 2022
@shakuzen
Copy link
Member

shakuzen commented Sep 7, 2022

I ran this locally and checked the build scan, but I noticed we don't have the configuration cache enabled, so I'm not sure this makes any difference. If I try running the build with --configuration-cache then we get errors for the Nebula plugins we're using (see this build scan). I'm going to mark this as blocked until we first get the build running with the configuration cache, if that is something we will/should do. @jonatan-ivanov have we considered using the configuration cache before?

@shakuzen shakuzen added the blocked An issue that's blocked on an external project change label Sep 7, 2022
@jonatan-ivanov
Copy link
Member

Feature Flag

As far as I see, this flag enables certain checks so that users will know about issues (get warnings) and can fix them before they get into trouble in a future versions regardless if they are using config cache or not (see here).

If this flag is enabled, we get some warnings (run ./gradlew build --warning-mode all to see them):

> Task :micrometer-registry-otlp:spotlessKotlinCheck UP-TO-DATE
Build service 'SpotlessTaskService' is being used by task ':micrometer-registry-otlp:spotlessKotlinCheck' without the corresponding declaration via 'Task#usesService'. This will fail with an error in Gradle 8.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: https://docs.gradle.org/7.5.1/userguide/upgrading_version_7.html#undeclared_build_service_usage

(see build scan)

If we enable this flag (I'm ok with that), it will remind us every time we build that:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

Enabling Config Cache

Back then, this was a blocker (still is) that prevented us enabling config cache: hierynomus/license-gradle-plugin#198

Also, if I remember correctly, our config phase took around 1-2s back then so the amount of time we could have saved wasn't that much, the feature is "incubating" and not all the core plugins are supported (though I think this last one did not effect us), see here.

I've just checked a few builds and I see builds where the config phase takes more time (5-7s) but there are still builds in the 1-2s range, I did not investigate why.

We can enable it and suppress the errors but I don't think it is a good idea right now:

org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache-problems=warn

@shakuzen
Copy link
Member

shakuzen commented Sep 8, 2022

I assumed from the name and the location in the documentation that this flag will only do anything if you are using the configuration cache to begin with, but since that seems to not be the case, we can merge this without enabling the configuration cache. Thanks for explaining!

@shakuzen shakuzen removed the blocked An issue that's blocked on an external project change label Sep 8, 2022
@shakuzen shakuzen merged commit 20c423c into micrometer-metrics:1.8.x Sep 8, 2022
@izeye izeye deleted the stable-configuration-cache branch September 8, 2022 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build A change in our build-system type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants