You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2023/01/24 13:04:00 UTC

[jira] [Comment Edited] (COMPRESS-634) Pack200 Fails to Pack Jars with Module Declarations

    [ https://issues.apache.org/jira/browse/COMPRESS-634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17680210#comment-17680210 ] 

Gary D. Gregory edited comment on COMPRESS-634 at 1/24/23 1:03 PM:
-------------------------------------------------------------------

[~bmarcaur] 

I am guessing there is more to do than update test fixtures. Probably adding support so that when the module info is read, it can be written out again.

Feel free to create a PR on GitHub.

 


was (Author: garydgregory):
[~bmarcaur] 

I am guessing there is more to do than update test fixtures. Probably adding support so that when the module info is read, it can be written out again.

Feel free to create a PR on GitHub. This is likely to be not trivial.

 

> Pack200 Fails to Pack Jars with Module Declarations
> ---------------------------------------------------
>
>                 Key: COMPRESS-634
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-634
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>    Affects Versions: 1.21
>            Reporter: Brandon Marc-Aurele
>            Priority: Major
>
> 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:
> {code:java}
> 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) {code}
> [Here|https://github.com/bmarcaur/commons-compress/commit/ff9af724d668c67b2746775711cdaed123bd42bb] is a minimal repro commit. I used the {{HelloWorld.java}} and added an empty module like:
> {code:java}
> module reproModule {} {code}
> 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|https://github.com/bmarcaur/commons-compress/commit/f782c0160e10e67d6c294f69a57e06c549c8c0ef], 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".|https://github.com/AlexLandau/commons-compress-asm-error/blob/develop/src/test/java/com/github/alexlandau/commonscompressrepro/ReprosTest.java#L29]
> Let me know if there is any other context I can provide. Thank you!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)