ocaml / ocamlfind

The OCaml findlib library manager
Other
30 stars 30 forks source link

dynlink_subdir: parameter not set or null #88

Closed daeho-ro closed 2 weeks ago

daeho-ro commented 3 weeks ago

Hello, when I build the package, I got the error as follows:

==> ./configure -bindir /home/linuxbrew/.linuxbrew/Cellar/ocaml-findlib/1.9.7/bin -mandir /home/linuxbrew/.linuxbrew/Cellar/ocaml-findlib/1.9.7/share/man -sitelib /home/linuxbrew/.linuxbrew/lib/ocaml -config /home/linuxbrew/.linuxbrew/etc/findlib.conf -no-camlp4
   ...
  ./configure: [59](https://github.com/Homebrew/homebrew-core/actions/runs/11710046118/job/32615545227?pr=196879#step:4:60)4: dynlink_subdir: parameter not set or null

and details can be seen here,

Am I miss something or how can I deal with this error? Thanks,

atsampson commented 3 weeks ago

I'm seeing this with ocaml 5.2.0 as well. The problem is that with 5.2, several of the libraries that are being checked for using check_library are shipped with META files already - so the is_third_party_META check passes, and the _dir and _subdir variables never get set.

I've worked around this with this patch, which ensures check_library sets those variables even if META is present, but I expect there's a better fix...

--- findlib-1.9.7/configure 2024-11-06 17:39:44.000000000 +0000
+++ findlib-1.9.7/configure 2024-11-08 15:37:37.482984458 +0000
@@ -502,6 +502,11 @@
         # Library is present - exit code is 0 because the library is found
         # (e.g. detection for Unix) but we don't actually add it to the
         # generated_META list.
+        package_dir="${ocaml_sitelib}/$1"
+        package_subdir="$1"
+        package_key="$(echo "$1" | tr - _)"
+        eval "${package_key}_dir=\"${package_dir}\""
+        eval "${package_key}_subdir=\"${package_subdir}\""
         return 0
     fi
daeho-ro commented 3 weeks ago

@atsampson , Your suggestion is working good. Before the official patch, I will use that, Thank you!

gerdstolpmann commented 2 weeks ago

@atsampson I think this is the right way to fix the script. Made #92 out of your patch.