fabric-loom icon indicating copy to clipboard operation
fabric-loom copied to clipboard

Print warning if `archivesBaseName` is not set, or is set to 'fabric'

Open lucko opened this issue 3 years ago • 3 comments

I've been having some fun tracking down a really weird conflict between one of my mods and another called Chunky.

It turns out the issue was caused by both mods using a multi-module layout (and calling their Fabric module 'fabric') and not explicitly setting the Gradle archivesBaseName property.

Loom uses this property to determine the name of the Mixin refmap file.. Obviously, two mods using a refmap file with the same name equals a bad time at runtime 😆

https://github.com/FabricMC/fabric-loom/blob/8e424f3f50e36b2eae5c7b501d159b2b8b6eac54/src/main/java/net/fabricmc/loom/LoomGradleExtension.java#L299-L301

At least for me, this INFO message was not visible when building in IntelliJ

I wonder whether it may be worth printing a message at a higher level (WARN or whatever) if the property is set to fabric?

relevant issue: https://github.com/lucko/LuckPerms/issues/2880

lucko avatar Mar 19 '21 20:03 lucko

perhaps a "better" solution would be to append 4-6 random base64 characters to the end of a refmap? if anybody needs to get at the refmap they should be parsing the fabric.mod.json anyway

TheGlitch76 avatar Mar 19 '21 21:03 TheGlitch76

I think the real soltuion here is having some better errors around conflicting refmap names

modmuss50 avatar Mar 19 '21 21:03 modmuss50

Ah, the irony. I PR'd the use of archivesBaseName because people weren't setting their projects' names (and with jitpack they get auto-inferred to build or something like that). This is round 2 :smile:

Juuxel avatar Mar 19 '21 21:03 Juuxel