Skip to content

Commit

Permalink
Compile stubs for @check
Browse files Browse the repository at this point in the history
Without this, errors in C/C++ sources would be ignored when building
@check

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed Aug 9, 2019
1 parent 0c08c77 commit a44dba5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
presence of directories with only sub-directories and no files
(#2514, fixes #2499, @diml)

- Include building stubs in `@check` rules. (@rgrinberg, #2530)

1.11.0 (23/07/2019)
-------------------

Expand Down
6 changes: 6 additions & 0 deletions src/check_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ let add_obj_dir sctx ~obj_dir =
(Alias.check ~dir:(Obj_dir.dir obj_dir))
~dyn_deps
Path.Set.empty

let add_files sctx ~dir files =
if (Super_context.context sctx).merlin then
let alias = Alias.check ~dir in
let files = Path.Set.of_list files in
Rules.Produce.Alias.add_deps alias files
6 changes: 6 additions & 0 deletions src/check_rules.mli
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
open Stdune

val add_obj_dir : Super_context.t -> obj_dir:Path.Build.t Obj_dir.t -> unit

val add_files
: Super_context.t
-> dir:Path.Build.t
-> Path.t list
-> unit
1 change: 1 addition & 0 deletions src/lib_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ let build_stubs lib ~sctx ~dir ~expander ~requires ~dir_contents
else
[]
in
Check_rules.add_files sctx ~dir lib_o_files;
match vlib_stubs_o_files @ lib_o_files with
| [] -> ()
| o_files -> build_self_stubs lib ~sctx ~dir ~expander ~o_files
Expand Down
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/check-alias/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

$ dune build --root lib @check --display short && ls lib/.merlin
Entering directory 'lib'
ocamlc bar$ext_obj
ocamldep .foo.objs/foo.ml.d
ocamlc .foo.objs/byte/foo.{cmi,cmo,cmt}
lib/.merlin

0 comments on commit a44dba5

Please sign in to comment.