You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

266 lines
7.1 KiB

#!/usr/bin/env bash
# Convenience script to build Infer when using opam
# Copyright (c) 2015-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
set -e
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
set -o pipefail
set -u
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INFER_ROOT="$SCRIPT_DIR"
INFER_DEPS_DIR="$INFER_ROOT/dependencies/infer-deps"
PLATFORM="$(uname)"
NCPU="$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)"
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
OCAML_VERSION_DEFAULT="4.06.1+flambda"
INFER_OPAM_SWITCH_DEFAULT=infer-"$OCAML_VERSION_DEFAULT"
function usage() {
echo "Usage: $0 [-y] [targets]"
echo
echo " targets:"
echo " all build everything (default)"
echo " clang build C and Objective-C analyzer"
echo " java build Java analyzer"
echo
echo " options:"
echo " -h,--help show this message"
echo " --no-opam-lock do not use the opam.lock file and let opam resolve dependencies"
echo " --only-setup-opam initialize opam, install the opam dependencies of infer, and exit"
echo " --opam-switch specify the opam switch where to install infer (default: $INFER_OPAM_SWITCH_DEFAULT)"
echo " -y,--yes automatically agree to everything"
echo
echo " examples:"
echo " $0 # build Java and C/Objective-C analyzers"
echo " $0 java clang # equivalent way of doing the above"
echo " $0 java # build only the Java analyzer"
}
# arguments
BUILD_CLANG=${BUILD_CLANG:-no}
BUILD_JAVA=${BUILD_JAVA:-no}
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
INFER_CONFIGURE_OPTS=${INFER_CONFIGURE_OPTS:-""}
INFER_OPAM_SWITCH=${INFER_OPAM_SWITCH:-$INFER_OPAM_SWITCH_DEFAULT}
INTERACTIVE=${INTERACTIVE:-yes}
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
JOBS=${JOBS:-$NCPU}
OCAML_VERSION=${OCAML_VERSION:-$OCAML_VERSION_DEFAULT}
ONLY_SETUP_OPAM=${ONLY_SETUP_OPAM:-no}
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
OPAM_LOCK_URL=${OPAM_LOCK_URL:-https://github.com/rgrinberg/opam-lock}
USE_OPAM_LOCK=${USE_OPAM_LOCK:-yes}
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
ORIG_ARGS="$*"
while [[ $# > 0 ]]; do
opt_key="$1"
case $opt_key in
all)
BUILD_CLANG=yes
BUILD_JAVA=yes
shift
continue
;;
clang)
BUILD_CLANG=yes
shift
continue
;;
java)
BUILD_JAVA=yes
shift
continue
;;
-h|--help)
usage
exit 0
;;
--no-opam-lock)
USE_OPAM_LOCK=no
shift
continue
;;
--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
continue
;;
*)
usage
exit 1
esac
shift
done
# if no arguments then build both clang and Java
if [ "$BUILD_CLANG" = "no" ] && [ "$BUILD_JAVA" = "no" ]; then
BUILD_CLANG=yes
BUILD_JAVA=yes
fi
# enable --yes option for some commands in non-interactive mode
YES=
if [ "$INTERACTIVE" = "no" ]; then
YES=--yes
fi
# --yes by default for opam commands
export OPAMYES=1
check_installed () {
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
local cmd="$1"
if ! which "$cmd" >/dev/null 2>&1; then
echo "dependency not found: '$cmd'" >&2
exit 1
fi
}
opam_retry () {
"$@" || ( \
echo >&2; \
printf '*** `%s` failed\n' "$*" >&2; \
echo '*** Updating opam then retrying' >&2; \
opam update && \
"$@" || ( \
echo >&2; \
printf '*** ERROR: `%s` failed\n' "$*" >&2; \
exit 1 \
) \
) \
}
setup_opam () {
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
opam_retry opam init --compiler="$OCAML_VERSION" -j "$JOBS" --no-setup
if [ "$INFER_OPAM_SWITCH" = "$INFER_OPAM_SWITCH_DEFAULT" ]; then
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
opam_retry opam switch set -j "$JOBS" "$INFER_OPAM_SWITCH" --alias-of "$OCAML_VERSION"
else
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
opam_retry opam switch set -j "$JOBS" "$INFER_OPAM_SWITCH"
fi
}
# Install and record the infer dependencies in opam. The main trick is to install the
# $INFER_DEPS_DIR directory instead of the much larger infer repository. That directory contains
# just enough to pretend it installs infer.
install_infer-deps () {
# remove previous infer-deps pin, which might have conflicting dependencies
opam pin remove infer-deps --no-action
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
INFER_TMP_DEPS_DIR="$(mktemp -d "$INFER_ROOT"/dependencies/infer-deps-XXXX)"
INFER_TMP_PACKAGE_NAME="$(basename "$INFER_TMP_DEPS_DIR")"
cp -a "$INFER_DEPS_DIR"/* "$INFER_TMP_DEPS_DIR"
# give unique name to the package to force opam to recheck the dependencies are all installed
opam pin add --no-action "$INFER_TMP_PACKAGE_NAME" "$INFER_TMP_DEPS_DIR"
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
opam install -j "$JOBS" --deps-only "$INFER_TMP_PACKAGE_NAME"
opam pin remove "$INFER_TMP_PACKAGE_NAME"
rm -fr "$INFER_TMP_DEPS_DIR"
# pin infer so that opam doesn't violate its package constraints when the user does
# "opam upgrade"
opam pin add infer-deps "$INFER_DEPS_DIR"
}
install_locked_deps() {
if ! opam lock 2> /dev/null; then
echo "opam-lock not found in the current switch, installing from '$OPAM_LOCK_URL'..." >&2
opam pin add -k git lock "$OPAM_LOCK_URL"
fi
opam lock --install < "$INFER_ROOT"/opam.lock
}
install_opam_deps() {
if [ "$USE_OPAM_LOCK" = yes ]; then
install_locked_deps
else
install_infer-deps
fi
}
echo "initializing opam... " >&2
check_installed opam
setup_opam
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
eval $(SHELL=bash opam config env --switch="$INFER_OPAM_SWITCH")
echo >&2
echo "installing infer dependencies; this can take up to 30 minutes... " >&2
opam_retry install_opam_deps
if [ "$ONLY_SETUP_OPAM" = "yes" ]; then
exit 0
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
fi
if [ "$BUILD_CLANG" = "no" ]; then
INFER_CONFIGURE_OPTS+=" --disable-c-analyzers"
fi
if [ "$BUILD_JAVA" = "no" ]; then
INFER_CONFIGURE_OPTS+=" --disable-java-analyzers"
fi
./configure $INFER_CONFIGURE_OPTS
if [ "$BUILD_CLANG" = "yes" ] && ! facebook-clang-plugins/clang/setup.sh --only-check-install; then
echo ""
echo " Warning: you are not using a release of Infer. The C and"
echo " Objective-C analyses require a custom clang to be compiled"
echo " now. This step takes ~30-60 minutes, possibly more."
echo ""
echo " To speed this along, you are encouraged to use a release of"
echo " Infer instead:"
echo ""
echo " http://fbinfer.com/docs/getting-started.html"
echo ""
echo " If you are only interested in analyzing Java programs, simply"
echo " run this script with only the \"java\" argument:"
echo ""
echo " $0 java"
echo ""
confirm="n"
printf "Are you sure you want to compile clang? (y/N) "
if [ "$INTERACTIVE" = "no" ]; then
confirm="y"
echo "$confirm"
else
read confirm
fi
if [ "x$confirm" != "xy" ]; then
exit 0
fi
fi
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
make -j "$JOBS" || (
echo >&2
echo ' compilation failure; you can try running' >&2
echo >&2
echo ' make clean' >&2
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
echo " '$0' $ORIG_ARGS" >&2
echo >&2
exit 1)
echo
[build] add conf-sqlite3 and fix minor script issue Summary: Users missing the development package for libsqlite3 would see only a failure to install "sqlite3". Adding conf-sqlite3 to the dependencies does not improve things that much but there is a bit more information in the console: ``` [ERROR] The compilation of conf-sqlite3 failed at "pkg-config sqlite3". [ERROR] The compilation of sqlite3 failed at "jbuilder build -p sqlite3 -j 4". #=== ERROR while installing conf-sqlite3.1 ====================================# # opam-version 1.2.2 # os linux # command pkg-config sqlite3 # path /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/conf-sqlite3.1/conf-sqlite3-7504-7afd23.err #=== ERROR while installing sqlite3.4.3.2 =====================================# # opam-version 1.2.2 # os linux # command jbuilder build -p sqlite3 -j 4 # path /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2 # compiler 4.06.1+flambda # exit-code 1 # env-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.env # stdout-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.out # stderr-file /home/jul/.opam/infer-4.06.1+flambda/build/sqlite3.4.3.2/sqlite3-7504-d2c37b.err ### stderr ### # -> stdout: # [...] # | ast_impl_magic_number: Caml1999M022 # | ast_intf_magic_number: Caml1999N022 # | cmxs_magic_number: Caml1999D022 # | cmt_magic_number: Caml1999T022 # -> stderr: # Fatal error: exception End_of_file # Raised at file "src/import0.ml" (inlined), line 351, characters 22-32 # Called from file "src/configurator.ml", line 511, characters 13-22 # Called from file "src/config/discover.ml", line 42, characters 2-1023 Exception: Reqs_error (Process_error ("opam install -y ANSITerminal.0.8 atd.1.12.0 atdgen.1.12.0 base.v0.11.0 base64.2.2.0 bin_prot.v0.11.0 biniou.1.2.0 camlp4.4.06+1 camlzip.1.07 cmdliner.1.0.2 conf-aclocal.1.0.0 conf-autoconf.0.1 conf-m4.1 conf-pkg-config.1.0 conf-sqlite3.1 conf-which.1 conf-zlib.1 configurator.v0.11.0 core.v0.11.0 "... (* string length 1469; truncated *), Unix.WEXITED 4)). ``` Also fix some issues with `build-infer.sh`: - fix a problem where `SCRIPT_PATH` should be `SCRIPT_DIR` - add `set -u` and `set -o pipefail` to make sure we don't miss errors in the future - add quotes everywhere - make number of `JOBS` user-configurable instead of hardcoding `$NCPU` Reviewed By: mbouaziz Differential Revision: D8201849 fbshipit-source-id: 19b7c77
7 years ago
echo "*** Success! Infer is now built in '$SCRIPT_DIR/infer/bin/'."
echo '*** Install infer on your system with `make install`.'
echo
echo '*** If you plan to hack on infer, check out CONTRIBUTING.md to setup your dev environment.'