Open anadon opened 1 month ago
(04:11:14 PM) discocaml: <leviroth> I don't think this is an issue with opam setup. I can reproduce this on my own, definitely functional opam installation.
(04:11:55 PM) discocaml: <leviroth> It's not actually installing any findlib package
Ultimately, I think this happens because the make build
executed by the build:
field in opam-repository (https://github.com/ocaml/opam-repository/blob/b6de4bb8dee70812d424cc3121b00a1e03b2b447/packages/morbig/morbig.0.11.0/opam) does not use -p
, and thus does not promote the morbig.install
file at the end of the build.
Interestingly, the opam file in this repo itself does use the -p
flag: https://github.com/colis-anr/morbig/blob/b97a5be622a7b5539f43617e74bf9cccad1d58b9/morbig.opam#L39
Right, it was intentionally changed (presumably with unintended consequences) when packaged for opam-repository.
Hi all, thanks for the report and the work put into understand what's going on!
Indeed, the package on opam-repository
relies on make build
instead of dune build -p ...
. The proper fix for this would be to push all the building steps into Dune and to only rely on dune build -p ...
:
https://github.com/colis-anr/morbig/blob/b97a5be622a7b5539f43617e74bf9cccad1d58b9/Makefile#L11-L15
In particular, one would need to manage to express L12 in pure Dune build files. At the time of writing Morbig, this was not possible, but it might be today; I haven't followed the latest improvements to Dune. In the meantime, would it suffice to add -p morbig
to L13?
It appears so: I downloaded and unpacked the v0.11.0 tarball, added -p
, and pinned opam to that directory. I saw that the package is now installed, in the sense that e.g. ocamlfind query morbig
prints a path.
However, I'm not sure if src/c/dune
is having the desired effect. It doesn't appear that libmorbigc is being installed, as judged by opam show morbig --list-files | grep libmorbig
.
After all, I think what's missing from the opam-repository opam
files is a field install: [make "install"]
; no need for -p morbig
. I am not really sure why it was not working before.
Could you confirm?
url {
lines, add install: [make "install"]
insteadmorbig
utility has been installed. (type morbig
should find a location in your .opam
directory).opam show morbig --list-files | grep libmorbig
should find a .h
and a .o
files).Ah, yes, that works - everything in steps 5-7 checks out. And I think I understand why things weren't working in various configurations before. For example, a silly one is that I was previously starting with the opam file from the tarball, instead of the opam-repository one in your instructions.
I have opened a PR on opam-repository to propose this fix. Let us see how it unfolds.
When following the instructions outlined for an example project and setup for morbig, I recieve the following:
Those in the Librairc #ocaml chat suspect that this library is broken somehow.