Skip to content

Conversation

@jisantuc
Copy link
Owner

@jisantuc jisantuc commented Feb 3, 2022

This PR includes a reproduction of the error encountered in scala-exercises/sbt-exercise#117, but with way less going on. Moreover, it reproduces the error _without_dynamic class loading, and without the special Global subclass.

The two reproductions are:

  • in SourceExtractSpec, initialize a CompilerJava class whose compile method similarly defers to a Compiler case class. It doesn't do anything interesting here though -- it just attempts to initialize a vanilla Global.Run() then return an empty array. This results in:
[info]   No RuntimeVisibleAnnotations in classfile with ScalaSignature attribute: package object collection
[info]      while compiling: <no file>
[info]         during phase: globalPhase=<no phase>, enteringPhase=<some phase>
[info]      library version: version 2.12.13
...
  • in sbt-source-extract/simple/test, I attempt to call the task created by this plugin, that does the dynamic classloading song and dance, and get the same error

This is exciting because it means that what's wrong has nothing to do with sbt plugins or dynamic classloading, neither of which is terra firma for me.

CI will only run the first test, but if you clone and check out this branch you can run compiler / test and scripted separately to see that they both reproduce the error.

Closes #2

Closes #3

James Santucci added 4 commits February 2, 2022 13:27
this change makes it so that I can separately test the classpath
manipulation games to reproduce and the attempt to initialize
from Scala. it turns out the problem is reproducible in pure scala!
which is great because it probably means I don't have to think about
dynamic classloading ever again.
@jisantuc jisantuc merged commit d5e099a into main Feb 3, 2022
@jisantuc jisantuc deleted the debug-1/dynamic-class-loading-replication branch February 3, 2022 16:13
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

Successfully merging this pull request may close these issues.

Debug 2 -- load up a compiler without reflection Debug 1 -- load up a compiler by reflection

2 participants