Closed kylewayman closed 6 years ago
I can confirm that this happens. Fortunately, I still do have a docker container that I build two weeks ago (and that one still works for me). The unfortunate thing about this Docker container build is that it downloads the latest versions of some ocaml packages, which can happen to be incompatible with the rest of the Docker setup (at any point in time).
In my case, it occurs on a Ubuntu host OS and it is not related to the host system. If you want to pinpoint the exact problem, I believe you must check what has changed in the last few days in opam and ppx_driver, which might point to the problem that occurs here.
The error is saying that ocaml must be less than 4.05.0, but beb98c6baa3764dd9073028b8596de1a392369b5 updated ocaml to 4.05.0.
I am experiencing the exact same issue on Ubuntu 17.10 so I downloaded the 0.12.1 release instead and this time I got the issue described in https://github.com/facebook/infer/issues/776.
PR #833 failed checks with this error. So, I was wondering how come it works on my machine. It turns out that ppx_driver.v0.9.1 on my laptop does not require ocaml-version < "4.05.0"
but ocaml-version < "4.06.0"
. (I suspect I didn't do opam update
lately?)
In any case, changing that dependency by hand will eventually allow you to compile https://github.com/facebook/infer/commit/7032bca1d55a736c46b897b0ac5eeaa35e6fb8cf. But, it involves manually removing opam's cache and also possibly running some opam depext
commands. And, in any case, it's probably not what you want to be doing. (This was tested on a fresh Ubuntu 16.04.)
Any update on this? I'm experiencing this issue on with both the dockerfile and on ubuntu 16.04
Using version 4.06.0 gives the error:
[ERROR] stdio.v0.9.0 is not available because your system doesn't comply with ocaml-version >= "4.03.0" & ocaml-version < "4.06.0". [ERROR] sexplib.v0.9.2 is not available because your system doesn't comply with ocaml-version >= "4.03.0" & ocaml-version < "4.06.0". [ERROR] ppx_tools.5.0+4.05.0 is not available because your system doesn't comply with ocaml-version >= "4.05" & ocaml-version < "4.06.0". [ERROR] ppx_driver.v0.9.1 is not available because your system doesn't comply with ocaml-version >= "4.03.0" & ocaml-version < "4.05.0". [ERROR] ppx_deriving.4.2 is not available because your system doesn't comply with ocaml-version > "4.03.0" & opam-version >= "1.2" & ocaml-version < "4.06.0". [ERROR] ppx_core.v0.9.0 is not available because your system doesn't comply with ocaml-version >= "4.03.0" & ocaml-version < "4.06.0". [ERROR] ppx_ast.v0.9.1 is not available because your system doesn't comply with ocaml-version >= "4.03.0" & ocaml-version < "4.06.0". [ERROR] ocaml-migrate-parsetree.1.0.6 is not available because your system doesn't comply with ocaml-version >= "4.02.0" & ocaml-version < "4.06.0". [ERROR] num.0 is not available because your system doesn't comply with ocaml-version < "4.06.0". [ERROR] core_kernel.v0.9.0 is not available because your system doesn't comply with ocaml-version >= "4.03.0" & ocaml-version < "4.06.0". [ERROR] core.v0.9.1 is not available because your system doesn't comply with ocaml-version >= "4.03.0" & ocaml-version < "4.06.0". [ERROR] camlp4.4.05+1 is not available because your system doesn't comply with !preinstalled & ocaml-version >= "4.05" & ocaml-version < "4.06". [ERROR] bin_prot.v0.9.1 is not available because your system doesn't comply with ocaml-version >= "4.03.0" & ocaml-version < "4.06.0". [ERROR] base.v0.9.3 is not available because your system doesn't comply with ocaml-version >= "4.03.0" & ocaml-version < "4.06.0".
Using version 4.05.0 gives the error:
[ERROR] ppx_driver.v0.9.1 is not available because your system doesn't comply with ocaml-version >= "4.03.0" & ocaml-version < "4.05.0".
Using version 4.04.2 gives the error:
[ERROR] ppx_tools.5.0+4.05.0 is not available because your system doesn't comply with ocaml-version >= "4.05" & ocaml-version < "4.06.0". [ERROR] camlp4.4.05+1 is not available because your system doesn't comply with !preinstalled & ocaml-version >= "4.05" & ocaml-version < "4.06".
Using version 4.03.0 gives the error:
[ERROR] sqlite3.4.2.0 is not available because your system doesn't comply with ocaml-version >= "4.04". [ERROR] ppx_tools.5.0+4.05.0 is not available because your system doesn't comply with ocaml-version >= "4.05" & ocaml-version < "4.06.0". [ERROR] ppx_deriving.4.2 is not available because your system doesn't comply with ocaml-version > "4.03.0" & opam-version >= "1.2" & ocaml-version < "4.06.0". [ERROR] camlp4.4.05+1 is not available because your system doesn't comply with !preinstalled & ocaml-version >= "4.05" & ocaml-version < "4.06".
Bunch of overlapping errors, as can be seen.
This is all achieved by alerting the version in the build-infer.sh file.
I solved the issue by upgrading to the current master and created the following Dockerfile:
FROM ubuntu:17.04
RUN apt-get update && \
apt-get install -y \
aspcud \
curl \
opam \
pkg-config \
autoconf \
libsqlite3-dev \
zlib1g-dev \
cmake \
libc6-dev \
libc6-i386 \
lib32z1 \
lib32stdc++6 \
openjdk-8-jdk-headless && \
apt-get install -y git
RUN mkdir /tmp-infer && cd /tmp-infer && \
git clone -n https://github.com/facebook/infer.git && \
cd infer && git checkout ${INFER_GIT_SHA1} && \
./build-infer.sh --yes --opam-switch 4.05.0+flambda && \
make install && \
rm -rf /root/.opam && rm -rf /tmp-infer
Note that you have to replace the ${INFER_GIT_SHA1} with a recent git commit identifier.
Note that FROM ubuntu:17.04
is now a new source of breakage, because Ubuntu EOLed 17.04 on Jan 13, so the call to apt-get update
fails.
I got it to work with @bulwahn 's code, but using ubuntu 17.10 instead of 17.04
@KoenDG when I try what you suggested, I get this:
make[3]: Entering directory '/tmp/clang-setup.uYtPFT/build'
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_aux_runtime.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_default_handlers.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_demangle.cpp.o
/tmp/clang-setup.uYtPFT/llvm/projects/libcxxabi/src/cxa_demangle.cpp: In function 'const char* __cxxabiv1::{anonymous}::parse_type(const char*, const char*, C&) [with C = __cxxabiv1::{anonymous}::Db]':
/tmp/clang-setup.uYtPFT/llvm/projects/libcxxabi/src/cxa_demangle.cpp:2216:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (first+1 != last)
^~
/tmp/clang-setup.uYtPFT/llvm/projects/libcxxabi/src/cxa_demangle.cpp:2261:21: note: here
default:
^~~~~~~
[ 9%] Linking CXX executable ../../bin/yaml-bench
make[3]: Leaving directory '/tmp/clang-setup.uYtPFT/build'
[ 9%] Built target yaml-bench
make[3]: Entering directory '/tmp/clang-setup.uYtPFT/build'
Scanning dependencies of target cxx_objects
make[3]: Leaving directory '/tmp/clang-setup.uYtPFT/build'
make[3]: Entering directory '/tmp/clang-setup.uYtPFT/build'
[ 9%] Building CXX object projects/libcxx/lib/CMakeFiles/cxx_objects.dir/__/src/algorithm.cpp.o
In file included from /tmp/clang-setup.uYtPFT/llvm/projects/libcxx/include/ios:216:0,
from /tmp/clang-setup.uYtPFT/llvm/projects/libcxx/include/ostream:138,
from /tmp/clang-setup.uYtPFT/llvm/projects/libcxx/include/istream:163,
from /tmp/clang-setup.uYtPFT/llvm/projects/libcxx/include/random:1646,
from /tmp/clang-setup.uYtPFT/llvm/projects/libcxx/src/algorithm.cpp:11:
/tmp/clang-setup.uYtPFT/llvm/projects/libcxx/include/__locale:39:11: fatal error: xlocale.h: No such file or directory
# include <xlocale.h>
^~~~~~~~~~~
compilation terminated.
projects/libcxx/lib/CMakeFiles/cxx_objects.dir/build.make:62: recipe for target 'projects/libcxx/lib/CMakeFiles/cxx_objects.dir/__/src/algorithm.cpp.o' failed
make[3]: Leaving directory '/tmp/clang-setup.uYtPFT/build'
make[3]: *** [projects/libcxx/lib/CMakeFiles/cxx_objects.dir/__/src/algorithm.cpp.o] Error 1
CMakeFiles/Makefile2:16743: recipe for target 'projects/libcxx/lib/CMakeFiles/cxx_objects.dir/all' failed
make[2]: *** [projects/libcxx/lib/CMakeFiles/cxx_objects.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_exception_storage.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_guard.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_handlers.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_new_delete.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_unexpected.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_vector.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_virtual.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/stdlib_exception.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/stdlib_stdexcept.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/stdlib_typeinfo.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/abort_message.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/fallback_malloc.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/private_typeinfo.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_exception.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_personality.cpp.o
[ 9%] Building CXX object projects/libcxxabi/src/CMakeFiles/cxxabi_objects.dir/cxa_thread_atexit.cpp.o
make[3]: Leaving directory '/tmp/clang-setup.uYtPFT/build'
[ 9%] Built target cxxabi_objects
make[2]: Leaving directory '/tmp/clang-setup.uYtPFT/build'
Makefile:151: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/tmp/clang-setup.uYtPFT/build'
Makefile:230: recipe for target 'clang_setup' failed
make: *** [clang_setup] Error 2
compilation failure; you can try running
make clean
./build-infer.sh --yes --opam-switch 4.05.0+flambda
The command '/bin/sh -c mkdir /tmp-infer && cd /tmp-infer && git clone -n https://github.com/facebook/infer.git && cd infer && git checkout ${INFER_GIT_SHA1} && ./build-infer.sh --yes --opam-switch 4.05.0+flambda && make install && rm -rf /root/.opam && rm -rf /tmp-infer' returned a non-zero code: 1
@kylewayman You can get a bit further if you add a RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
and that should be innocuous, but I hit something else next and decided brute forcing through the errors could wait.
@kylewayman The command output makes it look like you didn't replaced the ${INFER_GIT_SHA1}, it seems
You need to replace that with an actual git commit SHA1, which can be found here: https://github.com/facebook/infer/commits/master
The latest, at time of writing, being 2c6fb16636f75abd87b3a584428447767181aa07
As can be seen here: https://github.com/facebook/infer/commit/2c6fb16636f75abd87b3a584428447767181aa07
@KoenDG I get the exact same error as @kylewayman when using 2c6fb16636f75abd87b3a584428447767181aa07
Are you sure you didn't change something else?
@Zialus now that you mention it, I only built java, adding the --java
flag to ./build-infer.sh
--java
or --java-only
I'm not sure anymore.
@kylewayman @Zialus I also tried to use 17.10 instead of 17.04 and ran into the same problem as you when trying to compile clang. I am just retrying with debian:buster; if that does not help one would have to look into getting the right clang version that can actually compile with a recent ubuntu version and works with facebook's clang plugins.
Also got it working with the last commit on the 0.13 tag: https://github.com/facebook/infer/commits/v0.13.0
Again, only for Java
EDIT: This commit: dbdfb24be484384fa075b48b35723fc3b933eda1
I revisited my Dockerfile and could build the docker image (with some strange intermediate errors that don't impact the overall build though). For that, I changed from ubuntu 17.04 back to the ubuntu LTS 16.04. So here is the Dockerfile:
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y \
aspcud \
curl \
opam \
pkg-config \
autoconf \
libsqlite3-dev \
zlib1g-dev \
cmake \
libc6-dev \
libc6-i386 \
lib32z1 \
lib32stdc++6 \
openjdk-8-jdk-headless && \
apt-get install -y git
RUN mkdir /tmp-infer && cd /tmp-infer && \
git clone -n https://github.com/facebook/infer.git && \
cd infer && git checkout ${INFER_GIT_SHA1} && \
./build-infer.sh --yes --opam-switch 4.05.0+flambda && \
make install && \
rm -rf /root/.opam && rm -rf /tmp-infer
Notice, that this Dockerfile is a template; I replaced INFER_GIT_SHA1 with 80b3d08 (the current commit on master) and I could build infer with clang support.
@bulwahn Thanks for that. I pushed it a little further, avoiding cloning the entire infer history just to get the one revision, and other minor changes (I find this style of formatting multi-line statements less error-prone.)
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND="noninteractive"
ENV OCAML_VERSION="4.05.0+flambda"
ENV INFER_SHA="8a9fcdc4"
RUN apt-get update && \
apt-get install -y \
aspcud \
autoconf \
cmake \
curl \
git \
lib32stdc++6 \
lib32z1 \
libc6-dev \
libc6-i386 \
libsqlite3-dev \
opam \
openjdk-8-jdk-headless \
pkg-config \
wget \
zlib1g-dev
RUN mkdir /tmp-infer \
&& cd /tmp-infer \
&& wget -q "https://github.com/facebook/infer/archive/$INFER_SHA.zip" \
&& unzip -q *.zip \
&& rm -f *.zip \
&& cd infer* \
&& git clone --depth=1 "https://github.com/facebook/facebook-clang-plugins" \
&& ./build-infer.sh --yes --opam-switch $OCAML_VERSION \
&& make install \
&& rm -rf /root/.opam /tmp-infer
My docker container ran out of memory when this was 95% of the way to building the clang support, but I take that as provisional evidence this works as given.
@paulp your version gets me to about 50% and then fails here:
[ 49%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/ConstantInitBuilder.cpp.o
[ 50%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/CoverageMappingGen.cpp.o
[ 50%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/ItaniumCXXABI.cpp.o
[ 50%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/MacroPPCallbacks.cpp.o
[ 50%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/MicrosoftCXXABI.cpp.o
[ 50%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/ModuleBuilder.cpp.o
[ 50%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/ObjectFilePCHContainerOperations.cpp.o
[ 50%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/SanitizerMetadata.cpp.o
[ 50%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/SwiftCallingConv.cpp.o
[ 50%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/TargetInfo.cpp.o
[ 50%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/VarBypassDetector.cpp.o
[ 50%] Linking CXX static library ../../../../lib/libclangCodeGen.a
/usr/bin/ar: ../../../../lib/libclangCodeGen.a: No space left on device
make[3]: *** [lib/libclangCodeGen.a] Error 1
make[3]: *** Deleting file 'lib/libclangCodeGen.a'
tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/build.make:1472: recipe for target 'lib/libclangCodeGen.a' failed
make[3]: Leaving directory '/tmp/clang-setup.sKopBP/build'
make[2]: *** [tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/all] Error 2
CMakeFiles/Makefile2:28683: recipe for target 'tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/all' failed
make[2]: Leaving directory '/tmp/clang-setup.sKopBP/build'
make[1]: *** [all] Error 2
Makefile:149: recipe for target 'all' failed
make[1]: Leaving directory '/tmp/clang-setup.sKopBP/build'
make: *** [clang_setup] Error 2
Makefile:237: recipe for target 'clang_setup' failed
compilation failure; you can try running
make clean
./build-infer.sh --yes --opam-switch 4.05.0+flambda
The command '/bin/sh -c mkdir /tmp-infer && cd /tmp-infer && wget -q "https://github.com/facebook/infer/archive/$INFER_SHA.zip" && unzip -q *.zip && rm -f *.zip && cd infer* && git clone --depth=1 "https://github.com/facebook/facebook-clang-plugins" && ./build-infer.sh --yes --opam-switch $OCAML_VERSION && make install && rm -rf /root/.opam /tmp-infer' returned a non-zero code: 1
Not sure why it says no space left on disk. The host OS has plenty of space left.
@kylewayman The VM image used by docker has hit its size limit, see here. You might want to try this:
docker run --rm --net=host --pid=host --privileged -it justincormack/nsenter1 /sbin/fstrim /var/lib
And look at the before/after size of
~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
In very recent versions of osx docker you can resize that file in the gui preferences, but those versions introduced other problems and I had to roll back.
Other options are offered in that link and elsewhere.
We just pushed a new version 0.13.1 to fix the 0.13.0 release and updated the Dockerfile. This should fix this issue. Sorry about the breakage, I hope it works now.
If I run the commands for "Install Infer on Linux":
It fails at:
I've tried this on an iOS laptop and a CentOS server and I get identical results. This is running in the
ubuntu:17.04
container, so host OS shouldn't matter, right? Is there anything else I should try?