From ac082cfe0152459d55bcdd5f64312cec6b4ecea5 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 13 Dec 2016 10:23:48 -0800 Subject: [PATCH] [make] remove support for OCaml annot and other Eclipse-related quirks Summary: This removes support for developing infer using Eclipse. If you use Eclipse, consider using Atom/Emacs/vim instead, which have good OCaml/Reason support. This allows us to get rid of a couple quirks: - do not generated ocaml annots (this is very slow) - move OCaml _build directory to infer/src/ where it makes more sense Reviewed By: jberdine Differential Revision: D4319480 fbshipit-source-id: 6f063fc --- .gitignore | 3 --- Makefile.config.in | 3 +-- configure.ac | 7 ------- infer/.project | 17 ----------------- infer/src/.settings/ocp-indent.launch | 12 ------------ infer/src/Makefile | 25 ++++++------------------- 6 files changed, 7 insertions(+), 60 deletions(-) delete mode 100644 infer/.project delete mode 100644 infer/src/.settings/ocp-indent.launch diff --git a/.gitignore b/.gitignore index 51e04bd0b..9b08d76d9 100644 --- a/.gitignore +++ b/.gitignore @@ -24,9 +24,6 @@ duplicates.txt *.capture.bdump *.capture.biniou -# Directories generated by Ocamlbuild -_build - # generated by oUnit /oUnit-all.cache diff --git a/Makefile.config.in b/Makefile.config.in index 5cc4d1ec5..4657b6474 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -78,14 +78,13 @@ FCP_CLANG_OCAML_DIR = $(FCP_DIR)/clang-ocaml ANNOTATIONS_DIR = $(INFER_DIR)/annotations BIN_DIR = $(INFER_DIR)/bin -BUILD_DIR = $(INFER_DIR)/_build ETC_DIR = $(INFER_DIR)/etc LIB_DIR = $(INFER_DIR)/lib MODELS_DIR = $(INFER_DIR)/models JAVA_BUILTINS_DIR = $(MODELS_DIR)/java/builtins SRC_DIR = $(INFER_DIR)/src -ANNOT_DIR = $(SRC_DIR)/_build +BUILD_DIR = $(INFER_DIR)/_build INFER_BUILD_DIR = $(BUILD_DIR)/infer TEST_BUILD_DIR = $(BUILD_DIR)/test diff --git a/configure.ac b/configure.ac index e3d37c1cc..0392f1e24 100644 --- a/configure.ac +++ b/configure.ac @@ -231,13 +231,6 @@ fi AC_CHECK_TOOL([ATDGEN], [atdgen], [no]) AC_ASSERT_PROG([atdgen], [$ATDGEN]) -AC_ARG_ENABLE(ocaml-annot, - AS_HELP_STRING([--disable-ocaml-annot], [do not build ocaml .annot files]), - , - enable_ocaml_annot=yes) -ENABLE_OCAML_ANNOT=$enable_ocaml_annot -AC_SUBST([ENABLE_OCAML_ANNOT]) - AC_ARG_ENABLE(ocaml-bin-annot, AS_HELP_STRING([--disable-ocaml-bin-annot], [do not build ocaml .cmt files]), , diff --git a/infer/.project b/infer/.project deleted file mode 100644 index 513728ddf..000000000 --- a/infer/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - EdgNative - - - - - - Ocaml.ocamlMakefileBuilder - - - - - - ocaml.ocamlnatureMakefile - - diff --git a/infer/src/.settings/ocp-indent.launch b/infer/src/.settings/ocp-indent.launch deleted file mode 100644 index 8bdf14d65..000000000 --- a/infer/src/.settings/ocp-indent.launch +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/infer/src/Makefile b/infer/src/Makefile index c3f292eb9..cb43202f0 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -10,8 +10,6 @@ include $(ROOT_DIR)/Makefile.config #### Global declarations #### -INFER_BUILD_DIR = $(BUILD_DIR)/infer -ANNOT_DIR = $(SRC_DIR)/_build ETC_DIR = $(INFER_DIR)/etc ATDGEN_SUFFIXES = _t.ml _t.mli _j.ml _j.mli @@ -39,10 +37,6 @@ OCAMLBUILD_OPTIONS = \ -tag thread \ -pkgs atdgen,core,ctypes.foreign,oUnit,str,unix,yojson,zip -ifeq ($(ENABLE_OCAML_ANNOT),yes) -OCAMLBUILD_OPTIONS += -cflags -annot -endif - ifeq ($(ENABLE_OCAML_BINANNOT),yes) OCAMLBUILD_OPTIONS += -cflags -bin-annot endif @@ -130,7 +124,7 @@ CHECKCOPYRIGHT_MAIN = $(SCRIPT_SOURCES)/checkCopyright #### End of declarations #### ifeq ($(IS_FACEBOOK_TREE),yes) -EXTRA_DEPS = facebook facebook/checkers facebook/checkers/graphql facebook/scripts +EXTRA_DEPS = facebook facebook/scripts else EXTRA_DEPS = opensource endif @@ -193,9 +187,6 @@ ifeq ($(BUILD_C_ANALYZERS),yes) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN) cd $(INFER_BUILD_DIR) && $(LN_S) -f InferClang InferClang++ && cd - endif -ifeq ($(ENABLE_OCAML_ANNOT),yes) - rsync -a --include '*/' --include '*.annot' --exclude '*' $(INFER_BUILD_DIR)/ $(ANNOT_DIR)/ -endif ifeq ($(BUILD_C_ANALYZERS),yes) infer: $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) $(CLANG_BINIOU_DICT) @@ -228,10 +219,10 @@ test_build: init $(STACKTREE_ATDGEN_STUBS) $(INFERPRINT_ATDGEN_STUBS) $(CLANG_AT # to generate interface file.mli from implementation file.ml execute: # make M=file mli mli: - ocamlfind ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I ../_build/infer/,$(DEPENDENCIES)) -i $(M).ml > $(M).mli + ocamlfind ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I $(INFER_BUILD_DIR),$(DEPENDENCIES)) -i $(M).ml > $(M).mli rei: - ocamlfind ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I ../_build/infer/,$(DEPENDENCIES)) -i -pp refmt -impl $(M).re > $(M).rei + ocamlfind ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I $(INFER_BUILD_DIR),$(DEPENDENCIES)) -i -pp refmt -impl $(M).re > $(M).rei # convert to reason %.re : %.ml @@ -243,10 +234,9 @@ rei: roots:=Infer InferAnalyzeExe InferClang JMain InferPrintExe StatsAggregator clusters:=base clang java IR -src_dirs:=$(shell find * -type d) -ml_src_files:=$(shell find $(src_dirs) -regex '.*\.ml\(i\)*' -not -path facebook/scripts/eradicate_stats.ml -not -path 'stubs/c/*') -re_src_files:=$(shell find $(src_dirs) -regex '.*\.re\(i\)*') -inc_flags:=$(foreach dir,$(src_dirs),-I $(dir)) +ml_src_files:=$(shell find $(DEPENDENCIES) -regex '.*\.ml\(i\)*' -not -path facebook/scripts/eradicate_stats.ml -not -path 'stubs/c/*') +re_src_files:=$(shell find $(DEPENDENCIES) -regex '.*\.re\(i\)*') +inc_flags:=$(foreach dir,$(DEPENDENCIES),-I $(dir)) root_flags:=$(foreach root,$(roots),-r $(root)) cluster_flags:=$(foreach cluster,$(clusters),-c $(cluster)) @@ -376,9 +366,6 @@ test_clean: clean: $(REMOVE_DIR) $(BUILD_DIR) $(REMOVE) $(ETC_DIR)/clang_ast.dict -ifeq ($(ENABLE_OCAML_ANNOT),yes) - $(REMOVE_DIR) $(ANNOT_DIR) -endif $(REMOVE) base/Version.ml $(REMOVE) base/Version.ml.tmp.* $(REMOVE) backend/jsonbug_{j,t}.ml{,i}