Skip to content

Commit

Permalink
fix(describe-pp): show output on successive runs
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Mar 30, 2024
1 parent 0f07d9d commit 3a6e012
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/describe/describe_pp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ let print_pped_file sctx file pp_file =
in
Action_builder.evaluate_and_collect_facts build
in
let observing_facts =
(* We add `(universe)` to the dependencies of this action so that `dune
describe pp` always prints output *)
match Dep.Map.add observing_facts Dep.universe Dep.Fact.nothing with
| Ok x -> x
| Error _ -> observing_facts
in
Build_system.execute_action ~observing_facts { action; loc; dir; alias = None }
;;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ We can show the preprocessed output of a source code
$ dune describe pp src/main.ml
;;Util.log "Hello, world!"

Re-running the command keeps showing output

$ dune describe pp src/main.ml
;;Util.log "Hello, world!"

We can also show the original source if it is not preprocessed

$ dune describe pp src/util.ml
Expand Down

0 comments on commit 3a6e012

Please sign in to comment.