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

[FG6] reobfJar fails when Mixin writes an empty tsrg file #919

Closed
SquidDev opened this issue May 23, 2023 · 1 comment
Closed

[FG6] reobfJar fails when Mixin writes an empty tsrg file #919

SquidDev opened this issue May 23, 2023 · 1 comment
Assignees
Labels
bug Relates to or reports a bug in the codebase FG6 This request is for FG 6

Comments

@SquidDev
Copy link
Contributor

Sometimes it's possible to have Mixin configured on a project but have it write an empty xxx-mappings.tsrg file. In this case, the reobfJar task will fail due to an out-of-bounds in srgutils:

Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
        at net.minecraftforge.srgutils.InternalUtils.loadNamed(InternalUtils.java:39)
        at net.minecraftforge.srgutils.InternalUtils.load(InternalUtils.java:28)
        at net.minecraftforge.srgutils.IMappingFile.load(IMappingFile.java:27)
        at net.minecraftforge.srgutils.IMappingFile.load(IMappingFile.java:22)
        at net.minecraftforge.gradle.userdev.tasks.RenameJarInPlace.apply(RenameJarInPlace.java:66)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Reproduction steps

  • Download the MDK and convert it to use ForgeGradle 6.
  • Add the Mixin Gradle plugin, and set up MixinGradle with the following:
    dependencies { annotationProcessor("org.spongepowered:mixin:0.8.5:processor") }
    mixin { add(sourceSets.main, "examplemod.refmap.json") }
    Note no mixin configs are configured.
  • Run ./gradlew reobfJar. The build should fail as build/tmp/compileJava/compileJava-mappings.tsrg is empty.
@Matyrobbrt Matyrobbrt added bug Relates to or reports a bug in the codebase FG6 This request is for FG 6 labels May 23, 2023
@SizableShrimp SizableShrimp self-assigned this May 24, 2023
@SquidDev
Copy link
Contributor Author

Thank you!

Su5eD added a commit to Sinytra/ForgifiedFabricAPI that referenced this issue Jun 5, 2023
We were loading an outdated version of srgutils from FART.
MinecraftForge/ForgeGradle#919
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Relates to or reports a bug in the codebase FG6 This request is for FG 6
Projects
None yet
Development

No branches or pull requests

3 participants