Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dune build @ocaml-index fails when depending on a package with package management enabled #10985

Closed
liate7 opened this issue Oct 2, 2024 · 0 comments · Fixed by #11035
Closed

Comments

@liate7
Copy link
Contributor

liate7 commented Oct 2, 2024

This only happens when there's a dune.lock and one of the dune files in the project depend on a library from outside the project.

Expected Behavior

dune build @ocaml-index works and builds the index.

Actual Behavior

dune build @ocaml-index returns 1 with error messages complaining about rules defining directory targets when the rules' actions didn't produce them. For a dummy project only depending on containers, this was:

Error: This rule defines a directory target "default/.pkg/containers/target"
that matches the requested path
"default/.pkg/containers/target/lib/containers/cctx.ocaml-index" but the
rule's action didn't produce it
-> required by _build/default/lib/.test.objs/cctx.ocaml-index
-> required by alias ocaml-index
Error: This rule defines a directory target "default/.pkg/either/target" that
matches the requested path
"default/.pkg/either/target/lib/either/cctx.ocaml-index" but the rule's
action didn't produce it
-> required by _build/default/lib/.test.objs/cctx.ocaml-index
-> required by alias ocaml-index
Error: This rule defines a directory target "default/.pkg/containers/target"
that matches the requested path
"default/.pkg/containers/target/lib/containers/monomorphic/cctx.ocaml-index"
but the rule's action didn't produce it
-> required by _build/default/lib/.test.objs/cctx.ocaml-index
-> required by alias ocaml-index

Reproduction

mkdir test
cd test
cat > dune-project <<EOF
(lang dune 3.17)
(package
  (name test)
  (depends ocaml dune containers))
EOF
mkdir bin
cat >bin/dune <<EOF
(executable
  (name main)
  (libraries containers))
EOF
touch bin/main.ml
dune pkg lock
dune build @ocaml-index

Edit: I've written a pull request for the bug: #10986

Specifications

  • Version of dune (output of dune --version): "Dune Developer Preview: build 2024-10-02T07:47:55+00:00, git revision 451e5b4"
  • Version of ocaml (output of ocamlc --version)
  • Operating system (distribution and version): Linux 6.10.7, Guix System

Additional information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants