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

Fix conflicts caused by MappingsMerger #1171

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

SpaceWalkerRS
Copy link
Contributor

The mappings merger uses a MappingNsCompleter visitor to fill any empty spots in the official namespace. According to this commit this was done to fix unobfuscated methods not having parameters or javadocs. However, this solution can lead to conflicts, in particular in pre-1.3 mod environments, where the client and server have separate official namespaces.

To resolve this I implemented a modified version of the MappingNsCompleter visitor, that only fills empty spots for un-changed mappings. This will catch any unobfuscated methods as they have the same name in both the intermediary and named namespaces, but it's not perfect as it will also catch any members that are not mapped.

I also had to modify TinyRemapperHelper because it did not take empty mapping src names into account. Is there any reason Loom is not using Tiny Remapper's TinyUtils.createMappingProvider?

@modmuss50
Copy link
Member

is there any reason Loom is not using Tiny Remapper's TinyUtils.createMappingProvider?

No, there is no reason other than it hasnt been moved over to it. I will handle this in a seperate PR.

Copy link
Member

@modmuss50 modmuss50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks fine, have you done any testing for this? Some automated tests would be great, especially to ensure that it doesnt break again.

@SpaceWalkerRS
Copy link
Contributor Author

is there any reason Loom is not using Tiny Remapper's TinyUtils.createMappingProvider?

No, there is no reason other than it hasnt been moved over to it. I will handle this in a seperate PR.

Alrighty. I think for this to work FabricMC/tiny-remapper#133 needs to be merged as well.

@SpaceWalkerRS
Copy link
Contributor Author

Change looks fine, have you done any testing for this? Some automated tests would be great, especially to ensure that it doesnt break again.

I did test a local build to make sure it actually fixed the conflicts, but I didn't test any modern version mod project to make sure that wasn't broken.

As for adding tests, I think it should be fine to make some tests with mock mappings and test the MappingsMerger directly, right? As opposed to a full integration test running a gradle build. I'll work on that and see what I can come up with.

@SpaceWalkerRS SpaceWalkerRS force-pushed the fix-completed-mappings branch 3 times, most recently from 30defa5 to a9762a9 Compare September 20, 2024 20:41
@SpaceWalkerRS
Copy link
Contributor Author

I had a go at adding a test for the MappingsMerger. Let me know if you have any issues with it.

@modmuss50 modmuss50 merged commit bc58b6f into FabricMC:exp/1.8 Sep 24, 2024
89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants