-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Bump versions of OSGi testing dependencies for JDK 9 support #6937
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
Conversation
I've also pushed a config change to make the test pass. |
You make it look so easy. Do you even break a sweat? What season is it down under? |
build.sbt
Outdated
@@ -645,6 +645,7 @@ def osgiTestProject(p: Project, framework: ModuleID) = p | |||
) | |||
}, | |||
Keys.test in Test := (Keys.test in Test).dependsOn(packageBin in Compile).value, | |||
Keys.testOnly in Test := (Keys.test in Test).dependsOn(packageBin in Compile).value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't even understand this, sorry. Why isn't it Keys.testOnly
on RHS? This is why for years now I demur from learning sbt internals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo on my part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a fix. I tested it by ensuring that I could add a ???
to the implementation of reflection and witness the failure from:
> osgiTestEclipse/testOnly
-- tools.test.osgi.BasicTest tools.test.osgi.libonly.BasicLibraryTest
tools.test.osgi.reflection.basic.BasicReflectionTest tools.test.osgi.reflection.toolbox.ReflectionToolBoxTest
> osgiTestEclipse/testOnly
-- tools.test.osgi.BasicTest tools.test.osgi.libonly.BasicLibraryTest
tools.test.osgi.reflection.basic.BasicReflectionTest tools.test.osgi.reflection.toolbox.ReflectionToolBoxTest
> osgiTestEclipse/testOnly tools.test.osgi.reflection.basic.BasicReflectionTest
...
[error] Test tools.test.osgi.reflection.basic.BasicReflectionTest.basicMirrorThroughOsgi failed: scala.NotImplementedError: an implementation is missing, took 0.886 sec
[error] at scala.Predef$.$qmark$qmark$qmark(Predef.scala:341)
This allows them to run under JDK10. The specific problem was resolving the `@jdk.internal.HotSpotInstrinsicCandidate` annotation on `Object.hashCode`, which happens when runtime reflection loads the class symbol for Object. Related docs: https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/pages/54263890/Configuration+Options#ConfigurationOptions-bootDelegationPackages https://ops4j1.jira.com/wiki/spaces/paxrunner/pages/11665431/Boot+delegation+packages
7b6828d
to
b536780
Compare
And configure the test OSGi containers to expose
jdk.internal
from the platform (aka boot) classloader, which we need to resolve@jdk.internal.HotSpotIntrinsicCandidate
when entering so-annotated methods, e.g.Object.hashCode
.