mirror of
https://github.com/Z3Prover/z3
synced 2026-07-01 12:58:54 +00:00
The "Ubuntu with OCaml on z3-static" CI job intermittently fails with `Fatal error: exception End_of_file` from the OCaml bytecode linker when compiling `ml_example_static.byte`. ## Root cause `ocamlfind install z3-static build/api/ml/* build/libz3-static.a` auto-recognizes `dllz3ml-static.so` (starts with `dll`) as a C stub and copies it to `stublibs`, but without an explicit `-dll` flag it **does not update `ld.conf`**—confirmed by the CI warning: ``` ocamlfind: [WARNING] You have installed DLLs but the directory .../stublibs is not mentioned in ld.conf ``` `ocamlc` searches `ld.conf` for stub DLLs at bytecode link time; the missing entry causes `End_of_file`. The non-static job is unaffected because it passes `-dll build/libz3.*` explicitly, which triggers the `ld.conf` update as a side-effect. ## Fix After `ocamlfind install`, append the `stublibs` path to `ld.conf` if absent: ```bash STUBLIBS="$(dirname "$(ocamlfind printconf destdir)")/stublibs" LDCONF="$(ocamlfind printconf ldconf)" if [ -d "$STUBLIBS" ] && ! grep -qF "$STUBLIBS" "$LDCONF" 2>/dev/null; then echo "$STUBLIBS" >> "$LDCONF" fi ``` Idempotent; uses `ocamlfind printconf` to avoid hardcoded paths. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Lev Nachmanson <5377127+levnach@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| actions | ||
| agents | ||
| aw | ||
| prompts | ||
| scripts | ||
| skills | ||
| workflows | ||
| CI_MIGRATION.md | ||
| CI_TESTING.md | ||
| copilot-instructions.md | ||
| dependabot.yml | ||
| mcp.json | ||