Skip to content

Added dependencies of executables to the output of dune describe#5376

Closed
esope wants to merge 14 commits intoocaml:mainfrom
esope:describe_more
Closed

Added dependencies of executables to the output of dune describe#5376
esope wants to merge 14 commits intoocaml:mainfrom
esope:describe_more

Conversation

@esope
Copy link
Copy Markdown
Collaborator

@esope esope commented Jan 24, 2022

The direct dependencies of executables to (external) libraries were
forgotten so far.

For example, with an empty foo.ml file and a dune file containing

(executable
 (name foo)
 (libraries cmdliner)
)

the command dune describe was printing

((executables        
  ((names (foo))
   (requires (0ca97fa3e29501e21524582fcb1993ce))
   (modules
    (((name Foo)
      (impl (_build/default/foo.ml))
      (intf ())
      (cmt (_build/default/.foo.eobjs/byte/dune__exe__Foo.cmt))
      (cmti ()))))
   (include_dirs (_build/default/.foo.eobjs/byte)))))

The dependence to cmdliner was given by mentioning its hash, but there was no entry of a library with this hash in the produced output.

With this patch, dune describe now outputs

((executables                   
  ((names (foo))
   (requires (0ca97fa3e29501e21524582fcb1993ce))
   (modules
    (((name Foo)
      (impl (_build/default/foo.ml))
      (intf ())
      (cmt (_build/default/.foo.eobjs/byte/dune__exe__Foo.cmt))
      (cmti ()))))
   (include_dirs (_build/default/.foo.eobjs/byte))))
 (library
  ((name cmdliner)
   (uid 0ca97fa3e29501e21524582fcb1993ce)
   (local false)
   (requires ())
   (source_dir /home/bmontagu/.opam/4.13.1/lib/cmdliner)
   (modules ())
   (include_dirs (/home/bmontagu/.opam/4.13.1/lib/cmdliner)))))

where the new item for the cmdliner library is now present.

This PR complements PR#5395, that ensures that the set of libraries a project depends on is transitively closed.

Signed-off-by: Benoît Montagu benoit.montagu@inria.fr

@esope esope changed the title Added dependencies of executables to the output of 'dune describe' Added dependencies of executables to the output of dune describe Jan 31, 2022
@esope
Copy link
Copy Markdown
Collaborator Author

esope commented Feb 15, 2022

This PR is a complement to PR#5395.
@rgrinberg: if you think it makes sense, I can add the changes of the current PR to PR#5395, so that PR#5395 is more self-contained.

@rgrinberg
Copy link
Copy Markdown
Member

One PR would be preferred.

@esope
Copy link
Copy Markdown
Collaborator Author

esope commented Feb 15, 2022

Fine. I ported the changes to PR#5395.
I am now closing the current PR.

@esope esope closed this Feb 15, 2022
@esope esope deleted the describe_more branch February 15, 2022 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants