quilt-loader icon indicating copy to clipboard operation
quilt-loader copied to clipboard

Path handling regression in 0.17.5-beta.6

Open Scrumplex opened this issue 2 years ago • 10 comments

Commit db0fddde6ff2ca2920973bdddbb6eacef6b84a61 changed the way URLs are parsed. This now causes Quilt to look for directories using url-encoded characters. For example: /home/scrumplex/test%20dir/libraries/org/quiltmc/quilt-loader/0.17.5-beta.6/quilt-loader-0.17.5-beta.6.jar instead of /home/scrumplex/test dir/libraries/org/quiltmc/quilt-loader/0.17.5-beta.6/quilt-loader-0.17.5-beta.6.jar

See:

java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.polymc.impl.OneSixLauncher.invokeMain(OneSixLauncher.java:104)
	at org.polymc.impl.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:176)
	at org.polymc.impl.OneSixLauncher.launch(OneSixLauncher.java:186)
	at org.polymc.EntryPoint.listen(EntryPoint.java:144)
	at org.polymc.EntryPoint.main(EntryPoint.java:74)
Caused by: java.lang.RuntimeException: java.nio.file.NoSuchFileException: /home/scrumplex/test%20dir/libraries/org/quiltmc/quilt-loader/0.17.5-beta.6/quilt-loader-0.17.5-beta.6.jar
	at org.quiltmc.loader.impl.launch.knot.Knot.findEmbedddedGameProvider(Knot.java:262)
	at org.quiltmc.loader.impl.launch.knot.Knot.createGameProvider(Knot.java:180)
	at org.quiltmc.loader.impl.launch.knot.Knot.init(Knot.java:124)
	at org.quiltmc.loader.impl.launch.knot.Knot.launch(Knot.java:70)
	at org.quiltmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:24)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	... 6 more
Caused by: java.nio.file.NoSuchFileException: /home/scrumplex/test%20dir/libraries/org/quiltmc/quilt-loader/0.17.5-beta.6/quilt-loader-0.17.5-beta.6.jar
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
	at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:148)
	at java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
	at java.base/java.nio.file.Files.readAttributes(Files.java:1851)
	at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1269)
	at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:709)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:243)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:172)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:186)
	at org.quiltmc.loader.impl.launch.knot.Knot.findEmbedddedGameProvider(Knot.java:234)
	... 11 more

Related to #90

Scrumplex avatar Oct 14 '22 08:10 Scrumplex

CC @SilverAndro

Scrumplex avatar Oct 14 '22 08:10 Scrumplex

Not sure why this is possible to be quite honest, this type of escaping works for [ and ] so id expect it to work for spaces as well

SilverAndro avatar Oct 14 '22 08:10 SilverAndro

Sooo, I am running into the issue that this actually works perfectly fine on my machine?

It has 0 issues loading a path with spaces in it

SilverAndro avatar Oct 14 '22 08:10 SilverAndro

Maybe Java behaves differently depending on the platform? I know that this issue happens on my Linux machine with OpenJDK 18 from Arch repos as well as on another user's Windows machine with Adoptium Temurin 17

Scrumplex avatar Oct 14 '22 08:10 Scrumplex

Running windows 11 here, Adoptium 18

SilverAndro avatar Oct 14 '22 08:10 SilverAndro

Sooo, I am running into the issue that this actually works perfectly fine on my machine?

It has 0 issues loading a path with spaces in it

What Ive noticed is that it specifically has to be the libraries

Fnige avatar Oct 14 '22 08:10 Fnige

This could also be an issue with PolyMC then. Maybe PolyMC's -cp JVM param is formatted in a slightly different way?

Scrumplex avatar Oct 14 '22 08:10 Scrumplex

Is there a way I can quickly see if thats the problem?

Fnige avatar Oct 14 '22 08:10 Fnige

Ahha! I can recreate it on my machine, but only if the spaces are in the polymc install path

My current install has no spaces in that path so it works fine, but switching to a portable version with spaces in the path breaks it

No clue how the spaces issue somehow resolves itself after library init though

SilverAndro avatar Oct 14 '22 08:10 SilverAndro

This seem to happen for any sort of escaping, almost wondering if the solution is to just not escape anything until whatever point it becomes "safe"/required?

SilverAndro avatar Oct 14 '22 08:10 SilverAndro

Judging by the inactivity, i believe this was resolved with #217. Please let us know if this is still an issue.

TheGlitch76 avatar Feb 20 '23 01:02 TheGlitch76