matrei opened a new pull request, #16387: URL: https://github.com/apache/grails-core/pull/16387
Upgrades the 8.0.x line from Groovy 5.1.3 to Groovy 6.0.0. ## Build - `groovy-callsite`: Groovy 6 ships the classic (non-invokedynamic) call-site runtime as a separate module (GROOVY-12185), and its compiler refuses to generate that bytecode without it on the compile classpath. Grails 8 keeps indy off, so `grails-common` exports the module and the root build adds it to every source set of the modules below `grails-common`. - Spock: no groovy-6.0 build exists, and 2.4-groovy-5.0 checks the Groovy major in its compiler AST transform and when a Spec starts. `spock.iKnowWhatImDoing.disableGroovyVersionCheck=true` is set on the forked Groovy compiler and Test tasks by `CompilePlugin`, on groovydoc runs, in the end-to-end build, and for applications by the Grails Gradle plugin on `GroovyCompile`, `Test` and the forked gson/gsp view compiler. A build that sets its own value keeps it. - JLine 4: Groovy 6 moves groovysh to JLine 4.4.5, so `jline.version` follows it. The SBOM plugin corrects the JLine 4 licence metadata by pattern. ## Source changes for Groovy 6.0.0 - Parameterized types and type variables are no longer class literals (GROOVY-12319). - `!x instanceof T` is rejected. It parsed as `(!x) instanceof T` and was always false, so the fixed condition in `HibernateGormInstanceApi` now marks to-one associations read-only after a validation error, with a regression test. - A statically compiled `new Foo(map)` needs an explicit `@MapConstructor` (`BeanPropertyAccessorImpl`). - `@Delegate` generates over declared overrides: mutators excluded in `WriteFilteringMap`, `reversed()` in `DirtyCheckingList` and `DirtyCheckingSortedSet`. - `@Delegate` no longer satisfies the abstract-method check for `GrailsJsonViewHelper#render(...)`, whose return type is a nested class of the joint-compiled `JsonOutput.java`: the interface methods are `default` and `TemplateRenderer` forwards them explicitly, as on 9.0.x. - The stub generator writes a precompiled trait's static methods as `static abstract`: `MyValidateable` in the validation spec implements them, as on 9.0.x. - Generic trait methods are specialized on the implementing class (`GormEntityTransformSpec`). Every workaround carries the Groovy 6 trigger, a pointer to #16157, the observed failure, the deletion condition and an impact class. Two deliberate differences from 9.0.x: indy stays off by default on this line, and the Spock opt-out comes from the Grails Gradle plugin rather than the Forge template so upgraded applications get it too. ## Docs The 8.0.x upgrade guide gains a Groovy 6 section covering the call-site module, the Spock opt-out, JLine 4 and the application-source changes above. ## Verification - All modules compile; `validateDependencyVersions` passes. - Tests and code style pass for grails-common, grails-core, grails-validation, grails-views-gson, grails-fields, grails-data-hibernate7-core, grails-datastore-core, grails-datamapping-core, grails-testing-support-http-client, grails-testing-support-core, grails-shell-cli, grails-sitemesh3, grails-web-databinding and grails-console, plus the build-logic and Grails Gradle plugin specs. - Not run locally: the oauth2 integration tests, the Mongo-backed suites and the full `aggregateViolations` sweep. CI should cover those. Three Groovy 6.0.0 defects reproduced in isolation while doing this and are worth reporting upstream: the `static abstract` stub emission for precompiled trait statics, the abstract-method check for interface methods returning a nested class of a joint-compiled Java file, and the rejected map-style constructor call under static compilation. -- 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]
