Closed Goooler closed 10 months ago
ping @ysb33r @aalmiray ;-)
Hey @daniellansun, please try to 4.0.0-alpha.1 release and tell me if it fixes the problem
@daniellansun It seems to be happening when extensions are deserialised. Since this is not happening with Gradle 7.5.1, but with Gradle 7.6, it might be possible that some Gradle dependencies are being leaked.
Do any of the Groovy asciidoc extensions rely on Gradle code?
@daniellansun That seems to be the problem. If I apply this diff to your repo, the build passes.
diff --git a/build-logic/src/main/groovy/org.apache.groovy-asciidoctor.gradle b/build-logic/src/main/groovy/org.apache.groovy-asciidoctor.gradle
index 7b1d4bb3c3..b827285d3a 100644
--- a/build-logic/src/main/groovy/org.apache.groovy-asciidoctor.gradle
+++ b/build-logic/src/main/groovy/org.apache.groovy-asciidoctor.gradle
@@ -158,6 +158,7 @@ def htmlOutputSanityCheck = { file, text, errors ->
asciidoctor {
def errors = new LinkedHashSet<String>()
+ inProcess IN_PROCESS
doFirst {
def specTestDir = file('src/spec/test')
if (specTestDir.exists()) {
@ysb33r Thanks a lot for your looking into the issue and giving the solution. @Goooler Could you try again?
Ah yes, that is the asciidoctorPdf
task. Up to now we could not run that task IN_PROCESS
, because Gradle workers leaked an incompatible version of snakeyaml
onto the classpath. I'll check to see if that is still the case, given that much work has been done by the Gradle team in that area.
Otherwise, this is going to be a much bigger fix.
Another option is to add the Gradle API explicitly to the classpath. For example:
//...
configurations {
asciidocExtensions
}
dependencies {
asciidocExtensions gradleApi()
}
asciidoctor {
configurations 'asciidocExtensions'
// ...
}
asciidoctorPdf {
configurations 'asciidocExtensions'
// ...
}
// ...
The above suggests a potential fix is for the plugin itself to add the gradle API to the classpath when running asciidoctor.
@mrotteveel Failed due to
An exception occurred applying plugin request [id: 'org.apache.groovy-core']
> Failed to apply plugin 'org.apache.groovy-core'.
> Failed to apply plugin 'org.apache.groovy-base'.
> Failed to apply plugin 'org.apache.groovy-asciidoctor'.
> org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method asciidoctorPdf() for arguments [precompiled_OrgApacheGroovyAsciidoctor$_run_closure12@2b1d9078] on root project 'groovy' of type org.gradle.api.Project.
see https://github.com/Goooler/groovy/commit/5b881c894fdf161f5e2e59ea372972d84fc25dcb https://github.com/Goooler/groovy/actions/runs/3862782763/jobs/6584560388
@Goooler That script doesn't seem to have org.asciidoctor.jvm.pdf
as plugin, so remove the asciidoctorPdf
definition. My fix worked (with 3.3.2) in https://github.com/FirebirdSQL/jaybird-manual/blob/master/build.gradle
@Goooler That script doesn't seem to have
org.asciidoctor.jvm.pdf
as plugin, so remove theasciidoctorPdf
definition. My fix worked (with 3.3.2) in https://github.com/FirebirdSQL/jaybird-manual/blob/master/build.gradle
Still can't, see https://github.com/Goooler/groovy/commit/8d006fad6b44032ff36ab44f4accf4f87c718aaa.
@ysb33r is there yet a fix? Using 4.0.0-alpha.1 still breaks. I would contribute if possible but need at least a bit of context
You can repro this issue on https://github.com/apache/groovy/pull/1832.