Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.21
-
None
-
None
Description
Using commons-compress version 1.21+ (move to native pack algorithm) fails to pack jars with module declarations. It fails with the following error/stacktrace:
java.lang.UnsupportedOperationException: Module requires ASM6 at org.objectweb.asm.ClassVisitor.visitModule(ClassVisitor.java:153) at org.objectweb.asm.ClassReader.readModuleAttributes(ClassReader.java:781) at org.objectweb.asm.ClassReader.accept(ClassReader.java:580) at org.apache.commons.compress.harmony.pack200.Segment.processClasses(Segment.java:160) at org.apache.commons.compress.harmony.pack200.Segment.pack(Segment.java:110) at org.apache.commons.compress.harmony.pack200.Archive.doNormalPack(Archive.java:128) at org.apache.commons.compress.harmony.pack200.Archive.pack(Archive.java:98)
Here is a minimal repro commit. I used the HelloWorld.java and added an empty module like:
module reproModule {}
These are the contents of hw-module.jar.
I ran in to this issue trying to move a large internal repo from 1.20 to 1.22 following our back and forth on COMPRESS-582.
Just as a matter of exploration I also attempted to change the ASM level within commons-compress, but doing so caused a number of tests to fail locally due to the jars not being identical after a packing round trip. I am not sure the SOP for updating the comparison Jars or if this is indicative of an issue with the change.
To prove that increasing the ASM level allows us to pack jars with modules I extended our previous repro with a new test exemplifying a very hacky "fix".
Let me know if there is any other context I can provide. Thank you!