-
Notifications
You must be signed in to change notification settings - Fork 394
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
Ensure that dune describe
computes a transitively closed set of libraries
#5395
Conversation
…ibraries. The intention is that, for every library UID that is listed as a requirement, there must exist a library item with that very UID in the output of ``dune describe``. Example: With an empty ``foo.ml`` file, and the following ``dune`` file: (library (name foo) (preprocess (pps ppx_deriving.ord))) the ``dune describe command`` currently produces the following output: ((library ((name foo) (uid 5dd4bd87ad37b4f5713085aff4bee9c9) (local true) (requires (3c8689902dffccb8da94f1a9821d4753)) (source_dir _build/default) (modules (((name Foo) (impl (_build/default/foo.ml)) (intf ()) (cmt (_build/default/.foo.objs/byte/foo.cmt)) (cmti ())))) (include_dirs (_build/default/.foo.objs/byte)))) (library ((name ppx_deriving.runtime) (uid 3c8689902dffccb8da94f1a9821d4753) (local false) (requires (62cfd7aaad132264861d2b6e82476877)) (source_dir /home/bmontagu/.opam/4.13.1/lib/ppx_deriving/runtime) (modules ()) (include_dirs (/home/bmontagu/.opam/4.13.1/lib/ppx_deriving/runtime))))) That is to say, the external library ``ppx_deriving.runtime`` has a dependency to another library with UID ``62cfd7aaad132264861d2b6e82476877``, and that is not listed in the list of libraries. With the proposed PR, ``dune describe`` now outputs: ((library ((name foo) (uid 5dd4bd87ad37b4f5713085aff4bee9c9) (local true) (requires (3c8689902dffccb8da94f1a9821d4753)) (source_dir _build/default) (modules (((name Foo) (impl (_build/default/foo.ml)) (intf ()) (cmt (_build/default/.foo.objs/byte/foo.cmt)) (cmti ())))) (include_dirs (_build/default/.foo.objs/byte)))) (library ((name ppx_deriving.runtime) (uid 3c8689902dffccb8da94f1a9821d4753) (local false) (requires (62cfd7aaad132264861d2b6e82476877)) (source_dir /home/bmontagu/.opam/4.13.1/lib/ppx_deriving/runtime) (modules ()) (include_dirs (/home/bmontagu/.opam/4.13.1/lib/ppx_deriving/runtime)))) (library ((name result) (uid 62cfd7aaad132264861d2b6e82476877) (local false) (requires ()) (source_dir /home/bmontagu/.opam/4.13.1/lib/result) (modules ()) (include_dirs (/home/bmontagu/.opam/4.13.1/lib/result))))) where the missing library ``result`` is now part of the output. Signed-off-by: Benoît Montagu <benoit.montagu@inria.fr>
of libraries. Signed-off-by: Benoît Montagu <benoit.montagu@inria.fr>
@bobot are you happy with the fix I pushed? |
I'm happy but @rgrinberg would be more expert to judge it, and I don't remember if it should be kept behind an option or who should be warned of changes in the format. |
Importantly, the format is the same as before. |
The fix itself looks quite good to me. Could you add a test though? It's not obvious that this should be part of the specification of |
This test would trigger non-reproducible outputs, as described in this related PR. I'm first waiting for a solution to that issue, since that issue contains the test you're asking for. |
The tests now include an example where transitive dependencies make a difference. Signed-off-by: Benoît Montagu <benoit.montagu@inria.fr>
The other PR I've mentioned was recently merged. I updated the tests. |
… that must be transitively closed. Added a test to witness the change. Signed-off-by: Benoît Montagu <benoit.montagu@inria.fr>
I integrated the changes from PR#5376. |
Looks good. Could you update CHANGES? |
Signed-off-by: Benoît Montagu <benoit.montagu@inria.fr>
Sure. Done. |
Cherry picked onto master. Thanks. |
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info and dune-action-plugin (3.1.0) CHANGES: - Add `sourcehut` as an option for defining project sources in dune-project files. For example, `(source (sourcehut user/repo))`. (ocaml/dune#5564, @rgrinberg) - Add `dune coq top` command for running a Coq toplevel (ocaml/dune#5457, @rlepigre) - Fix dune exec dumping database in wrong directory (ocaml/dune#5544, @bobot) - Always output absolute paths for locations in RPC reported diagnostics (ocaml/dune#5539, @rgrinberg) - Add `(deps <deps>)` in ctype field (ocaml/dune#5346, @bobot) - Add `(include <file>)` constructor to dependency specifications. This can be used to introduce dynamic dependencies (ocaml/dune#5442, @anmonteiro) - Ensure that `dune describe` computes a transitively closed set of libraries (ocaml/dune#5395, @esope) - Add direct dependencies to $ dune describe output (ocaml/dune#5412, @esope) - Show auto-detected concurrency on Windows too (ocaml/dune#5502, @MisterDA) - Fix operations that remove folders with absolute path. This happens when using esy (ocaml/dune#5507, @EduardoRFS) - Dune will not fail if some directories are non-empty when uninstalling. (ocaml/dune#5543, fixes ocaml/dune#5542, @nojb) - `coqdep` now depends only on the filesystem layout of the .v files, and not on their contents (ocaml/dune#5547, helps with ocaml/dune#5100, @ejgallego) - The mdx stanza 0.2 can now be used with `(implicit_transitive_deps false)` (ocaml/dune#5558, fixes ocaml/dune#5499, @emillon) - Fix missing parenthesis in printing of corresponding terminal command for `(with-outputs-to )` (ocaml/dune#5551, fixes ocaml/dune#5546, @Alizter)
The intention is that, for every library UID that is listed as a
requirement, there must exist a library item with that very UID in the
output of
dune describe
.Example:
With an empty
foo.ml
file, and the followingdune
file:the
dune describe command
currently produces the following output:That is to say, the external library
ppx_deriving.runtime
has adependency to another library with UID
62cfd7aaad132264861d2b6e82476877
, and that is not listed in thelist of libraries.
With the proposed PR,
dune describe
now outputs:where the missing library
result
is now part of the output.This PR is a complement to PR#5376, that adds to the output the libraries used by executables (and that are missing so far).
Signed-off-by: Benoît Montagu benoit.montagu@inria.fr