The following is on opam 2.5.1.
opam file
opam-version: "2.0"
depends: [
"odoc" {with-doc}
"ocp-indent" {with-dev-setup}
]
Installing and locking with-doc
$ opam install --deps-only . --with-doc
$ opam lock .
Produces the following lock file:
opam-version: "2.0"
name: "opam-with-lock"
version: "dev"
depends: [
"astring" {= "0.8.5" & with-doc}
"base-bigarray" {= "base" & with-doc}
"base-domains" {= "base" & with-doc}
"base-nnp" {= "base" & with-doc}
"base-threads" {= "base" & with-doc}
"base-unix" {= "base" & with-doc}
"camlp-streams" {= "5.0.1" & with-doc}
"cmdliner" {= "2.1.1" & with-doc}
"cppo" {= "1.8.0" & with-doc}
"crunch" {= "4.0.0" & with-doc}
"dune" {= "3.22.2" & with-doc}
"fmt" {= "0.11.0" & with-doc}
"fpath" {= "0.7.3" & with-doc}
"ocaml" {= "5.2.1" & with-doc}
"ocaml-base-compiler" {= "5.2.1" & with-doc}
"ocaml-config" {= "3" & with-doc}
"ocaml-options-vanilla" {= "1" & with-doc}
"ocamlbuild" {= "0.16.1" & with-doc}
"ocamlfind" {= "1.9.8" & with-doc}
"odoc" {= "3.1.0" & with-doc}
"odoc-parser" {= "3.1.0" & with-doc}
"ptime" {= "1.2.0" & with-doc}
"re" {= "1.14.0" & with-doc}
"seq" {= "base" & with-doc}
"topkg" {= "1.1.1" & with-doc}
"tyxml" {= "4.6.0" & with-doc}
"uutf" {= "1.0.4" & with-doc}
]
Installing and locking with-dev-setup
After doing the above.
$ opam install --deps-only . --with-dev-setup
Produces the following lock file change:
"ocamlfind" {= "1.9.8" & with-doc}
+ "ocp-indent" {= "1.9.0" & with-dev-setup}
"odoc" {= "3.1.0" & with-doc}
]
Problem?
ocp-indent also depends on cmdliner but the lock file still only specifies "cmdliner" {= "2.1.1" & with-doc}, not "cmdliner" {= "2.1.1" & (with-doc | with-dev-setup)}. The preference for with-doc seems arbitrary and perhaps this behavior isn't intended?
I suppose doing opam install --deps-only --locked . --with-dev-setup with that lock file on a clean switch doesn't actually guarantee that version of cmdliner with the current behavior?
This is an attempt at a minimized reproduction. Originally I encountered something similar in goblint/analyzer#2036. However, there re-locking yielded the equivalent of "cmdliner" {= "2.1.1"} with the constraints completely removed.
That's a bit different but still possibly a variant of the same issue.
The following is on opam 2.5.1.
opam file
Installing and locking with-doc
Produces the following lock file:
Installing and locking with-dev-setup
After doing the above.
$ opam install --deps-only . --with-dev-setupProduces the following lock file change:
"ocamlfind" {= "1.9.8" & with-doc} + "ocp-indent" {= "1.9.0" & with-dev-setup} "odoc" {= "3.1.0" & with-doc} ]Problem?
ocp-indent also depends on cmdliner but the lock file still only specifies
"cmdliner" {= "2.1.1" & with-doc}, not"cmdliner" {= "2.1.1" & (with-doc | with-dev-setup)}. The preference forwith-docseems arbitrary and perhaps this behavior isn't intended?I suppose doing
opam install --deps-only --locked . --with-dev-setupwith that lock file on a clean switch doesn't actually guarantee that version of cmdliner with the current behavior?This is an attempt at a minimized reproduction. Originally I encountered something similar in goblint/analyzer#2036. However, there re-locking yielded the equivalent of
"cmdliner" {= "2.1.1"}with the constraints completely removed.That's a bit different but still possibly a variant of the same issue.