3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-01 21:08:55 +00:00
z3/.github
Copilot cfee267068
Fix OCaml static build: ensure stublibs dir is in ld.conf after ocamlfind install (#10003)
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>
2026-06-30 08:43:02 -07:00
..
actions Fix coverage report generation with merge-mode-functions=separate 2025-09-16 16:03:11 +00:00
agents update aw 2026-06-24 14:08:45 -07:00
aw Regenerate agentic workflow locks to fix AWF install failures (#9496) 2026-05-10 21:48:54 -04:00
prompts gitignore 2025-03-12 17:18:37 -07:00
scripts fix memory-safety-report to download artifacts via MCP tools (#8979) 2026-03-15 10:12:49 -07:00
skills update aw 2026-06-24 14:08:45 -07:00
workflows Fix OCaml static build: ensure stublibs dir is in ld.conf after ocamlfind install (#10003) 2026-06-30 08:43:02 -07:00
CI_MIGRATION.md Fix workflow compilation errors and relocate documentation files (#8295) 2026-01-22 21:05:05 -08:00
CI_TESTING.md Fix workflow compilation errors and relocate documentation files (#8295) 2026-01-22 21:05:05 -08:00
copilot-instructions.md Add .github/copilot-instructions.md with comprehensive Z3 development guide (#7766) 2025-08-12 15:18:52 -07:00
dependabot.yml Fix Academic Citation Tracker agent job: recompile lock file with gh-aw v0.79.8 (#9910) 2026-06-20 12:13:01 -06:00
mcp.json update aw 2026-06-24 14:08:45 -07:00