Skip to content

fix(ci): repair OCaml and cross-impl interop jobs#2

Open
saroupille wants to merge 3 commits intotrilitech:mainfrom
saroupille:fix/ci-ocaml-dune
Open

fix(ci): repair OCaml and cross-impl interop jobs#2
saroupille wants to merge 3 commits intotrilitech:mainfrom
saroupille:fix/ci-ocaml-dune

Conversation

@saroupille
Copy link
Copy Markdown

@saroupille saroupille commented Apr 17, 2026

What was broken and why

Two independent failures, both pre-existing before this PR.

1. `ocaml` job — `dune: not found`

`opam install dune` installs dune into the opam switch's bin directory, not into the system `$PATH`. When GitHub Actions then runs `./scripts/ocaml_unit_tests.sh` as a plain shell step, the opam environment is not activated and the shell cannot find `dune`.

Fix: prefix both OCaml shell steps with `opam exec --`, which runs the command inside the active opam switch where `dune` is available.

2. `rust-and-cairo` job — `cross_impl_interop` calls `dune` at runtime

`test_ocaml_wallet_scenario_applies_on_rust_ledger` is a Rust test that, at runtime, spawns `dune exec test/gen_interop_scenario.exe` to generate an OCaml-produced interop scenario. The `rust-and-cairo` job only installs Rust — it has no OCaml or dune — so this call fails with No such file or directory.

The test belongs in the `ocaml` job, which already has a full OCaml + dune environment. Moving it there (and adding a Rust toolchain step) is the correct structural fix rather than duplicating the entire OCaml setup in the Rust job.

3. `libmlkem768` not built before linking

The OCaml library links against `vendor/mlkem-native/test/build/libmlkem768.a`, a compiled C library that is not committed to git. Without it the linker fails with cannot find -lmlkem768. `scripts/ocaml_unit_tests.sh` sets `LIBRARY_PATH` to point at the build directory, but nothing in CI actually built the library first.

Fix: add `make -C ocaml/vendor/mlkem-native lib` before the OCaml build steps. Also set `LIBRARY_PATH` explicitly for the `cross_impl_interop` cargo step, which calls `dune` directly without going through the shell script.

Changes

`.github/workflows/unit-tests.yml` only — no production code touched.

Test plan

  • `ocaml` job passes: dune found, `libmlkem768` linked, OCaml unit tests run
  • `cross_impl_interop` passes inside the `ocaml` job
  • `rust-and-cairo` job unaffected (all existing Rust/Cairo tests still run)

🤖 Generated with Claude Code

saroupille and others added 3 commits April 17, 2026 23:51
- ocaml_unit_tests.sh: dune is installed via opam but the shell step
  did not have the opam environment activated; prefix with opam exec --
- cross_impl_interop: the test calls dune at runtime but was in the
  Rust-only job which has no OCaml; move it to the ocaml job (which
  already has OCaml) and add a Rust toolchain step there
- Remove cross_impl_interop from the rust-and-cairo job

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The ML-KEM native C library (vendor/mlkem-native) is not committed to
git and must be compiled before dune can link the OCaml executables.
Add a `make lib` step and set LIBRARY_PATH for the cross_impl_interop
cargo test which runs dune at runtime outside the shell script.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant