Connector icon indicating copy to clipboard operation
Connector copied to clipboard

Mods relying on Guava's `ClassPath` are broken.

Open zenfyrdev opened this issue 2 years ago • 2 comments

Describe the bug

Same as title.

Steps to reproduce

  1. Create ClassPath from current ClassLoader.
  2. No class files discovered.

Logs

Silent failures.

Additional context

I'm aware that ClassPath doesn't really work on Forge by default, as it requires a URLClassLoader somewhere in the hierarchy, which neither TransformingClassLoader nor ModuleClassLoader are, but some mods on Fabric use it.

zenfyrdev avatar Dec 01 '23 09:12 zenfyrdev

Can you list an example mod that uses this for testing purposes?

Su5eD avatar Dec 11 '23 15:12 Su5eD

My own Andromeda (I'm so sorry 😅) to discover modules and mixins and Fabrication, in the past, also to discover mixins. Now they use an auto-generated classpath file, but it will fallback to ClassPath if the file is removed from the jar.

Btw, I don't think it can be easily fixed, since even if you extract URLs from the ModuleClassLoader, those URLs use the UnionFileSystem.

zenfyrdev avatar Dec 11 '23 15:12 zenfyrdev

Unfortunately I can't think of any way to avoid this on our side, sorry. Forge and Neo both use UnionFS down to the very core, and it's likely not gonna change anytime soon. Even if we were to process the union URLs and try to get the primary source, we can't account for nested JARs from which mods are loaded. If Neo decides to drop UnionPaths in the future, I'll make sure to post and update here.

Su5eD avatar Aug 01 '24 19:08 Su5eD