From 8e8b710556fd9d378dd8a7d55684ac607ddbb46e Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Mon, 7 Mar 2016 05:32:53 -0800 Subject: [PATCH] add newly missing dependencies Summary:public - install the "pkg-config" and "ncurses-dev" apt packages - install the android-22 target as the base image stopped shipping with it - use more robust ways of installing opam depencies - switch build command to `./build-infer.sh` - switch android example to use gradlew instead of gradle because it complains about gradle-2.11 not being gradle-2.2 closes #291 Reviewed By: cristianoc Differential Revision: D3000540 fb-gh-sync-id: f8bd44b shipit-source-id: f8bd44b --- docker/Dockerfile | 29 ++++++++++++++++++----------- docker/README.md | 6 +++--- docker/run.sh | 2 +- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 92de01a27..a55f373ea 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,39 +3,40 @@ FROM heikomaass/android-sdk MAINTAINER Infer -# Add build-tools-22 to the Android SDK -RUN ["/opt/sdk-tools/android-accept-licenses.sh", "android update sdk --filter \"build-tools-22.0.1\" --no-ui --force -a"] +# Add android-22 and build-tools-22 to the Android SDK +RUN ["/opt/sdk-tools/android-accept-licenses.sh", \ + "android update sdk --filter \"android-22\" --no-ui --force --all"] +RUN ["/opt/sdk-tools/android-accept-licenses.sh", \ + "android update sdk --filter \"build-tools-22.0.1\" --no-ui --force --all"] # Debian config +RUN add-apt-repository ppa:cwchien/gradle # to get a recent gradle RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ curl \ git \ + gradle \ groff \ libgmp-dev \ libmpc-dev \ libmpfr-dev \ m4 \ + ncurses-dev \ ocaml \ + pkg-config \ python-software-properties \ rsync \ software-properties-common \ unzip \ zlib1g-dev -# Install a recent Gradle -RUN add-apt-repository ppa:cwchien/gradle -RUN apt-get update && \ - apt-get install gradle-2.5 - # Install OPAM RUN curl -sL \ https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-Linux \ -o /usr/local/bin/opam && \ chmod 755 /usr/local/bin/opam -RUN opam init -y --comp=4.02.3 && \ - opam install -y extlib.1.5.4 atdgen.1.6.0 javalib.2.3.1 sawja.1.5.1 +RUN opam init -y --comp=4.02.3 # Download the latest Infer release RUN INFER_VERSION=$(curl -s https://api.github.com/repos/facebook/infer/releases \ @@ -49,11 +50,17 @@ RUN INFER_VERSION=$(curl -s https://api.github.com/repos/facebook/infer/releases rm -f /infer && \ ln -s ${PWD}/infer-linux64-$INFER_VERSION /infer +# Install opam dependencies +RUN cd /infer && \ + eval $(opam config env) && \ + opam update && \ + opam pin add --yes --no-action infer . && \ + opam install --deps-only infer + # Compile Infer RUN cd /infer && \ eval $(opam config env) && \ - ./configure && \ - make -C infer clang java + ./build-infer.sh # Install Infer ENV INFER_HOME /infer/infer diff --git a/docker/README.md b/docker/README.md index 94f2a7a76..40d44d49a 100644 --- a/docker/README.md +++ b/docker/README.md @@ -28,7 +28,7 @@ Infer. # Build Infer; 20min or so; to be executed from docker/ in the Infer repo ./run.sh # you should now be inside the docker container with a shell prompt, e.g. -# "root@5c3b9af90d59:/# " -cd infer/examples/android_hello/ -infer -- gradle build +# "root@5c3b9af90d59:/infer/examples# " +cd android_hello/ +infer -- ./gradlew build ``` diff --git a/docker/run.sh b/docker/run.sh index 9e8277d22..36aeb91c7 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -48,4 +48,4 @@ fi NAME="infer" docker build -t $NAME . && \ -docker run -it $NAME /bin/bash +docker run -it $NAME /bin/bash -c 'cd /infer/examples/; exec /bin/bash'