Restores the standalone-binary capability the Janet host had. `bin/joltc build -m NS -o OUT` AOT-compiles an app into a single self-contained executable — the whole runtime, clojure.core, stdlib and compiler embedded, no Chez install or jolt source needed at runtime. Pipeline (host/chez/build.ss, host primitive jolt.host/build-binary driven by jolt.main's build command): resolve deps, load the entry namespace recording the app namespaces in dependency order, re-emit each to Scheme, textually inline the cli.ss runtime load sequence into one flat source + the app + a launcher, then compile-file -> make-boot-file -> embed the boot as C bytes -> cc-link against libkernel.a. Two non-obvious bits: the compile pass runs in a fresh Chez, not the loaded runtime (regex.ss shadows top-level `error`, which otherwise bakes a broken reference into the boot); and the launcher installs scheme-start rather than running -main at top level, since boot top-level forms execute during heap build before argv is set, so args only reach -main through scheme-start. Loader: a require of an in-memory namespace with no source file now no-ops, so AOT'd app namespaces satisfy require in a built binary. Mode flags (--opt/--dev, default release) are plumbed; the optimization passes they gate come in a later stage. RFC 0007 has the design. Gated by `make buildsmoke`.
68 lines
2.3 KiB
Makefile
68 lines
2.3 KiB
Makefile
# jolt — Clojure on Chez Scheme. Single substrate, no Janet.
|
|
#
|
|
# bin/joltc runs jolt directly off the checked-in seed (host/chez/seed/); there is no
|
|
# build step. `make test` is the full gate. `make remint` rebuilds the seed after a
|
|
# source change.
|
|
|
|
.PHONY: test ci values corpus unit smoke buildsmoke selfhost sci certify ffi transient remint
|
|
|
|
# Full gate (dev machine). Includes the self-host byte-fixpoint, which only holds
|
|
# on the same Chez that minted the seed.
|
|
test: selfhost ci
|
|
@echo "OK: all gates passed"
|
|
|
|
# CI gate: behavior only. The checked-in seed is a minted artifact (like a
|
|
# lockfile) — it RUNS correctly on any Chez, but `selfhost` rebuilds it and a
|
|
# different Chez version may emit byte-different (gensym/order) output, so the
|
|
# byte-fixpoint is a dev-machine check, not a CI one (jolt-8479).
|
|
ci: values corpus unit smoke buildsmoke sci ffi transient certify
|
|
@echo "OK: CI gates passed"
|
|
|
|
# Self-host fixpoint: bootstrap.ss rebuild == checked-in seed.
|
|
selfhost:
|
|
@sh host/chez/selfcheck.sh
|
|
|
|
# Value-model unit tests (nil/truthiness/collections on Chez).
|
|
values:
|
|
@chez --script test/chez/values-test.ss
|
|
|
|
# Corpus conformance vs JVM-sourced expecteds (allowlist + floor).
|
|
corpus:
|
|
@chez --script host/chez/run-corpus.ss
|
|
|
|
# Host-specific unit cases.
|
|
unit:
|
|
@chez --script host/chez/run-unit.ss
|
|
|
|
# Real-CLI smoke over bin/joltc.
|
|
smoke:
|
|
@sh host/chez/smoke.sh
|
|
|
|
# `jolt build` produces a working standalone binary.
|
|
buildsmoke:
|
|
@sh host/chez/build-smoke.sh
|
|
|
|
# SCI conformance: load borkdude/sci's source through joltc (floor-gated).
|
|
sci:
|
|
@chez --script host/chez/run-sci.ss
|
|
|
|
# FFI: bind native functions (typed foreign-procedure), memory, and that a
|
|
# :blocking call is collect-safe (a parked thread doesn't pin the collector).
|
|
ffi:
|
|
@chez --script test/chez/ffi-binding-test.ss
|
|
|
|
# Transients: mutable backing, snapshot on persistent!, and linear-time builds.
|
|
transient:
|
|
@chez --script test/chez/transient-test.ss
|
|
|
|
# JVM oracle: certify the corpus against reference Clojure. Skips if clojure absent.
|
|
certify:
|
|
@if command -v clojure >/dev/null 2>&1; then \
|
|
clojure -M test/conformance/certify.clj; \
|
|
else \
|
|
echo "certify: clojure not on PATH — skipped"; \
|
|
fi
|
|
|
|
# Re-mint the seed after changing a seed source (reader/analyzer/backend/core).
|
|
remint:
|
|
@sh host/chez/remint.sh
|