[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
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 863cc534b2
commit ac082cfe01

3
.gitignore vendored

@ -24,9 +24,6 @@ duplicates.txt
*.capture.bdump
*.capture.biniou
# Directories generated by Ocamlbuild
_build
# generated by oUnit
/oUnit-all.cache

@ -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

@ -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]),
,

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>EdgNative</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>Ocaml.ocamlMakefileBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>ocaml.ocamlnatureMakefile</nature>
</natures>
</projectDescription>

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
<stringAttribute key="bad_container_name" value="/infer/.run"/>
<booleanAttribute key="org.eclipse.debug.core.ATTR_REFRESH_RECURSIVE" value="false"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${resource}"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
</listAttribute>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${system_path:ocp-indent}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-i&#10;${resource_loc}"/>
</launchConfiguration>

@ -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}

Loading…
Cancel
Save