From 0e1efc713e16eeaaceb7dc369f58c3f587f4837d Mon Sep 17 00:00:00 2001 From: cflmy Date: Thu, 26 Nov 2026 15:51:39 +0800 Subject: [PATCH] smoke: keep language-only execution after removing the Bundle Moving the shipped stdlib aside must fail the print program with an explicit diagnostic and still run a language-only program. The archive smoke and the cold-install container now both call the factorial example after the move, and the archive contract test pins the new message. --- tools/ci/test_release_archive.py | 1 + tools/release/cold-install.sh | 1 + tools/release/smoke.py | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/tools/ci/test_release_archive.py b/tools/ci/test_release_archive.py index ae8c430..c41bb9c 100644 --- a/tools/ci/test_release_archive.py +++ b/tools/ci/test_release_archive.py @@ -134,6 +134,7 @@ class ReleaseArchiveContractTest(unittest.TestCase): self.assertIn("verify_stdlib_bundle(install, info)", source) self.assertIn("verify_stdlib_bundle", source) self.assertIn("stdlib.hidden", source) + self.assertIn("language-only program runs without the bundled stdlib", source) self.assertIn("expected 6", source) self.assertIn("permission.denied", source) diff --git a/tools/release/cold-install.sh b/tools/release/cold-install.sh index 8f2e03c..30c1827 100644 --- a/tools/release/cold-install.sh +++ b/tools/release/cold-install.sh @@ -51,4 +51,5 @@ docker run --rm --network none --user 65534:65534 \ exit 1 fi grep -E "stdlib|symbol\.unknown|打印" /tmp/missing-stdlib.log + test "$(./marqdo call examples/factorial.mq.md 阶乘 --arg n=5)" = 120 ' sh "$version" "$source_sha" diff --git a/tools/release/smoke.py b/tools/release/smoke.py index 912c54d..dc59ae2 100644 --- a/tools/release/smoke.py +++ b/tools/release/smoke.py @@ -281,6 +281,16 @@ def main(argv: list[str]) -> int: if "stdlib" not in message and "打印" not in message and "symbol.unknown" not in message: fail(f"missing-stdlib failure is not explicit: {message!r}") print("smoke: bundled stdlib missing -> fail-closed OK") + # A program that uses only the language must still run. + language_only = runner.run( + ["call", "examples/factorial.mq.md", "阶乘", "--arg", "n=5"] + ).stdout.strip() + if language_only != "120": + fail( + f"language-only call failed without the bundled stdlib: " + f"{language_only!r}" + ) + print("smoke: language-only program runs without the bundled stdlib") finally: hidden.rename(install / "stdlib") factor = runner.run(