[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
master
Jules Villard 6 years ago committed by Facebook Github Bot
parent c5890238f0
commit 6af46027bf

@ -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

@ -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

@ -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

@ -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: [

Loading…
Cancel
Save