quarkiverse / quarkus-web-bundler

Create full-stack web apps quickly and easily with this Quarkus extension. It offers zero-configuration bundling for your web app scripts (JS, JSX, TS, TSX), dependencies (jQuery, React, htmx, etc.), and styles (CSS, SCSS, SASS).
Apache License 2.0
16 stars 9 forks source link

Build fails with Quarkus 3.9.5+ and Web Bundler due to Qute Processor #197

Closed nanobreaker closed 1 month ago

nanobreaker commented 2 months ago

Hey yo!

I just upgraded my project to Quarkus version 3.9.5 and got into the problem with web-bundler on build stage. Also tried with the code.quarkus.io and experienced same problem, used REST Qute + Web Bundler, it has even newer version at 3.10.0.

Here is the actual error and further discovery

Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.qute.deployment.QuteProcessor#collectTemplates threw an exception: java.lang.IllegalArgumentException
        at jdk.zipfs/jdk.nio.zipfs.ZipPath.relativize(ZipPath.java:248)
        at io.quarkus.qute.deployment.QuteProcessor.lambda$scanTemplateRootSubtree$12(QuteProcessor.java:3394)
        at io.quarkus.paths.FilteredPathTree.lambda$walk$0(FilteredPathTree.java:35)
        at io.quarkus.paths.PathTreeVisit.walk(PathTreeVisit.java:25)
        at io.quarkus.paths.ArchivePathTree.walk(ArchivePathTree.java:98)
        at io.quarkus.paths.FilteredPathTree.walk(FilteredPathTree.java:33)
        at io.quarkus.qute.deployment.QuteProcessor.scanTemplateRootSubtree(QuteProcessor.java:3391)
        at io.quarkus.qute.deployment.QuteProcessor.lambda$scanPathTree$7(QuteProcessor.java:2171)
        at io.quarkus.paths.PathTreeVisit.consume(PathTreeVisit.java:47)
        at io.quarkus.paths.ArchivePathTree.accept(ArchivePathTree.java:147)
        at io.quarkus.qute.deployment.QuteProcessor.scanPathTree(QuteProcessor.java:2168)
        at io.quarkus.qute.deployment.QuteProcessor.collectTemplates(QuteProcessor.java:2152)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
        at java.base/java.lang.Thread.run(Thread.java:1583)
        at org.jboss.threads.JBossThread.run(JBossThread.java:483)

I did a little bit of debugging and found out that it fails on the call to the jdk.nio.zipfs.ZipPath.relativize, files come from different zfss. image

Are there any temporal solutions/clues at this moment to solve the issue?

UPDATE I I found a related topic, looks like something similar had place in the past https://github.com/quarkusio/quarkus/issues/25751

UPDATE II Found a link to recent refactoring in that area https://github.com/quarkusio/quarkus/commit/6014d5119451e6dfa9e22bd7b19b9ebeabf2477d

Kind regards

ia3andy commented 2 months ago

@mkouba any thought?

nanobreaker commented 2 months ago

I'm wondering what is the logic behind the qute processing, is that okey to compare relative paths of the files that are located within different zips?

ia3andy commented 2 months ago

@mkouba made Qute so I am pretty sure he will know how to fix this :)

faermanj commented 2 months ago

Same issue here, rolling back to 3.9.4 which is latest working for us.

ia3andy commented 2 months ago

@gsmet @geoand any idea of what this could be, many impacted users it seems.

ia3andy commented 2 months ago

I would suspect that fix: https://github.com/quarkusio/quarkus/pull/40158

nanobreaker commented 2 months ago

I've tested code-with-quarkus on version 3.10.0.CR1 and no build issues there!

So @ia3andy indeed fix is on it's way! I guess we can close this one.

ia3andy commented 2 months ago

@aloubyansky this looks related right? https://github.com/quarkusio/quarkus/pull/40400/files

ia3andy commented 2 months ago

@nanobreaker the issue I mentioned before is what caused the error, not the fix. It might be already fixed on main, but we need to find exactly what fixed it to be sure it doesn't happen again. Also we might need to backport the fix.

I'll make sure to enable the ecosystem-ci with quarkus main to make sure this kind of bug is catched earlier..

aloubyansky commented 2 months ago

@aloubyansky this looks related right? https://github.com/quarkusio/quarkus/pull/40400/files

Right, do we have a reproducer?

ia3andy commented 2 months ago

@aloubyansky this looks related right? https://github.com/quarkusio/quarkus/pull/40400/files

Right, do we have a reproducer?

https://code.quarkus.io/d?e=io.quarkiverse.web-bundler%3Aquarkus-web-bundler&e=rest&cn=code.quarkus.io and build

aloubyansky commented 2 months ago

Just a note, that link needs rest-qute, instead of rest to reproduce the issue. The good news is my PR fixes it.

ia3andy commented 2 months ago

Let's close it when it's released and working then. Thanks @aloubyansky this is a great news

ia3andy commented 2 months ago

@all-contributors please add @nanobreaker for bug

allcontributors[bot] commented 2 months ago

@ia3andy

I've put up a pull request to add @nanobreaker! :tada:

ia3andy commented 1 month ago

@faermanj @nanobreaker this is fixed in latest Quarkus AFAIK