Rust implementation: single static binary, argv[0]-dispatch shims#1
Merged
Conversation
Full port of the sh implementation to dependency-free Rust (std only; downloads still shell out to curl/tar). One binary is both the CLI and every shim — shims are symlinks to it, dispatched on argv[0], like Volta. Resolution is ~1.7ms vs ~12ms for the sh version. test/smoke.sh stays as the shared conformance suite (now driving the binary via JOLTA_BIN, with a machine-readable 'jolta jdks' command); all 19 checks pass including live Adoptium auto-install. install.sh builds from source until prebuilt binaries are published. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pins and installs can name a distro: corretto@21 / graalvm-25 (also in .java-version). Downloadable: temurin (default), corretto, graalvm, oracle — plus zulu/openjdk recognized when matching installed JDKs via release IMPLEMENTOR and path. A distro-qualified pin only matches that distro and auto-installs it when missing. Terminal UI: colored, glyphed output across commands and an animated download progress bar (spinner, bar, percent, size, throughput) drawn by polling the file against the redirect chain's Content-Length; plain output when piped, NO_COLOR and TERM=dumb respected. Fixes the content-length probe (curl -w has no such variable; parse the header). Conformance suite grows to 21 checks: distro-aware resolution (corretto pin prefers corretto over same-major openjdk; wrong-distro pin fails offline) plus live corretto@21 and temurin@25 installs verified. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
Author
|
Added to this PR: JDK distro selection ( |
ui (terminal styling), paths, jdk (spec parsing + discovery), resolve (matching/cache/pin/auto-install), download (progress bar), install (vendor URLs + install), commands (CLI handlers), and a slim main.rs for dispatch and shim mode. Pure code movement; no behavior change.
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.
Summary
Full port of jolta from POSIX sh to dependency-free Rust (std only — downloads still shell out to
curl/tar, keeping the supply chain empty).joltait's the CLI; invoked through a shim symlink (java,javac, …) it dispatches on argv[0], resolves the pinned JDK, setsJAVA_HOME, and execs the real tool — the Volta architecture, with zero script parsing on the hot path.java -versionis indistinguishable from barejava.corretto@21/graalvm-25in pins and installs; temurin (default), corretto, graalvm, oracle downloadable; zulu/openjdk recognized when matching installed JDKs. Distro-qualified pins are strict.NO_COLORrespected.jolta jdks(machine-readable listing).test/smoke.shdrives any binary viaJOLTA_BIN— both implementations pass the identical checks (now 21), including live Corretto and Temurin installs from the real vendor endpoints.install.shbuilds from source (needs cargo) until prebuilt release binaries are published.Test plan
cargo build --release && ./test/smoke.sh— offline checksJOLTA_TEST_NETWORK=1 ./test/smoke.sh— including real Adoptium/Corretto downloadsjolta setup,jolta doctor, pinned-project resolution)