8000 apalache: add 0.62.4 (the version quint 0.33.1 pins), release jar on our jdk by bryan-minimal · Pull Request #1615 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

apalache: add 0.62.4 (the version quint 0.33.1 pins), release jar on our jdk - #1615

Open
bryan-minimal wants to merge 1 commit into
mainfrom
apalache
Open

bryan-minimal wants to merge 1 commit into
mainfrom
apalache

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

Adds apalache, the symbolic model checker for TLA+ and Quint. It is the backend of quint verify, and quint verify --backend tlc runs TLC from its jar. Today quint (#1611) downloads apalache.tgz unhashed into ~/.quint and runs java from PATH. This PR packages it so that download isn't needed.

Version: 0.62.4

This is the version quint 0.33.1 pins (DEFAULT_APALACHE_VERSION_TAG = '0.62.4' in dist/src/apalache.js). quint looks for apalache-dist-<that version>/ and would download that exact version, so this is the compatible one. The latest upstream release is 0.63.0 (2026-11-10). We can move to it when quint's pin does.

Why the release artifact and not a source build

Apalache is Scala built with sbt, and sbt resolves the whole dependency graph from Maven Central at build time. Nothing stages that for an offline build yet (#969), so the AGENTS.md "JVM tools are such a case for now" exception applies:

  • sha256 matches upstream: apalache-0.62.4.tgz = b781b53b…2ef4. That matches the release's sha256sum.txt and GitHub's asset digest. The file is mirrored create-only to gs://minimal-staging-archives/apalache-mc/apalache/apalache-0.62.4.tgz, and I re-hashed the mirror after upload.
  • binary_from is recorded.
  • Runs on our jdk: the classes need Java 21 at most (max class-file major 65), so any packaged JDK works. It depends on jdk (the current LTS, jdk-25), so it becomes from-source with no change here when jdk-21, jdk-25, jdk-27: built from source at the Java4Shell fix tags (CVE-2026-114938) #1556 lands. The launcher's two java calls (the JVM-flag probe and the exec) are rewritten to /usr/lib/jvm/bin/java, so the java on a user's PATH never decides which JVM runs. build.sh fails closed if either rewrite misses or a bare java is left in the launcher.
  • Self-contained: a single fat jar with every dependency shaded in and Main-Class set. It runs offline and never downloads code.

Native code in the jar (justified separately, per AGENTS.md)

The JVM extracts these to java.io.tmpdir and loads them at run time:

  • z3 4.14.1 (z3-turnkey: libz3.so + libz3java.so for linux amd64 and aarch64) is the SMT backend. Our z3 package can't replace it. The jar's com.microsoft.z3 classes are the 4.14.1 Java bindings, they call libz3java's per-release generated JNI entry points, and z3-turnkey only loads its own copies. Requirements are GLIBC_2.34, GLIBCXX_3.4.30, libstdc++ and libgcc_s. That is why the package declares glibc + subsetOf gcc ["libgcc", "libstdcpp"]: no ELF in the outputs shows these, so the checker can't infer them.
  • cvc5 JNI (an optional solver) and zstd-jni need nothing beyond that.

Licenses

Apache-2.0 (Apalache). The jar also bundles code under these licenses, with the texts in the jar:

  • Apache-2.0: Scala, Guava, Guice, gRPC, Netty, Jackson
  • BSD-3-Clause: protobuf-java
  • MIT: tla2tools / TLC + SANY, z3
  • BSD-2-Clause: zstd-jni
  • cvc5: BSD-3-Clause. It is built without GPL libraries (Configuration::licenseIsGpl() returns false; CLN/GLPK/CoCoA off) but statically links GMP (LGPL-3.0).
  • Weak copyleft: Jetty/lsp4j/xtext (EPL-2.0), jakarta.servlet (EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0), logback (EPL-1.0 OR LGPL-2.1), kiama (MPL-2.0), and javax.mail/activation via tla2tools (CDDL-1.1 OR GPL-2.0 WITH Classpath-exception-2.0).

All of these can be redistributed unmodified, and none is GPL-only. The full list is in the build.ncl comment.

Tests

  • version_check: apalache-mc version prints exactly 0.62.4.
  • check: a bounded apalache-mc check --length=5 through z3 on a tiny TLA+ counter. A holding invariant must give NoError with exit 0. A violated one must give Error with exit 12 and a violation1.tla trace. A fake java that exits 99 is put first on PATH, so the test fails if the launcher ever uses the PATH java.

Verified locally on arm64 with min package build --rebuild + min check --packages apalache: all checks Pass, including the standalone tests, so z3 loads and solves on linux aarch64 on our glibc. Negative control: with the launcher pin reverted to java, check failed with PATH java ran. amd64 is not verified locally, so this PR's build-bot run is the first amd64 run.

Using it from quint (not changed here)

quin 8000 t 0.33.1 finds Apalache in two ways. First it tries to connect to a running server at --server-endpoint (default localhost:8822). If that fails, it uses $QUINT_HOME/apalache-dist-0.62.4/apalache/bin/apalache-mc (default QUINT_HOME=~/.quint) when that file exists, and downloads otherwise. --backend tlc reads …/apalache/lib/apalache.jar from the same directory and spawns java from PATH. This package installs exactly that apalache/{bin,lib} layout at /usr/lib/apalache. So the options are:

  1. quint package (preferred): add apalache to quint's runtime_deps and patch apalacheDistDir() in dist/src/config.js to return /usr/lib for the pinned version, the same way the evaluator lookup is patched. Add a build guard that DEFAULT_APALACHE_VERSION_TAG equals the apalache package version.
  2. loadout, no quint change: create a directory holding a symlink apalache-dist-0.62.4/apalache -> /usr/lib/apalache and set QUINT_HOME to it.
  3. Run apalache-mc server (port 8822) before quint verify.

🤖 Generated with Claude Code

The Apalache symbolic model checker for TLA+ and Quint, at the version
quint 0.33.1 pins (DEFAULT_APALACHE_VERSION_TAG). Upstream's release
distribution (one fat jar + bash launcher, sha256 matches the release's
sha256sum.txt), mirrored to minimal-staging-archives; the launcher is
pinned to /usr/lib/jvm/bin/java. z3 4.14.1 runs from the jar's bundled
z3-turnkey natives on amd64 and arm64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 20, 2026 20:57
@coderabbitai
coderabbitai Bot commented Nov 20, 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 16 minutes for your next included review.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 03aa958 and 3aa0399.

Files selected for processing: 2

  • packages/apalache/build.ncl
  • packages/apalache/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Scope matches the title. The diff adds only packages/apalache/build.ncl and packages/apalache/build.sh, and no other file names apalache. Clobber none: both files are new.

Correctness The package follows the AGENTS.md JVM exception. binary_from is set, the native code has its own justification, and jdk is a runtime dependency. /usr/lib/jvm/bin/java is in the jvm_bins output of jdk-25. The sed rewrite and its three guards agree with each other. The Nickel multi-line test strips the common indent, so the heredoc terminator is at column 0, as in packages/tlaplus/build.ncl. The import line order is correct and each import has a use.

One low: license_spdx declares only Apache-2.0, so the copyleft source report does not see the bundled copyleft code. One nit: a header comment hardcodes the version.

Not checked The sandbox denied network access. I did not read the upstream launcher, so I did not confirm the sed anchors, the bare java guard, or the list of tools the launcher calls. I did not check the sha256 against upstream. I ran no build and no test. The PR body says amd64 is not verified.

# (MPL-2.0); javax.mail / javax.activation via tla2tools (CDDL-1.1 OR
# GPL-2.0 WITH Classpath-exception-2.0).
# All redistributable unmodified as shipped; nothing is GPL-only.
license_spdx = "Apache-2.0",
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.

low · license_spdx declares only Apache-2.0. The comment above it lists bundled copyleft code: GMP (LGPL-3.0) linked statically into the cvc5 JNI library, Jetty, lsp4j and xtext (EPL-2.0), logback, kiama (MPL-2.0), and javax.mail (CDDL-1.1). .github/scripts/corresponding_source_report.py finds copyleft packages from the license_spdx tokens only. This package is thus not in that report, and nothing checks the source mirror duty for it. packages/tlaplus/build.ncl:56 puts the same javax.mail terms in the expression, and packages/cvc5/build.ncl:100 lists its bundled licenses. packages/jreleaser/build.ncl:92 uses the short form like this PR, so the repo has both forms. Put the bundled licenses in the expression, or say in the comment why the report can ignore them.

#
# Mirror of the release asset apalache-%{version}.tgz, sha256 checked against
# the release's sha256sum.txt and GitHub's asset digest:
# https://github.com/apalache-mc/apalache/releases/download/v0.62.4/apalache-0.62.4.tgz
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.

nit · The comment hardcodes v0.62.4/apalache-0.62.4.tgz. Nickel does not expand %{version} in a comment, so the URL goes stale at the next version bump. Move the upstream URL next to the Source entry in a form that does not name the version, or drop it, because binary_from already names the release page. One other file does this: packages/libarchive/build.ncl:21.

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