Fabric Loader tries to read a .pom file as a zip file
If I use the mod template generator to make a new mod for minecraft 1.21 with the default settings, and then add
implementation("org.graalvm.polyglot:ruby:23.1.4")
to the dependencies section of build.gradle, and then run ./gradlew runClient, the following error is generated at runtime:
[16:48:22] [ERROR] [FabricLoader/]: Uncaught exception in thread "main"
net.fabricmc.loader.impl.util.ExceptionUtil$WrappedException: java.io.IOException: error reading /Users/u/.gradle/caches/modules-2/files-2.1/org.graalvm.polyglot/ruby-community/23.1.4/14ca85fccd2af52fec33f31bf9ac142caf9b6456/ruby-community-23.1.4.pom
at net.fabricmc.loader.impl.util.ExceptionUtil.wrap(ExceptionUtil.java:51)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.locateGame(MinecraftGameProvider.java:240)
at net.fabricmc.loader.impl.launch.knot.Knot.createGameProvider(Knot.java:175)
at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:130)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
Caused by: java.io.IOException: error reading /Users/u/.gradle/caches/modules-2/files-2.1/org.graalvm.polyglot/ruby-community/23.1.4/14ca85fccd2af52fec33f31bf9ac142caf9b6456/ruby-community-23.1.4.pom
at net.fabricmc.loader.impl.game.LibClassifier.process(LibClassifier.java:216)
at net.fabricmc.loader.impl.game.LibClassifier.process(LibClassifier.java:163)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.locateGame(MinecraftGameProvider.java:189)
... 5 more
Caused by: java.util.zip.ZipException: zip END header not found
at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1649)
at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1657)
at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1495)
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1458)
at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:724)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:251)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:180)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:194)
at net.fabricmc.loader.impl.game.LibClassifier.process(LibClassifier.java:203)
... 7 more
which seems to imply that LibClassifier is trying to read .pom file as if it were a zip or jar file.
This is unlikely an issue with loader, you should not have a none zip file on the classpath. Im not sure why this is happening tbh.
This is unlikely an issue with loader, you should not have a none zip file on the classpath. Im not sure why this is happening tbh.
What do you mean by "none"?
A non-jar/zip, I am not sure whether these files are supported by the class path normally. We don't support them at the moment.
I had the same problem when I tried to use GraalPy on Fabric Loader, but I found that I can exclude the transitive dependency that causes the problem, using something like this:
implementation("org.graalvm.polyglot:python:24.0.2") {
exclude(group = "org.graalvm.polyglot", module = "python-community")
}
With TruffleRuby it should be something similar.
After investigating it looks like URLClassLoader silently ignores non-zip/dir class path entries, I'll probably adjust everything to do the same or log a warning.