Repository navigation
jbang: add 0.142.0 - #903
Conversation
The platform-independent bundle from GitHub releases (bash launcher +
jbang.jar) under /usr/share/jbang, with a /usr/bin wrapper that pins
JAVA_HOME to the packaged jdk so jbang never downloads a JDK.
Declares needs {dns, internet} for consumers: resolving //DEPS from
Maven Central is jbang's job. The Standalone test runs a self-contained
script with --offline, so it cannot pass by reaching the network.
Refs #899.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 20 minutes for your next included review. View limit details
Comment |
There was a problem hiding this comment.
Looks good:
- The sha256 matches and the prebuilt is called out.
JAVA_HOME="${JAVA_HOME:-/usr/lib/jvm}"(build.sh:21) avoids the foojay JDK download.needsmatches the curl/uv convention, and the--offlinetest is a good guard.
Optional: add an env_state_wiring for JBANG_DIR, since jbang reads it and the PR notes $HOME may be unwritable. jbang also writes //DEPS into ~/.m2/repository, separate from #902's wired repository.
Before approving:
- Rebase needed. The branch predates #897 (
jdk→ Temurin 25), so CI tested on 21. - Policy. The prebuilt-vs-source question for the JVM batch is being decided once for all of them. I'll approve once that's settled.
Generated by Claude Code
jbang keeps its cache, compiled jars and downloaded JDKs in JBANG_DIR, which defaults to ~/.jbang. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed your review:
🤖 Generated with Claude Code |
What
Adds
packages/jbang, JBang 0.142.0 (latest release on jbangdev/jbang, 2026-09-22; the newerearly-accesstag is a pre-release). JBang runs single-file Java programs (jbang hello.java) and resolves their//DEPSfrom Maven Central. It is one of the Tier 1 items in the Java loadout checklist (#899).jbang-0.142.0.tar(bash launcher plusjbang.jar). sha25643aaeb9b…08eaacmatches upstream'sjbang-0.142.0.tar.sha256andchecksums_sha256.txt./usr/share/jbang/bin/{jbang,jbang.jar}plus a/usr/bin/jbangwrapper. The.cmdand.ps1launchers are dropped.jdk,bash, andcoreutils(the launcher uses#!/usr/bin/env bash,uname,dirnameandreadlink).GithubRepojbangdev/jbang.maven/gradle/jdtls: the Gradle build resolves from Maven Central.binary_fromrecords it.Network behaviour (the part worth reviewing)
JDK. The upstream launcher looks for a JDK in
$JAVA_HOME, thenjavacon PATH. Only if both are missing does it download a Temurin JDK from foojay.io into~/.jbang. The wrapper setsJAVA_HOME=${JAVA_HOME:-/usr/lib/jvm}, so the packagedjdkis always found and that path is never taken. A script that asks for a different//JAVA <n>than the packaged JDK will still try to download one; that is upstream behaviour.Dependencies.
//DEPSresolution is jbang's whole purpose, and it needs Maven Central. Following the curl/go/pnpm/uv convention, the package declaresneeds = { dns, internet }. That is the abstract network dep a consumer that builds with jbang inherits. jbang's own build is offline.Offline use. A script with no
//DEPSruns fully offline. The test proves that.Caches. jbang writes its cache to
~/.jbang(JBANG_DIRoverrides it). The wrapper leaves this at upstream's default; sessions with an unwritable$HOMEshould setJBANG_DIR.Tests
Both are Standalone:
jbang_version:jbang --versionreports 0.142.0.run_script: writes a self-containedhello.javawith no//DEPS, then runsjbang --offline hello.java a bwithJBANG_DIRin the test cwd, and asserts the output is exactlyhello a,b. jbang compiles the script with the packagedjavacand runs it. Because of--offline, any attempt to reach the network fails the test rather than passing quietly.Verified
I built it in a
pkgbuildsession (arm64) withmin package build --rebuild --verbose jbang, then ranmin check --packages jbang. All checks pass, includingstandalone testsandmissing runtime_deps.Negative control: expecting
hello a,cin a fresh session makesstandalone tests...Fail.amd64 relies on CI; the bundle is architecture-independent.
Refs #899.
🤖 Generated with Claude Code