Skip to content

fix: make .sdkmanrc with SDKMAN's Oracle GraalVM and GraalVM Community identifiers, such as java=25.0.5.0+3-graal, select the build they name - #124

Merged
linghengqian merged 1 commit into
mainfrom
fix/sdkmanrc-graalvm-build-number
Nov 3, 2026
Merged

linghengqian merged 1 commit into
mainfrom
fix/sdkmanrc-graalvm-build-number

Conversation

@linghengqian

Copy link
Copy Markdown
Member

SDKMAN writes the fifth number of GraalVM's version after the +: sdk list java shows Oracle GraalVM as 25.0.5.0+3-graal and 25.4.4.1+1-graal, GraalVM Community as 25.4.4.1+1-graalce. SDKMAN's own download shows what the number is: https://broker.sdkman.io/download/java/25.0.5.0+3-graal/linuxx64 redirects to gds.oracle.com/api/20220101/artifacts/D31F8D13975942E3993AA792B3944F9F/content, which is the file Foojay lists as GraalVM 25.0.5.0.3 (graalvm-jdk-25.0.5.0.3_linux-x64_bin.tar.gz), a different download than 25.0.5 and 25.0.5.0.2 (three artifacts, three sha256, all java_version 25.0.5). 25.4.4.1+1-graal and 25.4.4+1-graal, the spelling the docs and tests had, both redirect to the artifact of 25.4.4.1.1.

ParseLegacyFile read that number as a build of the release 25.0.5, looked for the installed name 25.0.5+3-graal, which GraalVM never has, and fell back to the release 25.0.5-graal or the newest installed release of the major. So:

  • java=25.0.5.0+3-graal selected 25.0.5-graal when that is installed next to 25.0.5.0.3-graal. Both are installed by anyone who ran vfox install java@25-graal on 2026-10-20 and again now.
  • With a newer 25.0 build installed and no 25.0.5-graal, a project pinned to 25.0.5.0+3-graal moved to the newer one, and java=25.0.5.0+2-graal selected 25.0.5.0.3-graal over the installed 25.0.5.0.2-graal.
  • For Temurin and the other vendors, +8 is the vendor's build (25.0.5.0+8-tem redirects to Temurin's jdk-25.0.5+8), and the plugin looks for the installed 25.0.5+8-tem first, so a pinned build is kept there.

Change

  • hooks/parse_legacy_file.lua: for graal and graalce (sdkman_graalvm), an identifier A.B.C.D+N first looks for the installed name A.B.C.D.N (without trailing zeros, like the other names). Failing that it goes on as before: the name with the +, the release, the newest installed release of the major, with Oracle GraalVM's feature releases last.
  • tests/parse_legacy_file_test.lua: 12 cases. The ones above, java=25.4.4.1+1-graal and -graalce next to a newer release, a build that is not installed (25.0.5-graal next to 25.0.6-graal, 25.0.5.0.2-graal, only a feature release), no crossing to graalce, and the Temurin build as the contrast. 25.4.4+1-graal, the older spelling, stays a case: it matches no installed name and takes the newest release of 25 as before.
  • e2e (Linux and Windows): of the 25 builds vfox search java graal lists and the suite fakes as installed, a .sdkmanrc holding SDKMAN's identifier of each one with five numbers (GraalVMIdentifiers in tests/e2e/common, with a unit test) must select that build.
  • e2e (Linux): installing vfox ran curl ... | bash without pipefail, so a failed download passed as an install and the next step died with vfox: command not found. I hit it on the first run. It is pipefail and a retry now, like the other downloads.
  • Docs, English and Chinese: sdkmanrc.md (the sentence that called the number after the + SDKMAN's own rebuild count, and said the plugin does not look for a build, is narrowed: Temurin's +8 is the vendor's build and the plugin looks for it first; the new GraalVM paragraph and table row; the feature release spelled both ways), development.md, e2e.md and changes.md (Unreleased).

Verification

  • The new cases fail on the old hook and pass on the new one. vfox plugin test . (vfox 1.0.13) passes: 115 ParseLegacyFile cases (103 before), 90 PreUse, 116 PreInstall, and the rest.

  • Real vfox 1.0.13 with faked installs and a .sdkmanrc read by vfox env:

    .sdkmanrc installed before now
    25.0.5.0+3-graal 25.0.5.0.3, 25.0.5 25.0.5-graal 25.0.5.0.3-graal
    25.0.5.0+2-graal .2, .3, 25.0.5 25.0.5-graal 25.0.5.0.2-graal
    25.0.5.0+3-graal .2, .3, 25.0.5, 25.0.6 25.0.5-graal 25.0.5.0.3-graal
    25.4.4.1+1-graal the above and 25.4.4.1.1 25.4.4.1.1-graal 25.4.4.1.1-graal
    25.0.5.0+8-tem 25.0.5+8-tem, 25.0.6+7-tem 25.0.5+8-tem 25.0.5+8-tem
  • tests/e2e/linux with vfox 1.0.13 for graalce (linux/amd64): passes, with .sdkmanrc java=25.0.5.0+3-graal selects 25.0.5.0.3-graal, 25.0.5.0+2-graal, 25.0.4.1+1-graal and 25.4.4.1+1-graal. Against the old hook the same run fails there: expected 25.0.5.0.3-graal, actual 25.0.5-graal.

  • stylua --check . (2.5.2) and lua-language-server --check . --checklevel=Warning (3.19.1), the versions of the Lint workflow, pass. So do gofmt, go vet (also with GOOS=windows) and go test -short in tests/e2e.

  • vfox install java@25.0.5.0+3-graal still fails with No JDK found, as the docs say of .sdkmanrc identifiers that are not install specs; java@25.0.5.0.3-graal starts downloading.

Not run locally: the Windows and Linux arm64 e2e jobs and the other distributions' rows.

Notes

  • A file naming a build that is not installed (java=25.0.5.0+3-graal with only 25.0.5.0.2-graal and 25.0.6-graal) still takes the newest release of 25, as the docs describe for any release that is not installed. Taking the other builds of 25.0.5 first would be a separate change.

…ity identifiers, such as `java=25.0.5.0+3-graal`, select the build they name
@linghengqian linghengqian added the bug Something isn't working label Nov 3, 2026
@linghengqian
linghengqian merged commit 01843ef into main Nov 3, 2026
11 checks passed
@linghengqian
linghengqian deleted the fix/sdkmanrc-graalvm-build-number branch November 3, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant