Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabric Loader tries to read a .pom file as a zip file #958

Open
kzvi opened this issue Jul 29, 2024 · 5 comments
Open

Fabric Loader tries to read a .pom file as a zip file #958

kzvi opened this issue Jul 29, 2024 · 5 comments

Comments

@kzvi
Copy link

kzvi commented Jul 29, 2024

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.

@modmuss50
Copy link
Member

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.

@kzvi
Copy link
Author

kzvi commented Jul 30, 2024

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"?

@sfPlayer1
Copy link
Contributor

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.

@KernelFreeze
Copy link

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.

@sfPlayer1
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants