-
Notifications
You must be signed in to change notification settings - Fork 850
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
Try a different strategy for Java versions #1627
Conversation
16a0de4
to
2dbb80d
Compare
Not been able yet to try this out in my setup to might have a m moment over the weekend |
FWIW this works fine in the CI/CD pipeline, and it makes the overall CI/CD
pipeline run about two minutes faster. (Out of nearly 45 minutes.)
The main impact of this is that if you have multiple JVMs on your machine,
Gradle will always pick Java 11 to build and test unless you ask for a
different JVM for testing.
The downside is that if you don't have Java 11, I believe that Gradle will
not build.
…On Fri, Sep 13, 2024 at 8:58 AM Paul Bakker ***@***.***> wrote:
Not been able yet to try this out in my setup to might have a m moment
over the weekend
—
Reply to this email directly, view it on GitHub
<#1627 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD7I23YWP7N42VNBEN52MLZWMDTZAVCNFSM6AAAAABOELQCMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBZGI4DENBXGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Little later, but got around to it now. The altered setup results in all projects being setup by Gradle to use Java 11 now in Eclipse, including the test project. So the test project will compile with Java 11, but when runnign the tests, it'll run with another Java version if RHINO_TEST_JAVA_VERSION is set, but only if the tests are executed through Gradle. Personally I setup (JUnit) Test Configurations in Eclipse manually and when I do that I specify the Java version to use anyway, so that works as well. So I think this PR works as intended :-) Only question I have left is whether the usage of java > toolchain requires anything else from devs checking out Rhino? For me it worked out of the box, but I've done some stuff with toolchains in the past, so maybe I've already got some stuff configured on my machine and therefor it worked straight away |
Another Q: when running the Test262 Test Suite with the |
2dbb80d
to
4ced4f5
Compare
OK -- this is an entirely different approach now, inspired by this article, which points out, among other things, that running Gradle and compiling on the latest JDK is a good idea: https://jakewharton.com/gradle-toolchains-are-rarely-a-good-idea/ The idea is this:
To make this work, since "google-java-format" (used by Spotless) is still sensitive, I had to upgrade it to the latest version, which does not run on Java 11. And the new version requires that we reformat some stuff, so the yak is being shaved here. So the upside of all this is the following:
|
1785475
to
976c4d8
Compare
The latest version will fail to run the tests if "updateTest262properties" is set and we're not testing on Java 11. Given that, I'd like to go ahead and merge this as letting people use Java 21-based build tools is a nice improvement. |
Unfortunately haven't gotten around to testing it, but just looking at the changes it looks good to me! |
Always build using Java 11, and rely on Gradle to make that happen. Support tests running on different versions via an environment variable.
These are the changes driven by spotless when we upgrade google-java-format from 1.10.0, which is very old, to 1.23.0, which is the latest.
Rely on the RHINO_TEST_JAVA_VERSION environment variable to cause tests to run on a different Java version, using Gradle toolchains. The "updateTest262properties" flag will now not allow the tests to run unless testing with Java 11.
976c4d8
to
de8fd0e
Compare
Merging this -- it means that we can now all build with newer Java versions but still should use Java 11 before updating test262 -- if that causes confusion we may have to address it in the test262 infrastructure. |
Always build using Java 11, and rely on Gradle to make that happen. Support tests running on different versions via an environment variable.
This is an experiment to see what GitHub Actions does.