mindstorm38 / portablemc

A fast, reliable and cross-platform command-line Minecraft launcher and API for developers. Including fast and easy installation of common mod loaders such as Fabric, Forge, NeoForge and Quilt.
https://pypi.org/project/portablemc/
GNU General Public License v3.0
353 stars 20 forks source link

Windows path conversion in MSYS2 #232

Open okadakenichi opened 1 month ago

okadakenichi commented 1 month ago

Portablemc cannot comprehend the path stype of MSYS2 such as "C:/Users/username/...".

% uname -a MINGW64_NT-10.0-22631 pc-name 3.5.3-d8b21b8c.x86_64 2024-07-09 18:03 UTC x86_64 Msys

% /mingw64/bin/python3 --version Python 3.11.9

% portablemc start fabric:1.21.1 [ OK ] Resolved fabric loader 0.16.2 for 1.21.1 [ OK ] Loaded version fabric-1.21.1-0.16.2 (fetched) [ OK ] Loaded version 1.21.1 (fetched) [ OK ] Loaded Mojang java 21.0.3 [ OK ] Checked version jar [ OK ] Checked 3887 assets version 17 [ OK ] Checked 78 class and 0 native libraries [ OK ] Using logger client-1.12 [ OK ] Download: 3/3 54.4 MB @ 22.5 MB/s

ERROR StatusLogger Invalid URL C:/Users/username/AppData/Roaming/.minecraft/assets/log_configs/client-1.12.xml java.net.MalformedURLException: unknown protocol: c at java.base/java.net.URL.(URL.java:779) at java.base/java.net.URL.of(URL.java:913) at java.base/java.net.URI.toURL(URI.java:1172) at org.apache.logging.log4j.core.config.ConfigurationSource.fromUri(ConfigurationSource.java:334) at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:488) at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:481) at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:402) at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:321) at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:705) at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:735) at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:260) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:258) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:46) at org.apache.logging.log4j.LogManager.getContext(LogManager.java:177) at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:678) at net.fabricmc.loader.impl.game.minecraft.Log4jLogHandler.getLogger(Log4jLogHandler.java:58) at net.fabricmc.loader.impl.game.minecraft.Log4jLogHandler.log(Log4jLogHandler.java:51) at net.fabricmc.loader.impl.util.log.BuiltinLogHandler.replay(BuiltinLogHandler.java:128) at net.fabricmc.loader.impl.util.log.Log.init(Log.java:34) at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.setupLogHandler(MinecraftGameProvider.java:386) at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.initialize(MinecraftGameProvider.java:357) at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:140) at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68) at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

mindstorm38 commented 1 month ago

Thanks for the report! It seems that the version of java running is a Linux one, is it possible? I don't understand why log4j can't understand a windows-style path for the configuration... Could you check that?

However this doesn't explain why portablemc is building windows-style path but at the same time is using a Linux JVM

okadakenichi commented 1 month ago

I use Windows JVM due to the native library of LWJGL.

Python under MSYS2 environment converts path, and somewhere is wrong along the path conversion. https://www.msys2.org/docs/filesystem-paths/#windows-unix-path-conversion

mindstorm38 commented 1 month ago

I put this in triage because I first need to reproduce it on my side to get a better understanding...