8000 jbang: add 0.142.0 by bryan-minimal · Pull Request #903 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

jbang: add 0.142.0 - #903

Merged
bryan-minimal merged 3 commits into
mainfrom
add-jbang
Oct 22, 2026
Merged

bryan-minimal merged 3 commits into
mainfrom
add-jbang

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

What

Adds packages/jbang, JBang 0.142.0 (latest release on jbangdev/jbang, 2026-09-22; the newer early-access tag is a pre-release). JBang runs single-file Java programs (jbang hello.java) and resolves their //DEPS from Maven Central. It is one of the Tier 1 items in the Java loadout checklist (#899).

  • Source: the platform-independent bundle jbang-0.142.0.tar (bash launcher plus jbang.jar). sha256 43aaeb9b…08eaac matches upstream's jbang-0.142.0.tar.sha256 and checksums_sha256.txt.
  • Layout: /usr/share/jbang/bin/{jbang,jbang.jar} plus a /usr/bin/jbang wrapper. The .cmd and .ps1 launchers are dropped.
  • Runtime deps: jdk, bash, and coreutils (the launcher uses #!/usr/bin/env bash, uname, dirname and readlink).
  • Licence: MIT. Provenance: GithubRepo jbangdev/jbang.
  • Prebuilt for the same reason as maven / gradle / jdtls: the Gradle build resolves from Maven Central. binary_from records it.

Network behaviour (the part worth reviewing)

JDK. The upstream launcher looks for a JDK in $JAVA_HOME, then javac on PATH. Only if both are missing does it download a Temurin JDK from foojay.io into ~/.jbang. The wrapper sets JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm}, so the packaged jdk is 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. //DEPS resolution is jbang's whole purpose, and it needs Maven Central. Following the curl/go/pnpm/uv convention, the package declares needs = { 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 //DEPS runs fully offline. The test proves that.

Caches. jbang writes its cache to ~/.jbang (JBANG_DIR overrides it). The wrapper leaves this at upstream's default; sessions with an unwritable $HOME should set JBANG_DIR.

Tests

Both are Standalone:

  • jbang_version: jbang --version reports 0.142.0.
  • run_script: writes a self-contained hello.java with no //DEPS, then runs jbang --offline hello.java a b with JBANG_DIR in the test cwd, and asserts the output is exactly hello a,b. jbang compiles the script with the packaged javac and runs it. Because of --offline, any attempt to reach the network fails the test rather than passing quietly.

Verified

I built it in a pkgbuild session (arm64) with min package build --rebuild --verbose jbang, then ran min check --packages jbang. All checks pass, including standalone tests and missing runtime_deps.

Negative control: expecting hello a,c in a fresh session makes standalone tests...Fail.

amd64 relies on CI; the bundle is architecture-independent.

Refs #899.

🤖 Generated with Claude Code

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>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner October 16, 2026 20:29
@coderabbitai
coderabbitai Bot commented Oct 16, 2026 •
Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 54 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: gominimal/pkgs/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 2ebab4ff-355d-4b8f-9e70-166741ebceac
📥 Commits

Reviewing files that changed from the base of the PR and between 62a8810 and b690eb8.

📒 Files selected for processing: 2
  • packages/jbang/build.ncl
  • packages/jbang/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
  • needs matches the curl/uv convention, and the --offline test 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

bryan-minimal and others added 2 commits October 21, 2026 17:15
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>
@bryan-minimal
Copy link
Copy Markdown
Member Author

Addressed your review:

🤖 Generated with Claude Code

@bryan-minimal
bryan-minimal added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit 0618acc Oct 22, 2026
11 checks passed
@bryan-minimal
bryan-minimal deleted the add-jbang branch October 22, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0