sbt / sbt-assembly

Deploy über-JARs. Restart processes. (port of codahale/assembly-sbt)
MIT License
1.95k stars 224 forks source link

Scala reflection is broken in shaded JARs #350

Closed gehnaphore closed 3 years ago

gehnaphore commented 6 years ago

When packages get renamed during shading, no changes are made to any the ScalaSignature annotations in those JARs. The result is that Scala reflection will fail silently.

I imagine the fix would be to read and rewrite the ScalaSignature annotations along with the bytecode changes made by JarJar. It it easy enough to decode the signature using scalap and rewrite the annotation using ASM, but I didn't see any way to modify and re-pickle the signature without extracting pieces of scalac.

eed3si9n commented 5 years ago

Thanks. I should probably add this important fact to README so people won't try to shade a Scala library.

jeroentervoorde commented 4 years ago

I've started a PR on this:

https://github.com/sbt/sbt-assembly/pull/393

er1c commented 3 years ago

I believe this is fixed in 1.1.0

eed3si9n commented 3 years ago

This was fixed in 0.15.0, and 1.1.0 improves on that - https://github.com/sbt/sbt-assembly/releases/tag/v0.15.0