Jump to content

Signature mismatch between src and bin


octarine-noise

Recommended Posts

Hello

 

I was trying to move to Jenkins recently, and have run into a problem that prevents my code from compiling. It seems to me that the binary and source patches do not match.

 

To be more precise: the signature of the method net.minecraft.client.resources.IResourceManager.getResource() has a different signature in the forgeBin and forgeSrc artifacts. It has a throws IOException clause in forgeSrc, but not in forgeBin, and since implementations are not allowed to break the interface contract, this leads to compile errors.

 

So if I use setupDecompWorkspace I can compile my code just fine in Eclipse, and if I use setupDevWorkspace I could correct my code so it compiles against forgeBin. But I would lose source attachment in that case, which I don't like.

 

It also leaves me confused. Which signature is the "true" one I should code against? Is this a bug or just a misunderstanding on my part?

Link to comment
Share on other sites

So after digging some more, I have concluded that getting forgeBin into the project dependencies must have been a fluke, it's strictly runtime-only, and I should always compile against forgeSrc.

 

However, the same buildscript and gradle version will always use forgeSrc on my desktop for compiling, and use forgeBin on the Jenkins, so it could be server-specific. Except no other project on the same machine is having this problem.

 

Has something similar happened to anyone?

Link to comment
Share on other sites

Okay, so I managed to get it working in the end, after poking inside the internals of the ForgeGradle tasks. It seems the forgeSrc artifact will be used for compiling if it's available in the gradle cache, and forgeBin otherwise. I had to run setupDecompWorkspace once on the Jenkins server to create the decompiled artifact, and now all is well.

 

It just threw me off, because this makes builds not "stateless", i.e. not completely deterministic from its input, but dependent of previous actions taken outside of the build. I did not expect that.

 

I'd be grateful if someone with more in-depth knowledge of ForgeGradle could explain this to me. Is this normal? Why are the exceptions not in the signatures of the forgeBin artifact - is this also part of Mojang's obfuscation?

Link to comment
Share on other sites

This is by design. The forgeBin artifact is MUCH faster to create, and does not require that minecraft be decompiled like the forgeSRc artifact requires. As for the throwing of the IOException.. thats not really supposed to happen.. and is worth looking into. A similair error has been reported here:  https://github.com/MinecraftForge/ForgeGradle/issues/145

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.