Repository navigation
quint: run quint verify on the packaged apalache, never a download - #1627
bryan-minimal wants to merge 1 commit into
Conversation
quint 0.33.1 looks for Apalache under ~/.quint/apalache-dist-<version> and downloads apalache.tgz (unhashed) there on first use; `--backend tlc` runs the jar's TLC with `java` from PATH. - runtime_deps gains apalache (#1615), which installs /usr/lib/apalache/{bin/apalache-mc,lib/apalache.jar}. - build.sh returns /usr/lib from apalacheDistDir() for the pinned version only (another --apalache-version keeps upstream's download), and spawns TLC with /usr/lib/jvm/bin/java. - Guard: quint's DEFAULT_APALACHE_VERSION_TAG must equal apalache's upstream_version (forwarded as apalache_version), so a bump of either stops the build. - New verify test: both backends, a held and a violated invariant, an empty QUINT_HOME, and no download message. 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 28 minutes for your next included review. View limit details
|
There was a problem hiding this comment.
Scope matches the title. Both files change only the Apalache lookup, the TLC java spawn, the version guard and one new test. Clobber not checked with git log, because the harness denied shell access after the first read. The diff removes only the NOT packaged comment that this PR makes obsolete. Correctness I read packages/quint/build.sh, packages/quint/build.ncl, packages/apalache/build.ncl and packages/apalache/build.sh in full. The /usr/lib redirect agrees with the layout that packages/apalache/build.sh installs. The version guard reads apalache.attrs.upstream_version, the same pattern as packages/chromedriver-bin/build.ncl:41. /usr/lib/jvm/bin/java is the path that the jdk packages install and that packages/apalache/build.sh:26 pins. The two findings are nits. Not checked: the upstream quint 0.33.1 config.js, tlc.js and apalache.js. The harness denied the npm download, so the patch sites, the Downloading Apalache text and the TLC output that the test greps for violation rest on the PR body. The new test does not set JVM_ARGS=-Xmx1g or TMPDIR, and both apalache tests do. I did not find why apalache sets them, so I did not file it. No build or test ran.
| # the one apalache's launcher is pinned to. | ||
| tsig="(0, child_process_1.spawn)('java', [" | ||
| [ "$(grep -cF "$tsig" "$dist/tlc.js")" = 1 ] || { echo "tlc.js: the java spawn moved — re-check the patch" >&2; exit 1; } | ||
| sed -i "s|(0, child_process_1.spawn)('java', \[|(0, child_process_1.spawn)('/usr/lib/jvm/bin/java', [ // minimal: the packaged jdk|" "$dist/tlc.js" |
There was a problem hiding this comment.
nit · The replacement puts a // comment directly after [ on the spawn line. The comment is safe only while upstream breaks the line after [. If a later quint puts the first argument on that line, the comment removes it and tlc.js does not parse. The guards at lines 102-103 only grep the file, so the build passes and only the verify test fails. config.js does not have this gap, because line 97 loads it with require. Drop the inline comment, or add node --check "$dist/tlc.js" after the patch. This is the only patch in the file that appends a comment in the middle of a statement. I did not read the upstream tlc.js, because the download was denied.
| fi | ||
| grep -qi 'violation' bad.log || { cat bad.log; exit 1; } | ||
| if grep -qi 'downloading apalache' ok.log bad.log; then echo "backend $b: quint tried to download Apalache" >&2; exit 1; fi | ||
| done |
There was a problem hiding this comment.
nit · The verify test does not show that --backend tlc runs the packaged JDK. The jdk is in the closure through apalache, so a java from PATH also passes. The check test in packages/apalache/build.ncl:120-124 puts a failing java first on PATH for this purpose. Add the same fakebin/java here to make the test fail when the spawn goes back to PATH. The build guards at build.sh:102-103 cover the patch today, so this is a nit.
This is the follow-up to #1611 (quint) and #1615 (apalache), which both merged today.
Problem. quint 0.33.1's
quint verifylooks for Apalache in~/.quint/apalache-dist-<version>/apalache/. On first use it downloadsapalache.tgzthere from GitHub, unhashed.quint verify --backend tlcruns TLC from that jar with whateverjavais on PATH. In a session with no network, verify fails.Change
runtime_depsgainsapalache, which installs/usr/lib/apalache/{bin/apalache-mc,lib/apalache.jar}. That is quint's expected layout, rooted at/usr/lib.apalacheDistDir(version)returns/usr/libfor the pinned version only. An explicit--apalache-versionfor any other version keeps upstream's download, so quint never runs a different version than the one asked for./usr/lib/jvm/bin/java, the JDK apalache's launcher is already pinned to.DEFAULT_APALACHE_VERSION_TAGmust equalapalache.attrs.upstream_version, which is forwarded asapalache_version. A bump of either package without the other fails the build./usr/lib, and another version doesn't;javaspawn is left;Tests. A new
verifytest runs both backends. On each backend a held invariant passes and a violated one fails.QUINT_HOMEmust stay empty, and no "Downloading Apalache" message may appear. The spec wraps at 5 so that TLC's state space is finite.Checked locally:
build_argsresolves toapalache_version = 0.62.4.config.jsandtlc.js, gives/usr/liband upstream's path respectively, and both files passnode --check.build-bot runs the real build and tests.
🤖 Generated with Claude Code