Skip to content

remapJar fails in mixed obfuscated/unobfuscated multi-project build when using useLegacyMixinAp #1477

@Fallen-Breath

Description

@Fallen-Breath

Environment

  • Fabric Loom: 1.14.6
  • JDK 25

To-Reproduce

Create a multi-subproject mod dev environment. The root gradle project contains 2 subprojects

  • Project A uses net.fabricmc.fabric-loom-remap, targetting an obfuscated Minecraft
  • Project B uses net.fabricmc.fabric-loom, targetting an unobfuscated Minecraft

In project A, enable useLegacyMixinAp

loom {
	mixin {
		useLegacyMixinAp = true
	}
}

Then perform the build gradle command on project A. The following error will occur during the remapJar job:

* What went wrong:
Execution failed for task ':A:remapJar'.
> Error while evaluating property 'tinyRemapperServiceOptions' of task ':A:remapJar'.
   > Failed to query the value of task ':A:remapJar' property 'tinyRemapperServiceOptions'.
      > Cannot get mappings configuration in a non-obfuscated environment

Here's the stack trace

java.lang.RuntimeException
	at net.fabricmc.loom.extension.LoomGradleExtensionImpl.getMappingConfiguration(LoomGradleExtensionImpl.java:177)
	at net.fabricmc.loom.extension.LoomGradleExtensionImpl_Decorated.getMappingConfiguration(Unknown Source)
	at net.fabricmc.loom.task.service.MixinAPMappingService.lambda$createOptions$1(MixinAPMappingService.java:113)
	at net.fabricmc.loom.util.gradle.GradleUtils.lambda$allLoomProjects$1(GradleUtils.java:58)
        // ...
	at net.fabricmc.loom.util.gradle.GradleUtils.allLoomProjects(GradleUtils.java:56)
	at net.fabricmc.loom.task.service.MixinAPMappingService.createOptions(MixinAPMappingService.java:110)
	at net.fabricmc.loom.task.service.TinyRemapperService.lambda$createOptions$0(TinyRemapperService.java:110)
	at net.fabricmc.loom.util.service.ServiceType.lambda$create$0(ServiceType.java:48)
	at net.fabricmc.loom.util.service.ServiceType.lambda$maybeCreate$1(ServiceType.java:72)
        // ...

Seems like the code that interating through all projects forgets to ignore other projects which targets unobfuscated Minecraft

GradleUtils.allLoomProjects(thisProject.getGradle(), project -> {
final LoomGradleExtension extension = LoomGradleExtension.get(project);
if (!mappingId.equals(extension.getMappingConfiguration().mappingsIdentifier)) {
// Only find mixin mappings that are from other projects with the same mapping id.
return;
}
processProject.accept(project);
});

Other Information

Multiple subprojects targetting different Minecraft versions

The mod is an multiversion mod where each subproject targets an different MC version

An actual github action failure log on this issue: https://github.com/TISUnion/Carpet-TIS-Addition/actions/runs/20345340953/job/58456066156, it also contains a full error stacktrace

useLegacyMixinAp

There's no issue if I remove the useLegacyMixinAp thing in project A

The reason why I want to use useLegacyMixinAp, is that if without, there will be some useless remap compilation warning during the build task, even if remap = false is already set

Cannot remap xxx because it does not exists in any of the targets [yyyy]

More information on fabric discord here: https://discord.com/channels/507304429255393322/842691768175951942/1435348130194391060

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions