jamesfredley opened a new pull request, #16178:
URL: https://github.com/apache/grails-core/pull/16178
## Summary
Groovy 5's compiler default is invokedynamic on. In this repo, only modules
that apply the Grails Gradle plugin inherited `grails.indy = false`. Everything
else (`grails-gradle`, `grails-forge`, `build-logic`, and published framework
modules that only apply `org.apache.grails.buildsrc.compile`) compiled with
indy on. That left mixed bytecode and the #15293 performance regression in
artifacts that never went through the Grails plugin.
This PR turns indy **off for the entire Grails 8 compile**, from one shared
default, and applies it in all three independent builds.
## How it is centralized
- `CompilePlugin` (`org.apache.grails.buildsrc.compile`) now sets
`optimizationOptions.indy = false`. That is the historical GroovyCompile
convention plugin used by framework, `grails-gradle`, and `grails-forge`
modules.
- `gradle/groovy-indy.gradle` is applied from `subprojects` in:
- grails-core (`build.gradle`)
- grails-gradle (`grails-gradle/build.gradle`)
- grails-forge (`grails-forge/build.gradle`)
- `build-logic` cannot apply `CompilePlugin` to itself (it compiles that
plugin). `plugins` and `docs-core` set the same default locally.
- CI can still opt in with `-PgrailsIndy=true` (same property as
`grails-extension-gradle-config.gradle`).
- Applications are unchanged: `GrailsExtension.indy` still defaults to
`false`, and `grails { indy = true }` / the GraalVM native convention still win
in `afterEvaluate`.
Grails 9 / Groovy 6 can flip this default the other way when indy is ready.
## Verification
- `CompilePluginSpec` asserts `compileGroovy` / `compileTestGroovy` are
indy=false by default and true with `-PgrailsIndy=true`
- `:build-logic:test` and `:grails-docs-core:test` pass
- `help` configures cleanly in grails-core, grails-gradle, and grails-forge
- `javap` on `grails-encoder` `CodecMetaClassSupport` shows classic
`CallSiteArray`, not invokedynamic dispatch
Fixes #15293 (build-side: stop compiling the framework with Groovy's indy
default)
See also #15431 (warning noise when indy is disabled; not changed here).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]