Skip to content
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

Fix printing internal libs with the command "dune describe external-lib-deps" #6370

Merged
merged 4 commits into from
Nov 14, 2022
Merged
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
5 changes: 3 additions & 2 deletions bin/describe.ml
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,10 @@ module External_lib_deps = struct
let external_resolved_libs setup super_context =
let open Memo.O in
let context = Super_context.context super_context in
let* public_libs = Scope.DB.public_libs context in
let* scope = Scope.DB.find_by_dir context.build_dir in
let db = Scope.libs scope in
let* libs = libs context setup in
external_lib_deps public_libs libs
external_lib_deps db libs

let to_dyn context_name external_resolved_libs =
Dyn.Tuple
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(library
(name foo)
(libraries inter_lib a))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(lang dune 1.9)
(name foo)
(allow_approximate_merlin true)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(library
(name inter_lib)
(libraries a))
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Expected: The dependency "inter_lib" in ./dune file was printed, the "inter_lib" lib is already
an internal lib that declared in ./lib/dune file. The command "dune describe external-lib-deps"
print only the external libraries by dir.

$ dune describe external-lib-deps
(default
((. ((a required)))
(lib ((a required)))))