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

Instrument invokedynamic-based Groovy bytecode for configuration cache input detection #20794

Closed
mlopatkin opened this issue May 16, 2022 · 0 comments · Fixed by #20799
Closed
Assignees
Labels
a:feature A new functionality @configuration-cache in:configuration-cache Configuration Caching
Milestone

Comments

@mlopatkin
Copy link
Member

The configuration cache relies on instrumenting the user-provided bytecode to detect implicit build inputs like system properties or environment variables. By its nature, the instrumentation is tied to the calling conventions of the language used to produce the bytecode. The dynamic Groovy has two non-trivial conventions. One is "old" and is based on Groovy's own "CallSite" class; it is used by default in Groovy before 4. This convention is currently supported. Another one is new and employs Java 7's new invokedynamic instruction. It is the only option for Groovy 4 but can be enabled in earlier versions too. The bytecode produced is completely different, so the configuration cache instrumentation has to be updated to support both conventions.

Gradle is using Groovy 3 with older conventions (at the time of writing, around 7.5) to compile build scripts and plugins, however nothing prevents users from depending on indified libraries, so it is necessary to instrument these properly even now. The invokedynamic instrumentation is also essential to the migration to Groovy 4 within Gradle build scripts.

Note that this only applies to the code used in buildscripts and Gradle plugins and has nothing to do with compiling Groovy code per se.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality @configuration-cache in:configuration-cache Configuration Caching
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant