You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "codeconsole (via GitHub)" <gi...@apache.org> on 2026/08/18 23:23:13 UTC
[PR] feat: keep published artifacts on invokedynamic, let applications choose [grails-core]
codeconsole opened a new pull request, #16171:
URL: https://github.com/apache/grails-core/pull/16171
Alternative to #16170. Same problem, opposite conclusion: instead of publishing every artifact twice, publish each one once β always as `invokedynamic`.
### Why
Call-site caching links call sites at runtime, which ahead-of-time native compilation cannot do. A native image needs every class on the classpath to be the `invokedynamic` flavour, so **one dependency compiled the other way rules out a native image for every application that depends on it**.
That makes the flavour of a *published* artifact not really its own build's decision. Today a plugin author can set `grails { indy = false }` and silently strip native compatibility from every application using that plugin.
### What changes
A project applying `org.apache.grails.gradle.grails-plugin` always compiles its published classes with `invokedynamic` and ignores `grails.indy`. Plugin authors need to change nothing; a plugin build that sets `indy` can drop it.
`grails.indy` still applies to applications, which sit at the end of the classpath and may choose for their own sources. It now defaults to `true`, following Groovy's own default, rather than `false`. An application setting it to `false` opts itself out of native compilation but still runs correctly against the `invokedynamic` artifacts of the framework and its plugins β the two flavours interoperate on the same classpath.
This also resolves an existing incoherence: the framework currently ships mixed bytecode (`grails-controllers` indy-on, `grails-gsp` indy-off) purely from which modules happened to adopt `grails-plugin`. Every published artifact is now `invokedynamic`.
### Compared to #16170
| | #16170 (dual artifacts) | this PR |
|---|---|---|
| Published artifacts | 2 per module | 1 per module |
| Diff | 2 new plugin classes + test projects | 73 insertions, 10 deletions, 6 files |
| Groovy compilation | ~doubles | unchanged |
| Release surface | doubles (signing, SBOM, scanning) | unchanged |
| Native compilation | possible unless the app opts out | possible unless the app opts out |
| App can use call-site caching | yes, for its own code and its dependencies | yes, for its own code |
The `noindy` artifacts that #16170 publishes can never be used in a native build, so they double the release surface to serve only the non-native case β which this PR still supports for an application's own code at no artifact cost.
### Verification
4 functional tests in `GrailsIndyAppOnlySpec`: a plugin that explicitly sets `indy = false` still emits `PLUGIN_BYTECODE=indy=true,callsite=false`; no second-flavour tasks exist; an application can still choose call-site caching for itself; an application configuring nothing follows Groovy's default.
On a real module: `grails-cache` applies `grails-plugin` and compiled with zero `invokedynamic` instructions on `8.0.x`. On this branch, 17 of its 37 classes carry them.
Suite: 96/99 passing. The 3 `GroovyPageToolchainSpec` failures are environmental β they need a JDK 21 toolchain that is not installed on the machine I ran them on, and they fail identically on unmodified `8.0.x`. `codeStyle` clean.
### Reviewer notes
- Full `./gradlew build` has not been run; one framework module was built and inspected locally.
- The 29 modules here that apply `grails-plugin` change from indy-off to indy-on, which is the intended unification but is the change most likely to show in a performance comparison against 7.x.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: keep published artifacts on invokedynamic, let applications choose [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16171:
URL: https://github.com/apache/grails-core/pull/16171#issuecomment-5466434747
## π¨ TestLens detected 1 failed test π¨
Here is what you can do:
1) Inspect the test failures carefully.
2) If you are convinced that some of the tests are flaky, you can mute them below.
3) Finally, trigger a rerun by checking the rerun checkbox.
### Test Summary
#### [CI / Build Gradle Plugins \(25\)](https://github.com/apache/grails-core/actions/runs/33289773651/job/99199249800?pr=16171) > :grails-gradle-plugins:test [grails-gradle]
| Test | Runs | Flakiness |
|---|---|--:|
| GrailsNativeImageDefaultsSpec > an application that builds no image is left as it was | β | 0% π’ |
π·οΈ Commit: c2c4c697bf6bb288e90755eb11bf69c2a3b5fba4
βΆοΈ Tests: 1100 executed
π‘ Checks: 18/82 completed
### Test Failures
<details>
<summary><strong>GrailsNativeImageDefaultsSpec > an application that builds no image is left as it was</strong> (:grails-gradle-plugins:test [grails-gradle] in <a href="https://github.com/apache/grails-core/actions/runs/33289773651/job/99199249800?pr=16171">CI / Build Gradle Plugins (25)</a>)</summary>
```
Condition not satisfied:
result.output.contains('INDY=false')
| | |
| | false
|
| > Configure project :
| Could not fully resolve CLI companion probe dependencies for project native-defaults-off; some companion -cli artifacts (and their per-command Gradle tasks) may not be auto-provisioned. Cause: Cannot resolve external dependency org.apache.grails:grails-bom:8.0.0-SNAPSHOT because no repositories are defined.
| Required by:
| root project 'native-defaults-off'
|
| > Task :inspectDefaults
| INDY=true
| HAS_NATIVE_EXTENSION=false
|
| [Incubating] Problems report is available at: file:///tmp/gradle-projects17161651197222466318/native-defaults-off/build/reports/problems/problems-report.html
|
| Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.
|
| You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
|
| For more on this, please refer to https://docs.gradle.org/9.6.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
|
| BUILD SUCCESSFUL in 24s
| 1 actionable task: 1 executed
<org.gradle.testkit.runner.internal.FeatureCheckBuildResult@2eba1b7 delegateBuildResult=org.gradle.testkit.runner.internal.DefaultBuildResult@10aa5f84 outputFeatureCheck=org.gradle.testkit.runner.internal.feature.BuildResultOutputFeatureCheck@56827682>
at org.grails.gradle.plugin.core.GrailsNativeImageDefaultsSpec.an application that builds no image is left as it was(GrailsNativeImageDefaultsSpec.groovy:45)
```
</details>
### Rerun Controls
> [!NOTE]
> Checks are currently running using the configuration below.
Select tests to mute in this pull request:
π² GrailsNativeImageDefaultsSpec > an application that builds no image is left as it was <!-- uniqueId=[engine:spock]/[spec:org.grails.gradle.plugin.core.GrailsNativeImageDefaultsSpec]/[feature:$spock_feature_1_0] -->
Reuse successful test results:
π² β»οΈ Only rerun the tests that failed or were muted before
Click the checkbox to trigger a rerun:
π² **Rerun jobs**
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: keep published artifacts on invokedynamic, let applications choose [grails-core]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #16171:
URL: https://github.com/apache/grails-core/pull/16171#issuecomment-5335850925
## [Codecov](https://app.codecov.io/gh/apache/grails-core/pull/16171?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `11.11111%` with `8 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 52.3204%. Comparing base ([`deac428`](https://app.codecov.io/gh/apache/grails-core/commit/deac428c1e74577bc6255a5cfc3ed4b9d9da4646?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2c9410c`](https://app.codecov.io/gh/apache/grails-core/commit/2c9410c03bab888f9a9ce650b1cce7c66fc2f078?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/grails-core/pull/16171?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...rails/gradle/plugin/core/GrailsGradlePlugin.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16171?src=pr&el=tree&filepath=grails-gradle%2Fplugins%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fgradle%2Fplugin%2Fcore%2FGrailsGradlePlugin.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWdyYWRsZS9wbHVnaW5zL3NyYy9tYWluL2dyb292eS9vcmcvZ3JhaWxzL2dyYWRsZS9wbHVnaW4vY29yZS9HcmFpbHNHcmFkbGVQbHVnaW4uZ3Jvb3Z5) | 0.0000% | [7 Missing :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...gradle/plugin/core/GrailsPluginGradlePlugin.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16171?src=pr&el=tree&filepath=grails-gradle%2Fplugins%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fgradle%2Fplugin%2Fcore%2FGrailsPluginGradlePlugin.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWdyYWRsZS9wbHVnaW5zL3NyYy9tYWluL2dyb292eS9vcmcvZ3JhaWxzL2dyYWRsZS9wbHVnaW4vY29yZS9HcmFpbHNQbHVnaW5HcmFkbGVQbHVnaW4uZ3Jvb3Z5) | 0.0000% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/grails-core/pull/16171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/grails-core/pull/16171?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## 8.0.x #16171 +/- ##
==================================================
- Coverage 52.3364% 52.3204% -0.0160%
+ Complexity 18545 18519 -26
==================================================
Files 2039 2039
Lines 97521 97524 +3
Branches 17143 17159 +16
==================================================
- Hits 51039 51025 -14
- Misses 38994 39034 +40
+ Partials 7488 7465 -23
```
| [Files with missing lines](https://app.codecov.io/gh/apache/grails-core/pull/16171?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ | |
|---|---|---|
| [...g/grails/gradle/plugin/core/GrailsExtension.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16171?src=pr&el=tree&filepath=grails-gradle%2Fplugins%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fgradle%2Fplugin%2Fcore%2FGrailsExtension.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWdyYWRsZS9wbHVnaW5zL3NyYy9tYWluL2dyb292eS9vcmcvZ3JhaWxzL2dyYWRsZS9wbHVnaW4vY29yZS9HcmFpbHNFeHRlbnNpb24uZ3Jvb3Z5) | `54.3478% <100.0000%> (ΓΈ)` | |
| [...gradle/plugin/core/GrailsPluginGradlePlugin.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16171?src=pr&el=tree&filepath=grails-gradle%2Fplugins%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fgradle%2Fplugin%2Fcore%2FGrailsPluginGradlePlugin.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWdyYWRsZS9wbHVnaW5zL3NyYy9tYWluL2dyb292eS9vcmcvZ3JhaWxzL2dyYWRsZS9wbHVnaW4vY29yZS9HcmFpbHNQbHVnaW5HcmFkbGVQbHVnaW4uZ3Jvb3Z5) | `0.0000% <0.0000%> (ΓΈ)` | |
| [...rails/gradle/plugin/core/GrailsGradlePlugin.groovy](https://app.codecov.io/gh/apache/grails-core/pull/16171?src=pr&el=tree&filepath=grails-gradle%2Fplugins%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fgrails%2Fgradle%2Fplugin%2Fcore%2FGrailsGradlePlugin.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z3JhaWxzLWdyYWRsZS9wbHVnaW5zL3NyYy9tYWluL2dyb292eS9vcmcvZ3JhaWxzL2dyYWRsZS9wbHVnaW4vY29yZS9HcmFpbHNHcmFkbGVQbHVnaW4uZ3Jvb3Z5) | `0.0000% <0.0000%> (ΓΈ)` | |
... and [11 files with indirect coverage changes](https://app.codecov.io/gh/apache/grails-core/pull/16171/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: keep published artifacts on invokedynamic, let applications choose [grails-core]
Posted by "codeconsole (via GitHub)" <gi...@apache.org>.
codeconsole closed pull request #16171: feat: keep published artifacts on invokedynamic, let applications choose
URL: https://github.com/apache/grails-core/pull/16171
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: keep published artifacts on invokedynamic, let applications choose [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #16171:
URL: https://github.com/apache/grails-core/pull/16171#issuecomment-5347380069
I would 100% support using a classifier to let end users chose. I do not support indy for Groovy 5 though. The performance isn't there yet and it's enough that we already decided to remove it. I'm a -1 on making it the default until we can get the performance to be on par (which I think Groovy 6 does)
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: keep published artifacts on invokedynamic, let applications choose [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16171:
URL: https://github.com/apache/grails-core/pull/16171#issuecomment-5336203207
## β
All tests passed β
π·οΈ Commit: 2c9410c03bab888f9a9ce650b1cce7c66fc2f078
βΆοΈ Tests: 60028 executed
βͺοΈ Checks: 77/77 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org