Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
installed-package
no-transitive-through-targets
ocamlfind
template-artifacts
virtual-without-default)
(deps %{bin:ocamlfind}))
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
A META file template can override path-bearing variables without changing the
library graph. Retaining such a rule while materializing only Dune-selected
artifacts produces dangling support metadata.

$ make_dune_project 3.24
$ cat >>dune-project <<'EOF'
> (package (name artifact-support))
> EOF

$ mkdir support
$ cat >support/dune <<'EOF'
> (library
> (name artifact_support)
> (public_name artifact-support))
> EOF
$ echo 'let value = 42' >support/artifact_support.ml

$ cat >META.artifact-support.template <<'EOF'
> # DUNE_GEN
> archive(byte,custom) = "missing.cma"
> EOF

$ cat >dune <<'EOF'
> (rule
> (target result)
> (deps (package artifact-support))
> (action
> (with-stdout-to %{target}
> (run %{bin:ocamlfind} query -predicates byte,custom -format "%d/%A" artifact-support))))
> EOF

The installed META currently retains the conditional archive override even
though that artifact is not part of the package layout.

$ dune build result
$ cat _build/default/result | censor
$PWD/_build/install/default/.packages/$DIGEST/lib/artifact-support/missing.cma
$ test -d "$(cat _build/default/result)"
[1]
Loading