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

Stop shading ASM? #1198

Closed
ronshapiro opened this issue Jul 13, 2018 · 12 comments
Closed

Stop shading ASM? #1198

ronshapiro opened this issue Jul 13, 2018 · 12 comments

Comments

@ronshapiro
Copy link
Collaborator

Per #1169 (comment), maybe it's time to stop shading ASM?

That will allow people to bring their own copy of ASM if they so choose, and will unblock them when new versions of the JDK come out and Guice hasn't updated yet. We'd obviously provide a default in our maven pom for those that aren't ahead of the game. This could be helpful as the JDK continues its 6-month release cadence.

@ronshapiro ronshapiro mentioned this issue Jul 13, 2018
@sameb
Copy link
Member

sameb commented Jul 13, 2018

sgtm, i believe the reason it's shaded is because historically asm was very binary incompatible with prior releases... but i think they changed that as of recent releases.

@mkurz
Copy link
Contributor

mkurz commented Jul 13, 2018

That comment from @mcculls might be relevant here as well:

Note that the build already produces a version of Guice that doesn't bundle asm or cglib:

http://repo1.maven.org/maven2/com/google/inject/guice/4.2.0/guice-4.2.0-classes.jar

This is a jar of the Guice classes before any JarJar'ing.

Also if you don't need AOP then there's the "no_aop" jar which doesn't use asm/cglib at all:

http://repo1.maven.org/maven2/com/google/inject/guice/4.2.0/guice-4.2.0-no_aop.jar

@cushon
Copy link
Contributor

cushon commented Aug 25, 2018

unblock them when new versions of the JDK come out and Guice hasn't updated yet

I don't think thing it's sufficient to not shade ASM, since the API level will also need to be updated to support new class file versions:

@davido
Copy link

davido commented Aug 25, 2018

I don't think thing it's sufficient to not shade ASM, since the API level will also need to be updated to support new class file versions:[...]

And for experimental support of JDK11 in Guice it could only use experimental Opcodes.ASM7_EXPERIMENTAL: [1].

https://gitlab.ow2.org/asm/asm/blob/master/asm/src/main/java/org/objectweb/asm/Opcodes.java#L55

@davido
Copy link

davido commented Aug 26, 2018

And for experimental support of JDK11 in Guice it could only use experimental Opcodes.ASM7_EXPERIMENTAL: [1].

Done in this PR #1203. With this diff Gerrit can be built with JDK11, with Bazel and with VanillaJavaBuilder (https://gerrit-review.googlesource.com/c/gerrit/+/194040):

$ bazel build --host_javabase=:jdk11 --host_java_toolchain=//:toolchain_vanilla --java_toolchain=//:toolchain_vanilla //:release
[...]
INFO: Analysed target //:release (0 packages loaded).
INFO: Found 1 target...
Target //:release up-to-date:
  bazel-bin/release.war
INFO: Elapsed time: 0.431s, Critical Path: 0.19s

@mkurz
Copy link
Contributor

mkurz commented Sep 1, 2018

BTW: asm 6.2.1 is available

@sameb
Copy link
Member

sameb commented Sep 20, 2018

as others have mentioned, not shading asm won't actually resolve this since the code will need to change (both in guice & cglib) to support the newer JDK features.

@sameb sameb closed this as completed Sep 20, 2018
@mkurz
Copy link
Contributor

mkurz commented Sep 20, 2018

@sameb Since you are here:
Given that Java 11 will be released next week and a couple of days later ASM 7.0 will be released as well - how likely will it be you upgrade to ASM 7 and then release a new Guice version?
I work on the Play Framework and there is a new release planned within the next couple of weeks. However we would need a new Guice version with AMS 7 so that the new release also run on Java 11.

Any ETA?

@sameb
Copy link
Member

sameb commented Sep 20, 2018

if you ping this thread the day asm7 is released, i'll try to release a new cglib & guice same day or next day (assuming no unexpected problems arise).

@mkurz
Copy link
Contributor

mkurz commented Sep 20, 2018

@sameb Great, thanks! I will ping you for sure 😄

openstack-gerrit pushed a commit to openstack-infra/gerrit that referenced this issue Sep 25, 2018
This update includes upgrade of ASM dependency to 6.2.1 that is required
for JDK 10 support. Gerrit is already using the right version of ASM
library, but Guice is shading ASM in distribution. There is a feature
request to stop shading ASM in Guice: [1], but it's not easily doable,
because Guice needs to specify ASM version it's using internally.

[1] google/guice#1198
Change-Id: If14990d81ee79c38307b94514fcbb07118f66111
@mkurz
Copy link
Contributor

mkurz commented Oct 27, 2018

Ping @sameb - ASM 7 is out! See #1205 (comment)

@mkurz
Copy link
Contributor

mkurz commented Jun 28, 2020

ASM 8.0.1 available.

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

No branches or pull requests

5 participants