From 8bda23fadcc51c6ed38a4c3a75be25a266e8f7b4 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Mon, 4 Jun 2018 08:13:43 -0700 Subject: [PATCH] [release] preparing for binary releases Summary: Change the documentation to refer to (upcoming) binary releases. Update the scripts to treat .release differently: now we want to build clang and the plugins even in release mode, as that's just the preparation for the release tarball containing only binaries. Reviewed By: mbouaziz Differential Revision: D8235388 fbshipit-source-id: bfb4ae8 --- .gitignore | 1 + INSTALL.md | 24 ++++++++---------------- Makefile | 6 ------ autogen.sh | 8 ++++---- build-infer.sh | 10 ++++------ configure.ac | 13 +++++-------- scripts/create_binary_release.sh | 3 ++- 7 files changed, 24 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 98306b872..70a5b7c80 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ duplicates.txt /infer/tests/build_systems/genrule/report.json /infer/tests/build_systems/java_test_determinator/*.test /_release +/infer-source # generated by oUnit /oUnit-all.cache diff --git a/INSTALL.md b/INSTALL.md index c76ef362a..7c36ef2ec 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,22 +1,18 @@ # How to install Infer from source -## Pre-compiled clang versions +## Binary versions -We provide a source release of Infer packaged with pre-build binaries -for clang and facebook-clang-plugins for Linux and MacOS. We encourage -you to use this release as compiling clang is time-consuming. Install -the dependencies as explained in the next section, then follow the -instructions in our [Getting +We provide a binary release of Infer. We encourage you to use this +release as compiling infer's dependencies is time-consuming. Follow +the instructions in our [Getting Started](http://fbinfer.com/docs/getting-started.html#install-from-source) -page to compile and install Infer. +page to install Infer. ## Infer dependencies for MacOSX Here are the prerequisites to be able to compile Infer on MacOSX. This -is required to be able to [use the -release](http://fbinfer.com/docs/getting-started.html) (faster), or to -compile everything from source (see the end of this document). +is required to compile everything from source. - opam 1.2.2 (instructions [here](https://opam.ocaml.org/doc/Install.html#OSX)) - Python 2.7 @@ -41,9 +37,7 @@ brew cask install java ## Infer dependencies for Linux Here are the prerequisites to be able to compile Infer on Linux. This -is required to be able to [use the -release](http://fbinfer.com/docs/getting-started.html) (faster), or to -compile everything from source (see the end of this document). +is required to compile everything from source. - opam 1.2.2 - Python 2.7 @@ -73,9 +67,7 @@ Replace `./build-infer.sh java` with `./build-infer.sh clang` to build the C and Objective-C analyzer from source. Beware that this command may take a really long time because it will compile a custom version of clang. This custom version is used by Infer to parse C and -Objective-C source code. We encourage you to use [a -release](https://github.com/facebook/infer/releases/) instead, which -ship with clang already compiled. +Objective-C source code. See `./build-infer.sh --help` for more options, eg `./build-infer.sh` on its own will build the analyzers for both Java and C/ObjC. diff --git a/Makefile b/Makefile index 614b73dd0..804e3cead 100644 --- a/Makefile +++ b/Makefile @@ -257,7 +257,6 @@ clang_setup: .PHONY: clang_plugin clang_plugin: clang_setup -ifeq ($(IS_RELEASE_TREE),no) $(QUIET)$(call silent_on_success,Building clang plugin,\ $(MAKE) -C $(FCP_DIR)/libtooling all \ CC=$(CC) CXX=$(CXX) \ @@ -275,7 +274,6 @@ ifeq ($(IS_RELEASE_TREE),no) LOCAL_CLANG=$(CLANG_PREFIX)/bin/clang \ CLANG_PREFIX=$(CLANG_PREFIX) \ CLANG_INCLUDES=$(CLANG_INCLUDES)) -endif .PHONY: clang_plugin_test clang_plugin_test: clang_setup @@ -558,11 +556,9 @@ endif # Nuke objects built from OCaml. Useful when changing the OCaml compiler, for instance. .PHONY: ocaml_clean ocaml_clean: -ifeq ($(IS_RELEASE_TREE),no) ifeq ($(BUILD_C_ANALYZERS),yes) $(QUIET)$(call silent_on_success,Cleaning facebook-clang-plugins OCaml build,\ $(MAKE) -C $(FCP_DIR)/clang-ocaml clean) -endif endif $(QUIET)$(call silent_on_success,Cleaning infer OCaml build,\ $(MAKE) -C $(SRC_DIR) clean) @@ -571,11 +567,9 @@ endif .PHONY: clean clean: test_clean ocaml_clean -ifeq ($(IS_RELEASE_TREE),no) ifeq ($(BUILD_C_ANALYZERS),yes) $(QUIET)$(call silent_on_success,Cleaning facebook-clang-plugins C++ build,\ $(MAKE) -C $(FCP_DIR) clean) -endif endif $(QUIET)$(call silent_on_success,Cleaning Java annotations,\ $(MAKE) -C $(ANNOTATIONS_DIR) clean) diff --git a/autogen.sh b/autogen.sh index ea681623e..8b1d68c2d 100755 --- a/autogen.sh +++ b/autogen.sh @@ -25,10 +25,10 @@ fi # We need to record the date that the documentation was last modified to put in our man # pages. Unfortunately that information is only available reliably from `git`, which we don't have -# access to from other distributions of the infer source code, for instance our source -# releases. However, we do distribute the "configure" script in that case, so the idea is to bake -# this date inside "configure" so that it's available at build time. We do that by generating an m4 -# macro that hardcodes the date we compute in this script for "configure" to find. +# access to from other distributions of the infer source code. Such source distributions should +# distribute the "configure" script too. The idea is to bake this date inside "configure" so that +# it's available at build time. We do that by generating an m4 macro that hardcodes the date we +# compute in this script for "configure" to find. MAN_LAST_MODIFIED_M4=m4/__GENERATED__ac_check_infer_man_last_modified.m4 printf 'generating %s' "$MAN_LAST_MODIFIED_M4... " if test -d '.git' ; then diff --git a/build-infer.sh b/build-infer.sh index 86d866843..9d45d805a 100755 --- a/build-infer.sh +++ b/build-infer.sh @@ -201,12 +201,10 @@ if [ "$ONLY_SETUP_OPAM" = "yes" ]; then fi echo "preparing build... " >&2 -if [ ! -f .release ]; then - if [ "$BUILD_CLANG" = "no" ]; then - SKIP_SUBMODULES=true ./autogen.sh > /dev/null - else - ./autogen.sh > /dev/null - fi +if [ "$BUILD_CLANG" = "no" ]; then + SKIP_SUBMODULES=true ./autogen.sh > /dev/null +else + ./autogen.sh > /dev/null fi if [ "$BUILD_CLANG" = "no" ]; then diff --git a/configure.ac b/configure.ac index 1b77af90f..2b1b8cd2b 100644 --- a/configure.ac +++ b/configure.ac @@ -77,10 +77,10 @@ BUILD_PYTHON_ANALYZERS=$enable_python_analyzers AC_SUBST([BUILD_PYTHON_ANALYZERS]) 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)]), + AS_HELP_STRING([--with-fcp-clang], + [use $CLANG_PREFIX/bin/clang to override the default compiler (default is not to override)]), , - with_fcp_clang=$is_release_tree) + with_fcp_clang=no) AS_IF([test "x$enable_c_analyzers" = "xyes"], [ AC_MSG_CHECKING([whether to use the compilers in $CLANG_PREFIX/bin]) @@ -103,9 +103,7 @@ AS_IF([test "x$enable_c_analyzers" = "xyes"], [ AC_ASSERT_PROG([shasum], [$SHASUM]) # cmake is required to build llvm+clang AC_CHECK_TOOL([CMAKE], [cmake], [no]) - AS_IF([test "x$is_release_tree" = "xno"], [ - AC_ASSERT_PROG([cmake], [$CMAKE]) - ]) + AC_ASSERT_PROG([cmake], [$CMAKE]) AC_ARG_ENABLE(ocamlopt-custom-cc, AS_HELP_STRING([--enable-ocamlopt-custom-cc], [use CC in ocamlopt invocations]), , @@ -163,8 +161,7 @@ gcc version >= 4.7.2 or clang version >= 3.1. See the output of `./configure --help` to force the use of a different C compiler. -Alternatively, you can checkout a release of infer with clang -pre-compiled here: +Alternatively, you can checkout a binary release of infer: https://github.com/facebook/infer/releases/]) ] diff --git a/scripts/create_binary_release.sh b/scripts/create_binary_release.sh index de6322123..1b8d2dd1f 100755 --- a/scripts/create_binary_release.sh +++ b/scripts/create_binary_release.sh @@ -40,9 +40,10 @@ rm -fr "$RELEASE_NAME" ./build-infer.sh --only-setup-opam eval $(opam config env) +touch .release ./autogen.sh ./configure --prefix="/$RELEASE_NAME" -BUILD_MODE=opt make -j "$JOBS" install DESTDIR="$ROOT_DIR" libdir_relative_to_bindir=../lib +make -j "$JOBS" install BUILD_MODE=opt DESTDIR="$ROOT_DIR" libdir_relative_to_bindir=../lib popd if [ "$DRYRUN" = "no" ]; then