diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcd19a5719..67ed3e4796 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,7 +248,19 @@ jobs: cd .. - name: Install Z3 OCaml package - run: eval `opam config env`; ocamlfind install z3-static build/api/ml/* build/libz3-static.a + run: | + eval `opam config env` + ocamlfind install z3-static build/api/ml/* build/libz3-static.a + # Ensure the stublibs directory where dllz3ml-static.so was installed is + # listed in ld.conf so the OCaml bytecode linker can find it. When no + # explicit -dll flag is passed, ocamlfind installs dll* files to stublibs + # but may not update ld.conf, causing "Fatal error: exception End_of_file" + # in ocamlc when it cannot locate the stub shared library at link time. + STUBLIBS="$(ocamlfind printconf destdir)/stublibs" + LDCONF="$(ocamlfind printconf ldconf)" + if [ -d "$STUBLIBS" ] && ! grep -qF "$STUBLIBS" "$LDCONF" 2>/dev/null; then + echo "$STUBLIBS" >> "$LDCONF" + fi - name: Build and run OCaml examples run: |