From 888ca463718ca67a3b930af6be2288ab527d3ecb Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 15 Aug 2017 02:25:29 -0700 Subject: [PATCH] [make] fix issue that breaks build incrementality Summary: The issue was as follows: - ppx.exe depended on all the ocaml source files - ppx.exe is an implicit prerequisit of all the (non-automatically-generated) build objects in jbuilder - as a result, when modifying a source file, we would recompile ppx.exe, thus all the source files ppx.exe only needs to depend on all the generated source files, so that jbuilder can find them all. Reviewed By: jberdine Differential Revision: D5621007 fbshipit-source-id: 92c5b9c --- infer/src/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/infer/src/Makefile b/infer/src/Makefile index a30119b1d..4873abcad 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -102,18 +102,21 @@ ifeq ($(TEST),1) INFER_CONFIG_TARGETS += $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).exe endif -OCAML_SOURCES = \ - $(wildcard */[a-zA-Z]*.ml */[a-zA-Z]*.ml[ily]) \ +OCAML_GENERATED_SOURCES = \ base/Version.ml $(STACKTREE_ATDGEN_STUBS) $(INFERPRINT_ATDGEN_STUBS) ifeq ($(BUILD_C_ANALYZERS),yes) -OCAML_SOURCES += $(CLANG_ATDGEN_STUBS) $(CLANG_PLUGIN_MIRRORED_FILES) +OCAML_GENERATED_SOURCES += $(CLANG_ATDGEN_STUBS) $(CLANG_PLUGIN_MIRRORED_FILES) endif +OCAML_SOURCES = \ + $(wildcard */[a-zA-Z]*.ml */[a-zA-Z]*.ml[ily]) \ + $(OCAML_GENERATED_SOURCES) + .PHONY: all all: infer -$(INFER_BUILD_DIR)/.ppx/ppx_compare/ppx.exe: jbuild jbuild-workspace $(OCAML_SOURCES) +$(INFER_BUILD_DIR)/.ppx/ppx_compare/ppx.exe: jbuild jbuild-workspace $(OCAML_GENERATED_SOURCES) # some voodoo to make jbuilder tolerate being run in parallel: force jbuilder to build its # jbuild files and some files that have been seen to race otherwise jbuilder build \