tarides / opam-monorepo

Assemble dune workspaces to build your project and its dependencies as a whole
ISC License
130 stars 28 forks source link

Warnings about unknown variables being printed #349

Open Leonidas-from-XIV opened 1 year ago

Leonidas-from-XIV commented 1 year ago

Reported by @samoht:

$ opam-monorepo lock
==> Using 1 locally scanned package as the target.
[WARNING] Unknown variable "ocaml-system:version"
[WARNING] Unknown variable "ocaml-base-compiler:version"
[WARNING] Unknown variable "ocaml-variants:version"
==> Found 19 opam dependencies for the target package.
==> Querying opam database for their metadata and Dune compatibility.
==> Calculating exact pins for each of them.
==> Wrote lockfile with 11 entries to project.opam.locked. You can now run opam monorepo pull to fetch their sources.

The project.opam file does not use the version fields, so we should look into why these are being passed into OPAM and triggering this warning.

palainp commented 1 year ago

Not sure if I'm in the same case, but testing with OCaml 5.0.0 released yesterday, I get the same messages.

The message is printed by https://github.com/ocaml-opam/opam-0install-solver/blob/b759d7c1c2f140724020f57599ead9ee394a8f7a/lib/switch_context.ml#L23 and the package using these variables is https://github.com/ocaml/opam-repository/blob/master/packages/ocaml-options-vanilla/ocaml-options-vanilla.1/opam .

Leonidas-from-XIV commented 1 year ago

Thanks @palainp, it looks like this commit introduced them: https://github.com/ocaml/opam-repository/commit/ab440dd6d41c0a3139b707855217ffaa7e54ac26 and the 0install solver doesn't seem have support for those. I'll take a look what's going on.

Leonidas-from-XIV commented 1 year ago

An error report already exists: https://github.com/ocaml-opam/opam-0install-solver/issues/45, so this issue will need to be solved on the solver-side.