Repository navigation
apalache: add 0.62.4 (the version quint 0.33.1 pins), release jar on our jdk - #1615
bryan-minimal wants to merge 1 commit into
Conversation
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>
|
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 16 minutes for your next included review. View limit details
|
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Adds
apalache, the symbolic model checker for TLA+ and Quint. It is the backend ofquint verify, andquint verify --backend tlcruns TLC from its jar. Todayquint(#1611) downloadsapalache.tgzunhashed into~/.quintand runsjavafrom 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'indist/src/apalache.js). quint looks forapalache-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:
apalache-0.62.4.tgz=b781b53b…2ef4. That matches the release'ssha256sum.txtand GitHub's asset digest. The file is mirrored create-only togs://minimal-staging-archives/apalache-mc/apalache/apalache-0.62.4.tgz, and I re-hashed the mirror after upload.binary_fromis recorded.jdk: the classes need Java 21 at most (max class-file major 65), so any packaged JDK works. It depends onjdk(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 twojavacalls (the JVM-flag probe and theexec) are rewritten to/usr/lib/jvm/bin/java, so thejavaon a user's PATH never decides which JVM runs. build.sh fails closed if either rewrite misses or a barejavais left in the launcher.Main-Classset. It runs offline and never downloads code.Native code in the jar (justified separately, per AGENTS.md)
The JVM extracts these to
java.io.tmpdirand loads them at run time:libz3.so+libz3java.sofor linux amd64 and aarch64) is the SMT backend. Ourz3package can't replace it. The jar'scom.microsoft.z3classes 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 declaresglibc+subsetOf gcc ["libgcc", "libstdcpp"]: no ELF in the outputs shows these, so the checker can't infer them.Licenses
Apache-2.0(Apalache). The jar also bundles code under these licenses, with the texts in the jar:Configuration::licenseIsGpl()returns false; CLN/GLPK/CoCoA off) but statically links GMP (LGPL-3.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 versionprints exactly0.62.4.check: a boundedapalache-mc check --length=5through z3 on a tiny TLA+ counter. A holding invariant must giveNoErrorwith exit 0. A violated one must giveErrorwith exit 12 and aviolation1.tlatrace. A fakejavathat 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 tojava,checkfailed withPATH 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(defaultlocalhost:8822). If that fails, it uses$QUINT_HOME/apalache-dist-0.62.4/apalache/bin/apalache-mc(defaultQUINT_HOME=~/.quint) when that file exists, and downloads otherwise.--backend tlcreads…/apalache/lib/apalache.jarfrom the same directory and spawnsjavafrom PATH. This package installs exactly thatapalache/{bin,lib}layout at/usr/lib/apalache. So the options are:apalacheto quint's runtime_deps and patchapalacheDistDir()indist/src/config.jsto return/usr/libfor the pinned version, the same way the evaluator lookup is patched. Add a build guard thatDEFAULT_APALACHE_VERSION_TAGequals the apalache package version.apalache-dist-0.62.4/apalache -> /usr/lib/apalacheand setQUINT_HOMEto it.apalache-mc server(port 8822) beforequint verify.🤖 Generated with Claude Code