Repository navigation
Conversation
The build compiles with -release set to JdkFloor, and CI builds on that JDK. On a newer JDK the compiler sees only the public API of the older one, so a name that a package private member of a JDK class makes ambiguous compiles locally and fails on CI with E049. Pull request 426 was green at the gate and red on CI for this reason. bin/lib/env.sh now reads JdkFloor from project/Toolchain.scala. When the java on the PATH is another JDK, it looks for one of the right version in JAVA_HOME and under the directories of EEZO_JDK_DIRS, which default to the sdkman candidates, the two macOS JavaVirtualMachines directories and /usr/lib/jvm, and puts it first on the PATH. When there is none, bin/fast warns and runs, and bin/gate refuses, since its green would not be the green of CI. EEZO_GATE_ANY_JDK=1 runs the gate anyway. The workflows keep a copy of the JDK version, so the build now checks at load that each java-version in .github/workflows equals JdkFloor, as it already checks sbt.version for the examples build. GateJdkSuite runs the scripts in a temporary checkout with fake JDKs and a fake sbt, on both axes of the plugin build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The build compiles with
-releaseset toJdkFloor, which is 25, and CI builds on JDK 25. sbt runs on thejavaon thePATH, and that can be a newer JDK. On a newer JDK the compiler reads only the public API of JDK 25, so it does not see the package private members of JDK classes. Code that CI refuses can then compile locally.Pull request #426 shows this. A local value
nameinside an anonymousClassLoadersubclass compiled locally on JDK 26, andbin/gateprinted GATE GREEN. CI failed with[E049] Reference to name is ambiguous, becauseClassLoaderhas a package privatename(). So the gate did not run what CI runs.What
bin/lib/env.shreadsJdkFloorfromproject/Toolchain.scala. That is the one source of the version.javaon thePATHis another JDK,env.shlooks for a JDK of that version inJAVA_HOME, then under the directories inEEZO_JDK_DIRS. The default directories are~/.sdkman/candidates/java,~/Library/Java/JavaVirtualMachines,/Library/Java/JavaVirtualMachinesand/usr/lib/jvm. It reads thereleasefile of each JDK and needs no other tool. It puts the JDK it finds first on thePATH, setsJAVA_HOMEand prints one line about it.env.shprints a warning on stderr. The warning names the JDK found, the JDK wanted, where it looked, and how to install or select one.bin/fastwarns and runs. This is the request.bin/gaterefuses to run and printsGATE RED: jdk.EEZO_GATE_ANY_JDK=1runs it anyway, and the gate then says that its green is not the green of CI.Toolchain. So the build now checks at load that eachjava-versionin.github/workflowsequalsJdkFloor. This is the same style as thesbt.versioncheck of the examples build.bin/gate, the usage ofbin/fastand README Contributing describe the new behaviour.Why the gate refuses and does not warn
The gate claims one thing: green here is green on the pull request. On another JDK that claim is false, and #426 shows that the gate then gives a wrong answer. A warning is easy to miss in a long log, and agents read only the last line. A refusal makes the last line true. The override keeps the gate usable on a machine that has no JDK 25, and it is explicit.
bin/fastis the quick loop and does not claim CI parity, so it only warns.How to review
bin/lib/env.sh: the JDK block after theROOTcheck. The messages are ineezo_jdk_switchedandeezo_jdk_warning.bin/gate:refuse_jdkand the check afterenv.sh.project/Toolchain.scala:assertWorkflowJdkMatches, called fromGlobal / onLoadinbuild.sbt.GateJdkSuite: each case runs the realbin/fastorbin/gate --dry-runin a temporary checkout, with fake JDKs and a fakesbton thePATH.How it was tested
GateJdkSuitein the plugin module runs on both axes of+test. It covers these cases:PATH: no message,PATHandJAVA_HOMEstay as they are.PATHand a JDK 25 is installed: under sdkman (a JDK 24 next to it is skipped), inJAVA_HOME, or in a macOSContents/Homebundle. sbt runs on the JDK 25.PATHand no JDK 25 is installed:bin/fastwarns and runs,bin/gaterefuses with exit 1 before any step, and withEEZO_GATE_ANY_JDK=1the gate runs its steps.JdkFloorare not read as the version./bin/bash3.2 of macOS does not have.On a machine whose default JDK is 26, with a JDK 25 under sdkman:
The defect of #426 is now caught locally. A test source with
val name = ...in a method, used insidenew ClassLoader(...) { ... }, gives this withbin/fast 'core/Test/compile':The same source compiles on JDK 26 when no JDK 25 is found, after the warning.
A
java-version: "24"inrelease.ymlstops the build at load:bin/gateprinted GATE GREEN with this change, and its first line was the JDK switch above.🤖 Generated with Claude Code