Open mefyl opened 2 days ago
This is the same error message as in https://github.com/ocaml/dune/issues/10903, however it looks like a different issue.
The error is actually that the project ignores dune.lock
, thus when ocamlfind
tries to read the patch, it doesn't see it (this was investigated by @gridbugs yesterday). I'll update the issue name.
Repro in #11115.
Two options exist (discussed in todays dune-dev meeting):
dirs
.The first option has the issue that the lock directories are defined in the dune-workspace
, thus if we error on one project, it might not error on another because another user has a different workspace configuration. Thus I lean towards 2. @rgrinberg, what's your take on this?
I think ignoring the dirs
configuration in this specific case would be confusing. Isn't it better to just tell the user that dune.lock
doesn't exist or is hidden by dirs
?
The issue is that if I have a dune-workspace
that puts the lock dir into linux.lock
and add (dirs <my-folders> linux.lock)
into the dune
file, it would work for me. But if someone else then clones the project and locks it (thus creating the lock directory in dune.lock
) it would suddenly fail.
We can make the error message when it fails, but it seems fragile if the same project works on one setup and fails on another.
If there's a workspace file, I think it should be considered part of the setup. There's a bunch of other settings one can write in the workspace file that might break things if the workspace is omitted.
I'm not strongly against making the source tree special case the lock directory, but it doesn't seem like an elegant solution either. I'd start with a good error message and if it proves to be insufficient, we could always revisit.
Expected Behavior
dune build
properly installsocamlfind
and proceeds with building the package.Actual Behavior
Same error on my host machine (Gentoo) and docker Alpine or Ubuntu images :
Reproduction
Reproduction Dockerfile:
Specifications
dune
(output ofdune --version
): 3.16.0ocaml
(output ofocamlc --version
): 5.2.0