Skip to content

Commit

Permalink
fix: do not run rules outside of Build_system.run
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Feb 8, 2022
1 parent 0bcf3a3 commit 83480fd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
13 changes: 9 additions & 4 deletions bin/describe.ml
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,14 @@ let term : unit Term.t =
let* setup = Import.Main.setup () in
let* setup = Memo.Build.run setup in
let context = Import.Main.find_context_exn setup ~name:context_name in
let+ res = Memo.Build.run (What.describe what options setup context) in
match format with
| Csexp -> Csexp.to_channel stdout (Sexp.of_dyn res)
| Sexp -> print_as_sexp res)
let+ res =
Build_system.run (fun () -> What.describe what options setup context)
in
match res with
| Error `Already_reported -> ()
| Ok res -> (
match format with
| Csexp -> Csexp.to_channel stdout (Sexp.of_dyn res)
| Sexp -> print_as_sexp res))

let command : unit Term.t * Term.info = (term, info)
30 changes: 16 additions & 14 deletions test/blackbox-tests/test-cases/describe.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Describe various things
((name bar)
(uid 97586d5adea44246d88d31b0f6e340ed)
(local true)
(requires (b13e404f0f2441ffa82284dcf008c3ea))
(requires (9ed1d72dc21827b45479492c0bbb4462))
(source_dir _build/default)
(modules
(((name Bar2)
Expand Down Expand Up @@ -185,16 +185,17 @@ Describe various things
(include_dirs (_build/default/.foo_x.objs/byte))))
(library
((name ppx_inline_test.runtime-lib)
(uid b13e404f0f2441ffa82284dcf008c3ea)
(uid 9ed1d72dc21827b45479492c0bbb4462)
(local false)
(requires
(044a84a512a8cdf58b1ed9e92494d2ec
57f07ff97d4e072bff92dfb4e9b7b8bd
9b92cba59819bd732b556f904a49c39d))
(source_dir /home/bmontagu/.opam/4.13.1/lib/ppx_inline_test/runtime-lib)
(1f21b37866ba38ff793ea459291e8f1b
852eb703a825c761732e04cdf6ee6bc2
b491f2077664db66388b26b2991b9041))
(source_dir
/Users/rgrinberg/github/ocaml/dune/_opam/lib/ppx_inline_test/runtime-lib)
(modules ())
(include_dirs
(/home/bmontagu/.opam/4.13.1/lib/ppx_inline_test/runtime-lib)))))
(/Users/rgrinberg/github/ocaml/dune/_opam/lib/ppx_inline_test/runtime-lib)))))

$ dune describe workspace --lang 0.1 --with-deps
((executables
Expand Down Expand Up @@ -269,7 +270,7 @@ Describe various things
((name bar)
(uid 97586d5adea44246d88d31b0f6e340ed)
(local true)
(requires (b13e404f0f2441ffa82284dcf008c3ea))
(requires (9ed1d72dc21827b45479492c0bbb4462))
(source_dir _build/default)
(modules
(((name Bar2)
Expand Down Expand Up @@ -327,16 +328,17 @@ Describe various things
(include_dirs (_build/default/.foo_x.objs/byte))))
(library
((name ppx_inline_test.runtime-lib)
(uid b13e404f0f2441ffa82284dcf008c3ea)
(uid 9ed1d72dc21827b45479492c0bbb4462)
(local false)
(requires
(044a84a512a8cdf58b1ed9e92494d2ec
57f07ff97d4e072bff92dfb4e9b7b8bd
9b92cba59819bd732b556f904a49c39d))
(source_dir /home/bmontagu/.opam/4.13.1/lib/ppx_inline_test/runtime-lib)
(1f21b37866ba38ff793ea459291e8f1b
852eb703a825c761732e04cdf6ee6bc2
b491f2077664db66388b26b2991b9041))
(source_dir
/Users/rgrinberg/github/ocaml/dune/_opam/lib/ppx_inline_test/runtime-lib)
(modules ())
(include_dirs
(/home/bmontagu/.opam/4.13.1/lib/ppx_inline_test/runtime-lib)))))
(/Users/rgrinberg/github/ocaml/dune/_opam/lib/ppx_inline_test/runtime-lib)))))


Test other formats
Expand Down

0 comments on commit 83480fd

Please sign in to comment.