Open bric3 opened 2 years ago
Oh by the way here's the build descriptor
plugins {
id("org.asciidoctor.jvm.revealjs") version "3.3.2"
}
// keep using the groovy DSL otherwise ruby.gem() will raise an "Unresolved reference"
repositories {
mavenCentral()
ruby.gems()
}
// Speaker mode: type `s`
// Fullscreen mode: type `o`
// Fullscreen mode: type `f`
// See https://asciidoctor.github.io/asciidoctor-gradle-plugin/development-3.x/user-guide/#asciidoctorj-revealjs-plugin
revealjs {
version = "4.1.0" // ruby asciidoctor-revealjs backend
}
asciidoctorRevealJs {
outputDir("$buildDir/docs")
baseDirFollowsSourceDir()
sourceDir("src/docs/asciidoc")
sources {
include("index.adoc")
}
attributes(
"sourceDir": "src/docs/asciidoc",
"imagesDir": "",
"toc": "left",
"icons": "font",
"iconfont-name": "fontawesome-5.8.0",
// Configurations not available via the `revealjsOptions` block
// https://revealjs.com/config/
"revealjs_controlsLayout": "edges", // Determines where controls appear, "edges" or "bottom-right"
"revealjs_navigationMode": "linear" // Changes to linear navigation (left -right)
)
theme("blood") // https://revealjs.com/themes/
revealjsOptions {
setControls(true) // Display presentation control arrows
setSlideNumber("c/t") // Display current over total slide number
setOverviewMode(true) // Enable the slide overview mode https://revealjs.com/overview/
setTransition("fade") // Slide transition style (none/fade/slide/convex/concave/zoom)
setBackgroundTransition("convex") // Transition style for full page slide backgrounds
}
}
asciidoctorj {
version("2.5.2")
fatalWarnings missingIncludes()
modules {
diagram.use()
diagram.setVersion("2.2.1")
}
}
build.dependsOn(asciidoctorRevealJs)
It seems that asciidoctor-revealjs
4.1.0 is there in toquebox proxy, I believe that's what ruby.gems()
declares.
$ curl http://rubygems-proxy.torquebox.org/releases/rubygems/asciidoctor-revealjs/4.1.0/
<!DOCTYPE html>
<html>
<header>
<title>gems/maven/releases/rubygems/asciidoctor-revealjs/4.1.0/</title>
</header>
<body>
<h1>Index of gems/maven/releases/rubygems/asciidoctor-revealjs/4.1.0/</h1>
<hr />
<a href="..">../</a><br />
<a href="asciidoctor-revealjs-4.1.0.gem">asciidoctor-revealjs-4.1.0.gem</a><br />
<a href="asciidoctor-revealjs-4.1.0.gem.sha1">asciidoctor-revealjs-4.1.0.gem.sha1</a><br />
<a href="asciidoctor-revealjs-4.1.0.pom">asciidoctor-revealjs-4.1.0.pom</a><br />
<a href="asciidoctor-revealjs-4.1.0.pom.sha1">asciidoctor-revealjs-4.1.0.pom.sha1</a><br />
<hr />
</body>
</html>
The .gem
file is actually a redirect (status 302) to rubygems.org.
So I recreated a new project. Everything was fine, until the same loading error appeared, stopping the daemons, didn't help.
I noticed this message though just before the loading error started to surface.
$ ./gradlew asciidoctorRevealJs
BUILD SUCCESSFUL in 1s
2 actionable tasks: 2 up-to-date
Daemon will be stopped at the end of the build after running out of JVM memory
I have the same issue as you. The problem seems to be linked to the :asciidoctorGemsPrepare tasks. When I do:
./gradlew clean asciidoctorRevealJs --no-build-cache
It always works fine. So it seems to be a cache issue.
Got the same problem but with the "asciidoctor-lists" gem when using the "asciidoctorPdf" task from the pdf plugin.
Exception in thread "main" org.jruby.exceptions.LoadError: (LoadError) no such file to load -- asciidoctor-lists
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:974)
at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.rubygems.core_ext.kernel_require.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54)
at RUBY.<main>(<script>:1)
So it is some general problem, not related to revealjs itself.
build.gradle snippet:
plugins {
id 'base'
id 'org.asciidoctor.jvm.convert'
id 'org.asciidoctor.jvm.pdf'
id 'org.asciidoctor.jvm.gems'
}
repositories {
ruby.gems()
// https://github.com/jruby-gradle/jruby-gradle-plugin/issues/429
}
dependencies {
asciidoctorGems 'rubygems:rouge:3.26.1'
asciidoctorGems 'rubygems:asciidoctor-lists:1.0.7'
}
asciidoctorPdf {
sourceDir = project(":docs").file("src/docs/toc")
dependsOn asciidoctorGemsPrepare
baseDirFollowsSourceDir()
sources {
include 'TOC_Example.adoc'
}
pdfThemes {
local 'TOC', {
themeDir = project(":docs").file("src/docs/themes")
themeName = 'TOC'
}
}
theme 'TOC'
asciidoctorj {
requires 'rouge'
requires 'asciidoctor-lists'
attributes = (pdfAttributes << [
'description' : 'Beschreibung')
}
inputs.dir(project(":docs").file("src/docs/toc"))
inputs.dir(project(":docs").file("src/docs/themes"))
outputs.dir("build/docs/asciidocPdf/")
outputs.upToDateWhen { file("build/docs/asciidocPdf/TOC_Example.pdf").exists() }
}
Using --no-build-cache it always works, @bric3 maybe you can adjust the subject to some more general problem or should I open another ticket with basically the same problem, just another package name?
@tkrah I will change the title. Thanks for reporting as well. That's good to have a work around.
I have the same issue as you. The problem seems to be linked to the :asciidoctorGemsPrepare tasks. When I do:
./gradlew clean asciidoctorRevealJs --no-build-cache
It always works fine. So it seems to be a cache issue.
The param works well. Thanks.
@ysb33r - tried 4.0.1 and this still fails:
* What went wrong:
Execution failed for task ':KonfHb:asciidoctorPdf'.
> A failure occurred while executing org.ysb33r.grolifant.internal.v6.jvm.worker.InternalWorkerAppExecutor
> org.jruby.exceptions.LoadError: (LoadError) no such file to load -- asciidoctor-lists
So imho this one is not fixed - even more worse, the workaround with "--no-build-cache" does not work anymore - so the whole build is broken now with anything greater than alpha1.
@bric3 can you reopen this one maybe?
last part of the stacktrace acquired with --stacktrace option:
Caused by: org.ysb33r.grolifant.api.remote.worker.WorkerExecutionException: org.jruby.exceptions.LoadError: (LoadError) no such file to load -- asciidoctor-lists
at org.ysb33r.grolifant.internal.v6.jvm.worker.InternalWorkerAppExecutor.execute(InternalWorkerAppExecutor.groovy:39)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:54)
at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:48)
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
at org.gradle.workers.internal.AbstractClassLoaderWorker.executeInClassLoader(AbstractClassLoaderWorker.java:48)
at org.gradle.workers.internal.IsolatedClassloaderWorker.run(IsolatedClassloaderWorker.java:49)
at org.gradle.workers.internal.IsolatedClassloaderWorker.run(IsolatedClassloaderWorker.java:30)
at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory$1.lambda$execute$0(IsolatedClassloaderWorkerFactory.java:57)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:78)
at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory$1.execute(IsolatedClassloaderWorkerFactory.java:49)
at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:170)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)
at org.gradle.internal.Factories$1.create(Factories.java:31)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:264)
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:128)
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:133)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)
... 2 more
Caused by: org.jruby.exceptions.LoadError: (LoadError) no such file to load -- asciidoctor-lists
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1017)
at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.rubygems.core_ext.kernel_require.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85)
at RUBY.<main>(<script>:1)
Is this specific to Build cache?
I don't know the real underlying cause - we just discovered that using "-no-build-cache" was a working workaround running 3.x or 4.0.0-alpha1. With 4.0.1 that workaround does not work anymore and it does not matter if build-cache is enabled or not, it fails now with the LoadError in any case.
The files are at least prepared with the gemPrepare task in the build directory:
./KonfHb/build/.asciidoctorGems/cache/asciidoctor-lists-1.0.9.gem
./KonfHb/build/.asciidoctorGems/specifications/asciidoctor-lists-1.0.9.gemspec
./KonfHb/build/.asciidoctorGems/gems/asciidoctor-lists-1.0.9
./KonfHb/build/.asciidoctorGems/gems/asciidoctor-lists-1.0.9/lib
./KonfHb/build/.asciidoctorGems/gems/asciidoctor-lists-1.0.9/lib/asciidoctor-lists.rb
./KonfHb/build/.asciidoctorGems/gems/asciidoctor-lists-1.0.9/lib/asciidoctor-lists
./KonfHb/build/.asciidoctorGems/gems/asciidoctor-lists-1.0.9/lib/asciidoctor-lists/version.rb
./KonfHb/build/.asciidoctorGems/gems/asciidoctor-lists-1.0.9/lib/asciidoctor-lists/extensions.rb
./KonfHb/build/.asciidoctorGems/gems/asciidoctor-lists-1.0.9/README.adoc
I am not sure why jruby does fail to load them - maybe looking in the wrong place? There are no useful debug messages in the gradle debug output to give some better hints.
@ysb33r I made some progress after digging through the code - with 4.0.1 it does build successfully if I change this in my build file:
+ withGemJar 'asciidoctorGemsJar'
sourceDir = project(":docs").file("src/docs/KonfHb")
- dependsOn asciidoctorGemsPrepare
+ dependsOn asciidoctorGemsPrepare, asciidoctorGemsJar
After that it is working just with a simple "gradle clean build" - nice. Sorry for the noise, but the latest docs from https://asciidoctor.github.io/asciidoctor-gradle-plugin/development-3.x/user-guide/ does not mention the withGemJar thingy and this ticket also did not mention it, but if I add it, it is working - is this expected? Do I have to add it to each of my asciidoctorPdf extensions or should this be done out-of-the-box from the plugin?
No problem. We are trying to get the documentation pipeline fixed.
For no reason gradle build started to fail with a load error, I don't quite understand what's wrong. I didn't changed anything in the buildscript.