eed3si9n / jarjar-abrams

an experimental Scala extension of Jar Jar Links

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jarjar mangles classes even when no meaningful transformation applied

cdkrot opened this issue · comments

Hey! I have the following problem.

In case big module and all it dependent jars are going through jarjar shading, there will probably be dependent jars which are not actually modified by shading.

However because they go through jarjar, it unpacks, revisits, and repacks the class back resulting a technically different class from before shading (even class size can be different from original). This upsets classpath checkers (i.e. checking that runtime classpath has at most 1 unique class version).

I propose to add a change so that jarjar can detect whether the meaningful transformation to class file has happened and if not, the class is unmodified.

If this aligns with your vision as well, I can share the actual implementation scratch I have. It augments MethodSignatureProcessor and JarTransformerChain so that they track whether the meaningful transformation to class file has happened and if not, the original byte array is returned.

cc @AlessandroPatti

I propose to add a change so that jarjar can detect whether the meaningful transformation to class file has happened and if not, the class is unmodified.

That sounds like a good idea.

Awesome! I opened a pull request with proposed changes