From 6af46027bfd2edd50128e4174b68ba3234c729a3 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 6 Feb 2019 03:44:34 -0800 Subject: [PATCH] [travis] use ocaml-ci-scripts to build infer Summary: With this change Travis will build infer on Linux + OSX using the opam file, in Java mode only to save us from having to compile clang. This doesn't try to run the tests yet because 1) building infer takes almost all the alloted time so OSX times out if we ask it to do more; 2) there's some error in Travis when the tests are run so more work is needed. I had to change the opam file a bit to reflect some dependency constraints since the opam build ignores the opam.locked file (which is good because it will allow us to detect when such incompatibilities arise). Reviewed By: katiejots Differential Revision: D13971408 fbshipit-source-id: d51caa66f --- .travis.yml | 24 +++++++----------------- .travis/docker_tests.sh | 29 ----------------------------- .travis/local_install_tests.sh | 15 --------------- opam | 7 +++++-- 4 files changed, 12 insertions(+), 63 deletions(-) delete mode 100755 .travis/docker_tests.sh delete mode 100755 .travis/local_install_tests.sh diff --git a/.travis.yml b/.travis.yml index 8115504f1..a5e524897 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,9 @@ -sudo: required language: c +sudo: required +install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh +script: bash -ex .travis-opam.sh +env: + - OCAML_VERSION=4.07 TESTS=false os: - - linux - - osx -services: docker -before_install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y aspcud; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew unlink python; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install opam; fi -install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then opam init --reinit --no-setup --disable-sandboxing; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then travis_wait 60 opam install --yes .; fi -script: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./.travis/local_install_tests.sh; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./.travis/docker_tests.sh; fi - - git diff --exit-code +- linux +- osx diff --git a/.travis/docker_tests.sh b/.travis/docker_tests.sh deleted file mode 100755 index 70cafc7a7..000000000 --- a/.travis/docker_tests.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2016-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 - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -set -x - -# assumes we are in .travis/ -cd "${SCRIPT_DIR}/../docker" - -docker build -t infer . - -echo 'Running `infer -- javac /infer/examples/Hello.java`' -docker run -t infer \ - /bin/bash -c \ - 'infer -- javac /infer/examples/Hello.java | grep -q "NULL_DEREFERENCE: *1"' -echo - -echo 'Running `infer -- clang -c /infer/examples/hello.c`' -docker run -t infer \ - /bin/bash -c \ - 'infer -- clang -c /infer/examples/hello.c | grep -q "NULL_DEREFERENCE: *1"' -echo diff --git a/.travis/local_install_tests.sh b/.travis/local_install_tests.sh deleted file mode 100755 index c5023dd31..000000000 --- a/.travis/local_install_tests.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2016-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. - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# go to the root of the repo -- assumes we are in .travis/ -cd "${SCRIPT_DIR}/.." - -echo 'Running `infer -- javac examples/Hello.java`' -infer -- javac examples/Hello.java | grep -q 'NULL_DEREFERENCE: *1' -echo diff --git a/opam b/opam index 75ff932e7..b04eb28e3 100644 --- a/opam +++ b/opam @@ -13,7 +13,8 @@ build: [ ["./configure" "--disable-c-analyzers" "--prefix=%{prefix}%"] - [make "-j%{jobs}%"] + [make "-j" jobs] + [make "-j" jobs "config_tests"] {with-test} ] install: [ [make "install"] @@ -22,7 +23,7 @@ depends: [ "ANSITerminal" {>="0.7"} "apron" "atdgen" {>="2.0.0"} - "base64" + "base64" {<"3.0.0"} "cmdliner" {>="1.0.0"} "core" "conf-autoconf" {build} @@ -43,7 +44,9 @@ depends: [ "ppx_deriving" {>="4.1"} "sawja" {>="1.5.4"} "sqlite3" + "utop" {with-test} "xmlm" {>="1.2.0"} + "yojson" {<"1.6.0"} "zarith" {>="1.7"} ] depexts: [