8000 kotlin: add 2.4.21 (kotlinc) by bryan-minimal · Pull Request #901 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

kotlin: add 2.4.21 (kotlinc) - #901

Merged
bryan-minimal merged 2 commits into
mainfrom
add-kotlin
Oct 22, 2026
Merged

bryan-minimal merged 2 commits into
mainfrom
add-kotlin

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

What

Adds packages/kotlin: the Kotlin compiler (kotlinc) and runner, 2.4.21 (latest stable on JetBrains/kotlin, released 2026-10-08). One of the Tier 1 items in the Java loadout checklist (#899).

  • Source: kotlin-compiler-2.4.21.zip from the GitHub release. sha256 7cc140e7…e75cd matches upstream's published kotlin-compiler-2.4.21.zip.sha256.
  • Layout: the distribution goes under /usr/share/kotlin. Each launcher (kotlinc, kotlinc-jvm, kotlinc-js, kotlinc-wasm, kotlin, kotlinr, kapt) is symlinked into /usr/bin. The launchers resolve KOTLIN_HOME by following their own symlinks, so no wrapper is needed. The .bat files are dropped.
  • Runtime deps: jdk, bash (the launchers use #!/usr/bin/env bash, BASH_SOURCE and [[ =~ ]]), and coreutils (env, uname, dirname, readlink).
  • Licence: Apache-2.0. Provenance: GithubRepo JetBrains/kotlin, for version checks.

Prebuilt, not from source

The zip is pure JVM bytecode and is architecture-independent. Building the compiler from source means a Gradle build that bootstraps from an earlier Kotlin release and resolves several hundred artifacts from Maven Central and JetBrains' repositories. That cannot be done hermetically today. This is the same trade-off maven, gradle and jdtls make. binary_from records it.

Tests

Both are Standalone and fully offline:

  • kotlinc_version: kotlinc -version reports kotlinc-jvm 2.4.21.
  • compile_and_run: compiles a small main that uses the stdlib (listOf(...).sum()) with -include-runtime, then runs it with plain java -jar and asserts the output is exactly sum=6.

Verified

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

Negative control: changing the expected output to sum=7 in a fresh session makes standalone tests...Fail, so the test is not vacuous.

That session was arm64 only. amd64 relies on this PR's CI /build, though the artifact is the same JVM zip on both arches.

Refs #899.

🤖 Generated with Claude Code

8000
Upstream's kotlin-compiler zip from GitHub releases, installed under
/usr/share/kotlin with /usr/bin symlinks for the launchers. Prebuilt
because the compiler's Gradle build bootstraps from a previous Kotlin
and resolves from Maven Central; same shape as maven / gradle / jdtls.

Standalone tests compile a hello world with -include-runtime and run it
on the plain JVM, fully offline.

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:27
@bryan-minimal
Copy link
Copy Markdown
Member Author

/build

@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 15 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 58 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: 893e99f4-ba86-41e8-8a1c-d04a242ce7a5
📥 Commits

Reviewing files that changed from the base of the PR and between 0618acc and 32deed3.

📒 Files selected for processing: 2
  • packages/kotlin/build.ncl
  • packages/kotlin/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 with binary_from.
  • The zip is pure JVM with fixed 1980 timestamps, and the .bat files are dropped.
  • runtime_deps (bash, coreutils, jdk) match what the launchers use.
  • The overlapping launcher/home globs follow maven's precedent.

Two things before approving:

  • Rebase needed. The branch predates #897, which moved jdk to Temurin 25. CI tested on 21; please rebase and re-run /build.
  • Policy. AGENTS.md says build from source when the toolchain is packaged (jdk, maven and gradle all are). I'd like to settle once, for the whole JVM batch, whether shipping the upstream jar with binary_from is an accepted, documented exception. I'll approve once that's decided.

Generated by Claude Code

@bryan-minimal
Copy link
Copy Markdown
Member Author

Thanks @norrietaylor.

bash -n, nickel format --check and mip dump --packages (amd64) are clean after the merge.

🤖 Generated with Claude Code

@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.

Approving under #970. The branch is past #897 and CI re-ran on Java 25, so my earlier rebase ask is met, and the sha256 matches Kotlin's published .sha256. Please merge after #970.

Non-blocking: kotlin-compiler.jar carries jna, jansi, jline and lz4 .so resources, which #970's "bundled .so files" wording arguably excludes (raised there). Optionally, cite #969 in the comment at build.ncl:14-17.


Generated by 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 05c3e57 Oct 22, 2026
11 checks passed
@bryan-minimal
bryan-minimal deleted the add-kotlin branch October 22, 2026 23:20
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.

2 participants

0