diff --git a/.gitignore b/.gitignore index 682df9887..63a7c737c 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ _build /infer/models/java/Makefile /infer/models/objc/Makefile /infer/src/Makefile +/.buckversion # IntelliJ files /scripts/.idea/ diff --git a/Makefile.in b/Makefile.in index f91db527e..9494cbff8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -65,7 +65,7 @@ clang_setup: $(FCP_DIR)/clang/setup.sh clang_plugin: clang_setup -ifeq (@INFER_IS_RELEASE@,no) +ifeq (@IS_RELEASE_TREE@,no) $(MAKE) -C $(FCP_DIR)/libtooling all \ CC=@CC@ CXX=@CXX@ \ CXX="@CXX@" CXXFLAGS="@CXXFLAGS@" \ diff --git a/configure.ac b/configure.ac index 2ebb41f86..e91ca9eb6 100644 --- a/configure.ac +++ b/configure.ac @@ -28,13 +28,15 @@ AC_SUBST([INFER_MAJOR]) AC_SUBST([INFER_MINOR]) AC_SUBST([INFER_PATCH]) -# record if we are in a release of Infer -AC_MSG_CHECKING([if we are in an Infer release build]) -is_infer_release=no -AS_IF([test -f ".release"], [is_infer_release=yes]) -INFER_IS_RELEASE=$is_infer_release -AC_SUBST([INFER_IS_RELEASE]) -AC_MSG_RESULT([$is_infer_release]) +# are we in a release source tree +AC_CHECK_FILE([.release], [is_release_tree=yes], [is_release_tree=no]) +IS_RELEASE_TREE=$is_release_tree +AC_SUBST([IS_RELEASE_TREE]) + +# are we in an internal source tree +AC_CHECK_FILE([.facebook], [is_facebook_tree=yes], [is_facebook_tree=no]) +IS_FACEBOOK_TREE=$is_facebook_tree +AC_SUBST([IS_FACEBOOK_TREE]) # to compile the facebook-clang-plugins AC_ARG_VAR([CLANG_PREFIX], [directory where clang is installed (defaults=$PWD/facebook-clang-plugins/clang)]) @@ -69,7 +71,7 @@ AC_ARG_WITH(fcp-clang, AS_HELP_STRING([--without-fcp-clang], [do not use $CLANG_PREFIX/bin/clang to override the default compiler (default is to override if in an infer release)]), , - with_fcp_clang=$is_infer_release) + with_fcp_clang=$is_release_tree) AS_IF([test "x$enable_c_analyzers" = "xyes"], [ AC_MSG_CHECKING([whether to use the compilers in $CLANG_PREFIX/bin]) @@ -226,6 +228,18 @@ ENABLE_OCAML_BINANNOT=$enable_ocaml_bin_annot AC_SUBST([ENABLE_OCAML_BINANNOT]) +# We use Buck to run the Infer tests +AC_MSG_CHECKING([which version of Buck to use]) +buckversion_file=.buckversion +oss_buck_version=a965937ccdadf8119a98ab766c3feb0708dc424e +fb_buck_version=440619c312cf07951891083d8f02d05a713205b5 +AS_IF([test x"$is_facebook_tree" = x"yes"], + [buck_version=$fb_buck_version], + [buck_version=$oss_buck_version]) +echo $buck_version > "$buckversion_file" +AC_MSG_RESULT([$buck_version]) + + AC_CONFIG_FILES([ Makefile.config Makefile diff --git a/infer/src/Makefile.in b/infer/src/Makefile.in index 5be83f6b6..ce2531c00 100644 --- a/infer/src/Makefile.in +++ b/infer/src/Makefile.in @@ -11,7 +11,7 @@ include $(ROOT_DIR)/Makefile.config INFER_MAJOR = @INFER_MAJOR@ INFER_MINOR = @INFER_MINOR@ INFER_PATCH = @INFER_PATCH@ -INFER_IS_RELEASE = @INFER_IS_RELEASE@ +IS_RELEASE_TREE = @IS_RELEASE_TREE@ ATDGEN = @ATDGEN@ @@ -122,12 +122,10 @@ CHECKCOPYRIGHT_MAIN = $(SCRIPT_SOURCES)/checkCopyright #### End of declarations #### -# Check whether .facebook file exists in a root directory. -# Based on that determine which code should be loaded -ifeq ($(wildcard $(ROOT_DIR)/.facebook),) - EXTRA_DEPS = opensource +ifeq (@IS_FACEBOOK_TREE@,yes) +EXTRA_DEPS = facebook else - EXTRA_DEPS = facebook +EXTRA_DEPS = opensource endif DEPENDENCIES = IR backend checkers eradicate harness \ @@ -268,7 +266,7 @@ version: backend/version.ml.in Makefile -e 's|@INFER_MAJOR[@]|$(INFER_MAJOR)|g' \ -e 's|@INFER_MINOR[@]|$(INFER_MINOR)|g' \ -e 's|@INFER_PATCH[@]|$(INFER_PATCH)|g' \ - -e 's|@INFER_IS_RELEASE[@]|$(INFER_IS_RELEASE)|g' \ + -e 's|@IS_RELEASE_TREE[@]|$(IS_RELEASE_TREE)|g' \ -e "s|@INFER_GIT_COMMIT[@]|$$INFER_GIT_COMMIT|g" \ -e "s|@INFER_GIT_BRANCH[@]|$$INFER_GIT_BRANCH|g" \ $< > "$$TMPFILE"; \ diff --git a/infer/src/backend/version.ml.in b/infer/src/backend/version.ml.in index 5ed7588da..ceaa74066 100644 --- a/infer/src/backend/version.ml.in +++ b/infer/src/backend/version.ml.in @@ -14,7 +14,7 @@ let patch = @INFER_PATCH@ let commit = "@INFER_GIT_COMMIT@" let branch = "@INFER_GIT_BRANCH@" -let is_release = string_equal "@INFER_IS_RELEASE@" "yes" +let is_release = string_equal "@IS_RELEASE_TREE@" "yes" let tag = Printf.sprintf "v%d.%d.%d" major minor patch let versionString =