8000 Bump versions of OSGi testing dependencies for JDK 9 support by retronym · Pull Request #6937 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 2 commits into from
Jul 20, 2018

Conversation

retronym
Copy link
Member
@retronym retronym commented Jul 16, 2018

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.

@scala-jenkins scala-jenkins added this to the 2.13.0-M5 milestone Jul 16, 2018
@retronym retronym requested a review from som-snytt July 16, 2018 01:03
@retronym
Copy link
Member Author

I've also pushed a config change to make the test pass.

@som-snytt
Copy link
Contributor

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,
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo on my part.

Copy link
Member Author

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
@retronym retronym force-pushed the topic/jdk10-osgi-test branch from 7b6828d to b536780 Compare July 16, 2018 03:43
@retronym retronym merged commit d71f4da into scala:2.13.x Jul 20, 2018
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.

3 participants
0