mirror of
https://github.com/zap-proto/ocaml.git
synced 2026-10-30 15:04:23 +00:00
The package previously declared a phantom `conf-zap` opam dep whose only
action was `zap --version`; with no `zap` binary on PATH that made
`opam install zap --with-test` and `dune build` fail outright, and there
was no CI.
- Drop the `conf-zap` virtual package and its dependency. The runtime
library, the `zap.unix` library and the `zapc-ocaml` codegen plugin all
build with no external tool; the `zap` schema compiler (from cpp-core)
is only needed to *generate* code, run the conformance tests and the
benchmarks. `opam install zap` / `dune build @install` are now hermetic.
- Gate the codegen + test + example + benchmark stanzas on a ZAP_COMPILER
env var (dune lang bumped 2.8 -> 3.15 for `%{env:..}` in `enabled_if`).
Unset -> build just the libraries + plugin; set (with `zap` on PATH) ->
run the full suite. The gate cannot fake-pass: with ZAP_COMPILER set and
no compiler, the build fails rather than silently skipping tests.
- Fix a warning-as-error in the plugin (`unused value syntax_error`).
- Add .github/workflows/ci.yml (push to main + PR + workflow_dispatch):
a hermetic `build` job (ocaml 5.1 and 4.08, ubuntu + macos,
`dune build @install`) and a `test` job that builds the `zap` compiler
from zap-proto/cpp-core, exports ZAP_COMPILER and runs `dune test`.
- README/Makefile document the single build (@install) and test
(ZAP_COMPILER=1 ... @runtest) paths. License stays BSD-2-Clause
(upstream capnp-ocaml); ignore the local _opam switch.
21 lines
635 B
Makefile
21 lines
635 B
Makefile
# Build the installable artifacts: the `zap` runtime library, the `zap.unix`
|
|
# library, and the `zapc-ocaml` code-generation plugin. None of these need the
|
|
# external `zap` schema compiler.
|
|
build:
|
|
dune build @install
|
|
|
|
# Run the unit + conformance tests. These link code generated from the `.zap`
|
|
# schemas, so they require the `zap` schema compiler (from cpp-core) on PATH.
|
|
# Set ZAP_COMPILER to any non-empty value to enable the codegen + test stanzas.
|
|
test:
|
|
ZAP_COMPILER=1 dune build @install @runtest @src/benchmark/benchmarks
|
|
|
|
clean:
|
|
rm -rf _build
|
|
|
|
benchmark:
|
|
ZAP_COMPILER=1 python src/benchmark/test.py
|
|
|
|
doc:
|
|
dune build @doc
|