This repository was archived by the owner on Jun 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Update API version in visitors to ASM5 #18
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We are using "org.pantsbuild" % "jarjar" % "1.6.0" in the SBT build for Scala. We see an error when we call JarJar with bytecode that contains the `MethodParameters` attribute. This seems to be due to the fact that you updated to ASM5, but did not update all visitors in this project to the ASM5 api version. The ASM5's `ClassReader` visits these parameters, ultimately with `EmptyClassVisitor`, which runs into: ``` public void visitParameter(String name, int access) { if (api < Opcodes.ASM5) { throw new RuntimeException(); } if (mv != null) { mv.visitParameter(name, access); } } ``` See: https://docs.oracle.com/javase/tutorial/reflect/member/methodparameterreflection.html for discussion of the `MethodParameters` classfile attribute. It is not enabled by default, one needs to enable it with: ``` javac -help 2>&1 | grep parameters -parameters Generate metadata for reflection on method parameters ``` No test is included here as I'm not familiar with pants to know how to add this.
The stacktrace that we observed in the debugger:
Without the debugger, we just saw:
Due to the way that the exception handling in JarJar employs the |
retronym
added a commit
to retronym/scala
that referenced
this pull request
May 10, 2016
- Intercept incorrect "binary conflict" warning issued by SBT. Fixes scala/scala-dev#100 - Add a simple way to disable use of JarJar during developer builds, as a workaround for scala/scala-dev#146. I've submitted a PR upstream to fix the root problem: pantsbuild/jarjar#18 - Disable info level logging for dependency resolve/download.
retronym
added a commit
to retronym/scala
that referenced
this pull request
May 10, 2016
- Intercept incorrect "binary conflict" warning issued by SBT. Fixes scala/scala-dev#100 - Add a simple way to disable use of JarJar during developer builds, as a workaround for scala/scala-dev#146. I've submitted a PR upstream to fix the root problem with parameter names: pantsbuild/jarjar#18 - Disable info level logging for dependency resolve/download.
Thanks for the PR @retronym ! If you're able to extend one of the test classes in |
Thanks! Went ahead and merged #19 |
adriaanm
pushed a commit
to adriaanm/scala
that referenced
this pull request
May 16, 2016
- Intercept incorrect "binary conflict" warning issued by SBT. Fixes scala/scala-dev#100 - Add a simple way to disable use of JarJar during developer builds, as a workaround for scala/scala-dev#146. I've submitted a PR upstream to fix the root problem with parameter names: pantsbuild/jarjar#18 - Disable info level logging for dependency resolve/download.
adriaanm
pushed a commit
to adriaanm/scala
that referenced
this pull request
May 18, 2016
- Intercept incorrect "binary conflict" warning issued by SBT. Fixes scala/scala-dev#100 - Add a simple way to disable use of JarJar during developer builds, as a workaround for scala/scala-dev#146. I've submitted a PR upstream to fix the root problem with parameter names: pantsbuild/jarjar#18 - Disable info level logging for dependency resolve/download.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are using "org.pantsbuild" % "jarjar" % "1.6.0" in the SBT
build for Scala.
We see an error when we call JarJar with bytecode that contains
the
MethodParameters
attribute.This seems to be due to the fact that you updated to ASM5, but
did not update all visitors in this project to the ASM5 api
version.
The ASM5's
ClassReader
visits these parameters, ultimatelywith
EmptyClassVisitor
, which runs into:See:
https://docs.oracle.com/javase/tutorial/reflect/member/methodparameterreflection.html
for discussion of the
MethodParameters
classfile attribute. It isnot enabled by default, one needs to enable it with:
No test is included here as I'm not familiar with pants to know how to
add this.