-
Notifications
You must be signed in to change notification settings - Fork 14
Runtime reflection of classes in the empty package broken under Java 9 #304
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
Comments
The underlying bug is tracked as scala/scala-dev#304 and blocks our SBT starting on JDK 9. This commit avoids using the empty package in our build definition.
The workaround is to move |
The underlying bug is tracked as scala/scala-dev#304 and blocks our SBT starting on JDK 9. This commit avoids using the empty package in our build definition. After this change, I needed to manually clean the class files from the build definition as follows, which might indicate a bug in SBT. $ sbt ... /Users/jz/code/scala-java9-ci/build.sbt:0: warning: imported `BuildSettings' is permanently hidden by definition of object BuildSettings import ..., _root_.scala.build.BuildSettings, ... ^C % rm -rf project/target/scala-2.10/sbt-0.13/classes/ % sbt # okay second time
Generally isn't using the root/empty package there-be-dragons territory? Akin to using dollars in type names? |
sbt doesn't help by setting a bad example |
REPL free reproduction:
|
Okay, finally took another look at this. Here's the behaviour difference in Java reflection that we're stumbling into:
The |
work around scala/scala-dev#304 fixes scala#33
@eed3si9n @dwijnand is there any possibility of an sbt 0.13.17 release that has some kind of workaround for this? this is already turning into a big problem for the Scala community build on JDK 9 — nearly every project I've tried to add has hit it, because practically any build uses some sbt plugin that has code in the empty package |
I'd be happy to ship 0.13.x if we have some workaround for better JDK 9 compatibility. |
Will scala/scala#6097 be backported to 2.10 and a release of 2.10 cut with it? Otherwise we can only fix this in sbt 1. |
We're considering that in scala/scala#6113 |
We put all our build-level `.scala` files in a `package build`, rather than in the default package, to work around scala/scala-dev#304. This does not yet allow to build the test suite.
We put all our build-level `.scala` files in a `package build`, rather than in the default package, to work around scala/scala-dev#304. This does not yet allow to build the test suite.
By contrast, if we place
Test
in some package,p1
:The same problem exists in a more vanilla classloader setup:
This issue prevents startup of SBT under Java 9 (even after using the patched SBT in sbt/sbt#2951 with the instructions) if the build definitition contains an
AutoPlugin
with anautoimport
module, like this one in scala/scala.The text was updated successfully, but these errors were encountered: