add options to ./build-infer.sh to only opam deps, and to force the opam switch, delete yarn

Reviewed By: jberdine

Differential Revision: D4827998

fbshipit-source-id: ff06e75
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent b539366a5c
commit f4cbba109e

6
.gitignore vendored

@ -138,11 +138,5 @@ infer/src/.project
/infer/src/mod_dep.dot
/infer/src/mod_dep.pdf
# node_modules for build artifacts
/node_modules/*
# build artifacts cache
/.yarn/*
# generated by Maven
/infer/annotations/target

@ -1 +0,0 @@
yarn-offline-mirror=./facebook/dependencies/offline-mirror

@ -8,11 +8,6 @@
ROOT_DIR = .
include $(ROOT_DIR)/Makefile.config
ifeq ($(IS_FACEBOOK_TREE),yes)
# With this makefile, all targets will default to have right env variables pointing to the sandbox
include $(ROOT_DIR)/facebook/Makefile.env
endif
ifeq ($(BUILD_C_ANALYZERS),yes)
BUILD_SYSTEMS_TESTS += \
assembly \

@ -52,6 +52,7 @@ OCAMLC = @OCAMLC@
OCAMLFIND = @OCAMLFIND@
OCAMLLEX = @OCAMLLEX@
OCAMLOPT = @OCAMLOPT@
PATH = @PATH@
prefix = @prefix@
PYTHON_lxml = @PYTHON_lxml@
REBUILD = @REBUILD@
@ -67,9 +68,7 @@ else
LN_S = @LN_S@ -v
endif
# Export parts of the config relevant to the compilation (taken from `opam config env`) in case the
# user runs `./configure` in some configuration but `make` in another.
export PATH := $(shell cd "$(dir $(REBUILD))" && pwd):$(PATH)
ifneq ($(CAML_LD_LIBRARY_PATH),)
# Export parts of the config relevant to running other programs
# be merciful and allow PATH to be updated between ./configure and make
export PATH := $(shell printf "%s" "$$PATH"):$(PATH)
export CAML_LD_LIBRARY_PATH := $(CAML_LD_LIBRARY_PATH)
endif

@ -145,8 +145,9 @@ define silent_on_success
UNIX_START_DATE=$$(date +"%s"); \
HUMAN_START_DATE=$$(date +"%H:%M:%S"); \
if [ -z $(SILENT) ]; then \
printf '[%s][%$(MAX_PID_SIZE)s] $(TERM_INFO)$(1)...$(TERM_RESET)\n' \
"$$HUMAN_START_DATE" "$$HASH"; \
printf "[%s][%$(MAX_PID_SIZE)s] $(TERM_INFO)" "$$HUMAN_START_DATE" "$$HASH"; \
printf '%s' "$(1)"; \
printf '...$(TERM_RESET)\n'; \
fi; \
$(MKDIR_P) $(ABSOLUTE_ROOT_DIR)/_build_logs; \
($(2)) 1>$(ABSOLUTE_ROOT_DIR)/_build_logs/cmd-$$HASH.out \
@ -165,7 +166,9 @@ define silent_on_success
exit 1; \
elif [ -z $(SILENT) ]; then \
UNIX_END_DATE=$$(date +"%s"); \
printf '[%7ss][%$(MAX_PID_SIZE)s] $(TERM_SUCCESS)SUCCESS $(1)$(TERM_RESET)\n' \
printf '[%7ss][%$(MAX_PID_SIZE)s] $(TERM_SUCCESS)SUCCESS ' \
"$$(($$UNIX_END_DATE - $$UNIX_START_DATE))" "$$HASH"; \
printf '%s' "$(1)"; \
printf '$(TERM_RESET)\n'; \
fi
endef

@ -15,6 +15,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INFER_ROOT="$SCRIPT_DIR/../"
PLATFORM="$(uname)"
NCPU="$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)"
OCAML_VERSION="4.02.3"
function usage() {
echo "Usage: $0 [-y] [targets]"
@ -35,9 +36,11 @@ function usage() {
}
# arguments
BUILD_CLANG=no
BUILD_JAVA=no
INTERACTIVE=yes
BUILD_CLANG=${BUILD_CLANG:-no}
BUILD_JAVA=${BUILD_JAVA:-no}
INTERACTIVE=${INTERACTIVE:-yes}
ONLY_SETUP_OPAM=${ONLY_SETUP_OPAM:-no}
# do not set INFER_OPAM_SWITCH by default
ORIG_ARGS="$*"
while [[ $# > 0 ]]; do
@ -63,6 +66,18 @@ while [[ $# > 0 ]]; do
usage
exit 0
;;
--opam-switch)
shift
[[ $# > 0 ]] || (usage; exit 1)
INFER_OPAM_SWITCH="$1"
shift
continue
;;
--only-setup-opam)
ONLY_SETUP_OPAM=yes
shift
continue
;;
-y|--yes)
INTERACTIVE=no
shift
@ -96,12 +111,8 @@ check_installed () {
}
setup_opam () {
OCAML_VERSION="4.02.3"
opam init --compiler=$OCAML_VERSION -j $NCPU --no-setup --yes
OPAMSWITCH=infer-$OCAML_VERSION
opam switch set -j $NCPU $OPAMSWITCH --alias-of $OCAML_VERSION
opam switch set -j $NCPU $INFER_OPAM_SWITCH --alias-of $OCAML_VERSION
}
add_opam_git_pin () {
@ -128,11 +139,19 @@ install_opam_deps () {
echo "initializing opam... "
check_installed opam
setup_opam
eval $(SHELL=bash opam config env --switch=$OPAMSWITCH)
if [ -z $INFER_OPAM_SWITCH ]; then
# the user didn't pass an opam switch explicitly, set up a custom switch for infer
INFER_OPAM_SWITCH=infer-"$OCAML_VERSION"
setup_opam
fi
eval $(SHELL=bash opam config env --switch=$INFER_OPAM_SWITCH)
echo "installing infer dependencies... "
install_opam_deps
if [ "$ONLY_SETUP_OPAM" = "yes" ]; then
exit 0
fi
echo "preparing build... "
if [ ! -f .release ]; then
if [ "$BUILD_CLANG" = "no" ]; then

@ -39,6 +39,8 @@ AC_CHECK_FILE([.facebook], [is_facebook_tree=yes], [is_facebook_tree=no])
IS_FACEBOOK_TREE=$is_facebook_tree
AC_SUBST([IS_FACEBOOK_TREE])
AC_ARG_VAR([PATH], [the shell's $PATH list of directories to search for executables])
# to compile the facebook-clang-plugins
AC_ARG_VAR([CLANG_PREFIX], [directory where clang is installed (defaults=$PWD/facebook-clang-plugins/clang/install)])
AS_IF([test "x$CLANG_PREFIX" = "x"], [
@ -290,10 +292,7 @@ AC_CHECK_PYTHON_MODULE([$PYTHON27], [lxml])
AC_PATH_TOOL([XCPRETTY], [xcpretty], [no])
BREW=no
if which brew > /dev/null; then
BREW="$(which brew)"
fi
AC_PATH_TOOL([BREW], [brew], [no])
# warn about broken pkg-config version for brew users
if test "$BREW" != "no"; then

@ -1,35 +0,0 @@
{
"version": "0.11.0",
"description": "infer",
"exportedEnvVars": {
"FINDLIB": {
"global": true,
"resolveAsRelativePath": true,
"globalCollisionBehavior": "joinPath",
"val": "./_build/ocamlfind/lib"
}
},
"name": "infer",
"dependencies": {
"@opam-alpha/ocamlfind": "*",
"@opam-alpha/core": "113.33.3",
"@opam-alpha/ctypes": "0.9.2",
"@opam-alpha/ctypes-foreign": "0.4.0",
"@opam-alpha/ocaml": "4.2.3",
"@opam-alpha/sawja": "^ 1.5.2",
"@opam-alpha/atdgen": "^ 1.10.0",
"@opam-alpha/javalib": "^ 2.3.3",
"@opam-alpha/ounit": "2.0.0",
"@opam-alpha/ocp-indent": "1.5.3",
"@opam-alpha/xmlm": "1.2.0",
"reason-ide-toolkit": "^ 1.2.0",
"reason": "1.4.0-source",
"dependency-env": "https://github.com/npm-ml/dependency-env.git",
"substs": "https://github.com/yunxing/substs.git",
"opam-installer-bin": "https://github.com/yunxing/opam-installer-bin.git",
"nopam": "https://github.com/yunxing/nopam.git"
},
"scripts": {
"shell": "eval $(dependencyEnv) && nopam && bash"
}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save