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

test: reproduce @ocaml-index failing with package management #10986

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions test/blackbox-tests/test-cases/ocaml-index/gh10985.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
This test attempts to build the ocaml index while depending on a library
installed through a lock file.

We set up a library that will be installed as part of the package:

$ mkdir external_sources
$ cat >external_sources/dune-project <<EOF
> (lang dune 3.11)
> (package (name mypkg))
> EOF
$ cat >external_sources/dune <<EOF
> (library
> (public_name mypkg.lib)
> (name test_lib))
> EOF
$ cat >external_sources/test_lib.ml <<EOF
> let x = ()
> EOF

We put the actual build in a separate directory, so we don't have to ignore
the package directory in the dune file:
$ mkdir actual
$ cd actual

Now we set up a lock file with this package and then attempt to use it:

$ cat >dune-project <<EOF
> (lang dune 3.11)
> EOF

$ mkdir dune.lock
$ cat >dune.lock/lock.dune <<EOF
> (lang package 0.1)
> EOF

$ cat >dune.lock/mypkg.pkg <<EOF
> (version 0.0.1)
> (source (copy $PWD/../external_sources))
> (build (run dune build --release --promote-install-file=true . @install))
> EOF

$ cat >dune <<EOF
> (library
> (name foo)
> (libraries mypkg.lib))
> EOF

$ cat >foo.ml <<EOF
> let () = Test_lib.x
> EOF

$ dune build @ocaml-index
Error: This rule defines a directory target "default/.pkg/mypkg/target" that
matches the requested path
"default/.pkg/mypkg/target/lib/mypkg/lib/cctx.ocaml-index" but the rule's
action didn't produce it
-> required by _build/default/.foo.objs/cctx.ocaml-index
-> required by alias ocaml-index
[1]
Loading