From 92aef2a4110cb9cf491a054fe5617b5826c2ccc8 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 20 May 2016 05:18:25 -0700 Subject: [PATCH] fix make -j8 clean test Summary: `make clean all test` worked, but not `make clean test` because `test` only builds stuff in infer/src/ (no models, no infer/bin/infer). For now, fix the workflow by building both `infer` and `test_build` in different directories (so they can be parallelized). Reviewed By: jberdine Differential Revision: D3322797 fbshipit-source-id: 71d146d --- Makefile.in | 18 +++++++++--------- infer/src/Makefile.in | 15 ++++----------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/Makefile.in b/Makefile.in index d4e0f83db..79b5d7c52 100644 --- a/Makefile.in +++ b/Makefile.in @@ -66,17 +66,17 @@ endif test_build: clang_plugin $(MAKE) -C $(SRC_DIR) test_build -ocaml_unit_test: test_build +ocaml_unit_test: infer $(INFERUNIT_BIN) -buck_test: test_build +buck_test: infer NO_BUCKD=1 buck clean NO_BUCKD=1 buck test $(TARGETS_TO_TEST) ifeq (@BUILD_JAVA_ANALYZERS@,yes) NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py endif -buck_test_xml: test_build +buck_test_xml: infer NO_BUCKD=1 buck clean NO_BUCKD=1 buck test --xml test.xml $(TARGETS_TO_TEST) ifeq (@BUILD_JAVA_ANALYZERS@,yes) @@ -86,7 +86,7 @@ endif inferTraceBugs: $(MAKE) -C $(INFER_DIR) $(INFERTRACEBUGS_BIN_RELPATH) -inferTraceBugs_test: test_build +inferTraceBugs_test: infer $(INFER_BIN) -o __test-infer-out__ -- \ javac $(EXAMPLES_DIR)/Hello.java \ > /dev/null @@ -109,7 +109,8 @@ check_missing_mli: test: test_build ocaml_unit_test buck_test inferTraceBugs_test $(MAKE) -C $(SRC_DIR) mod_dep.dot -test_xml: buck_test_xml +test_xml: test_build ocaml_unit_test buck_test_xml inferTraceBugs_test + $(MAKE) -C $(SRC_DIR) mod_dep.dot uninstall: $(REMOVE_DIR) $(DESTDIR)$(libdir)/infer/ @@ -239,7 +240,6 @@ conf-clean: clean $(REMOVE_DIR) infer/models/objc/out/ $(REMOVE) infer/src/Makefile -.PHONY: all buck_test buck_test_xml clean -.PHONY: clang_plugin clang_setup infer inferTraceBugs inferTraceBugs_test -.PHONY: ocaml_unit_test check_missing_mli test test_xml test_build -.PHONY: install uninstall +.PHONY: all buck_test buck_test_xml clean clang_plugin clang_setup infer inferTraceBugs +.PHONY: inferTraceBugs_test ocaml_unit_test check_missing_mli test test_xml test_build install +.PHONY: uninstall diff --git a/infer/src/Makefile.in b/infer/src/Makefile.in index 3c227ae6d..41baa7ebe 100644 --- a/infer/src/Makefile.in +++ b/infer/src/Makefile.in @@ -19,6 +19,7 @@ ATDGEN = @ATDGEN@ BUILD_DIR = $(INFER_DIR)/_build INFER_BUILD_DIR = $(BUILD_DIR)/infer +TEST_BUILD_DIR = $(BUILD_DIR)/test LLVM_BUILD_DIR = $(BUILD_DIR)/llvm ANNOT_DIR = $(SRC_DIR)/_build ETC_DIR = $(INFER_DIR)/etc @@ -28,7 +29,6 @@ ETC_DIR = $(INFER_DIR)/etc OCAML_FATAL_WARNINGS = +5+6+8+10+11+12+18+19+20+26+29+27+32+33+34+35+37+38+39 OCAMLBUILD_OPTIONS = \ - -classic-display \ -r \ -cflags -g -lflags -g \ -cflags -short-paths \ @@ -220,16 +220,9 @@ module: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_ test_build: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) \ $(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml - $(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) \ + $(OCAMLBUILD_ALL) -build-dir $(TEST_BUILD_DIR) \ -cflags -warn-error,$(OCAML_FATAL_WARNINGS) \ - $(INFER_ALL_TARGETS) - $(COPY) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN) - $(COPY) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) - $(COPY) $(INFER_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN) - $(COPY) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN) - $(COPY) $(INFER_BUILD_DIR)/$(INFERLLVM_MAIN).native $(INFERLLVM_BIN) - $(COPY) $(INFER_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN) - $(COPY) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN) + $(INFER_ALL_TARGETS:.native=.byte) $(DEPENDENCIES_DIR)/ocamldot/ocamldot: $(MAKE) -C $(DEPENDENCIES_DIR)/ocamldot @@ -311,7 +304,7 @@ $(BUILD_DIR): $(MKDIR_P) $(BUILD_DIR) test_clean: - $(REMOVE_DIR) $(INFER_BUILD_DIR) + $(REMOVE_DIR) $(TEST_BUILD_DIR) clean: $(REMOVE_DIR) $(BUILD_DIR)