Closed Faliszek closed 3 years ago
Hi, I'm not an user of esy
but from the given OPAM file, ocamlfind
is required to build checkseum
. From your output error it seems that esy
did not install it (because we don't find topfind
).
You probably should report the issue to esy
.
Thanks for your report.
@dinosaure I believe it is because ocamlfind is marked with-test, which according to opam means that it will only be installed when built with tests. However, ocamlfind
is indeed required to build without tests apparently. I believe the reason why esy caught this is because it sandboxes all builds so that packages cannot depend on packages that they did not express as dependencies.
The other issue I noticed is that it assumes that dune build artifacts will exist in _build
, but that isn't always the case - as Dune may also be configured by package managers to build out of source into the DUNE_BUILD_DIR
directory, and esy sets this env var so that all dune builds occur out of source into a reproducible shared cache.
Could checkseum:
with-test
on ocamlfind
since it is required to build the package.DUNE_BUILD_DIR
env var for the build location, and only if that is not set/empty then assume build artifacts for dune are in _build
?Update: I'm not sure the with-test
was what was causing this issue, and we're still investigating but I think that with-test
might still need to be removed if it does indeed depend on ocamlfind, right?
So currently the purpose of install/install.ml
is to tweak the META file generated by dune
to still be compatible with MirageOS 3 (an other issue exist about that here: ocaml/dune#3557). At least, ocamlfind
is used to build checkseum
(tweak on the META
file) and to test checkseum
. From the esy
output, it seems that ocamlfind
, even if it's tagged with build
, is not installed by esy
.
From my perspective, as opam
, esy
should at least install ocamlfind
as a dependency needed to build & install checkseum
(and it's where I think esy
does not do correctly the job). However, if we fallback to install/install.ml
, it seems that ocamlfind
/topfind
is only used to #require "unix"
(and correctly load unix.cma
according to the META file).
So a good solution for both seems to remove ocamlfind
as a dependency to build checkseum
and use instead #load "unix.cma"
(where this module is global from the point of view of the REPL) to, may be, fix the initial issue with esy
.
If someone can try #49 to see if it's the right fix :+1:. The error will be the same for digestif
(which shares the same layout), so it still is exist for irmin
in general (where transitively irmin
depends on digestif
)
even if it's tagged with build, is not installed by esy. My understanding is that the opam
build
flag is not what it sounds like. It is used as a kind of optimization to avoid recompiling in certain circumstances.
From the opam docs
build: limits the dependency to a build-time one, avoiding recompilation if it changes
The predicates are "anded" together as well, so even if build
did mean "at build time", it would be anded together like"only take this dependency if (build and only for with-docs build)".
I'm by no means an opam expert but I'm just reporting what I'm interpreting from the docs, and the docs are what we use to implement esy as an alternative opam client.
A release will appear soon.
cc @dinosaure will this be released? This blocks us :(
Sorry I completely forgot the release. I will do that today, just fix the PR about MirageOS tests.
Sorry if this issue is not properly addressed. I try to add
irmin-unix
package to my project which is build with esy and reasonml. But after trying to build it withesy build
i get the error below.From my understanding, there is something wrong with ./install/install.ml file? But i dont have that much knowledge about ocaml and ocaml tools, to know what exactly went wrong.
Thanks in advance.