2021-06-26 00:26:09 +03:00
|
|
|
FROM debian:buster-20210511 AS solvers
|
2020-07-14 02:47:25 +03:00
|
|
|
|
|
|
|
# Install needed packages for building
|
|
|
|
RUN apt-get update \
|
2020-07-14 20:58:38 +03:00
|
|
|
&& apt-get install -y curl cmake gcc g++ git libreadline-dev unzip
|
2020-07-14 02:47:25 +03:00
|
|
|
RUN useradd -m user
|
|
|
|
RUN install -d -o user -g user /solvers
|
|
|
|
USER user
|
|
|
|
WORKDIR /solvers
|
|
|
|
RUN mkdir -p rootfs/usr/local/bin
|
|
|
|
|
2020-07-14 20:58:38 +03:00
|
|
|
# Get Z3 4.8.8 from GitHub
|
2020-08-28 01:58:43 +03:00
|
|
|
RUN curl -L https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-ubuntu-16.04.zip --output z3.zip && \
|
|
|
|
unzip z3.zip && \
|
|
|
|
mv z3-*/bin/z3 rootfs/usr/local/bin
|
2020-07-14 20:58:38 +03:00
|
|
|
|
|
|
|
# Build abc from GitHub. (Latest version.)
|
2020-08-28 01:58:43 +03:00
|
|
|
RUN git clone https://github.com/berkeley-abc/abc.git && \
|
|
|
|
( cd abc && make -j$(nproc) ) && \
|
|
|
|
cp abc/abc rootfs/usr/local/bin
|
2020-07-14 02:47:25 +03:00
|
|
|
|
|
|
|
# Build Boolector release 3.2.1 from source
|
2020-08-28 01:58:43 +03:00
|
|
|
RUN curl -L https://github.com/Boolector/boolector/archive/3.2.1.tar.gz | tar xz && \
|
|
|
|
( cd boolector* && ./contrib/setup-lingeling.sh && ./contrib/setup-btor2tools.sh && ./configure.sh && cd build && make -j$(nproc) ) && \
|
|
|
|
cp boolector*/build/bin/boolector rootfs/usr/local/bin
|
2020-07-14 02:47:25 +03:00
|
|
|
|
2020-07-14 20:58:38 +03:00
|
|
|
# Install Yices 2.6.2
|
2020-08-28 01:58:43 +03:00
|
|
|
RUN curl -L https://yices.csl.sri.com/releases/2.6.2/yices-2.6.2-x86_64-pc-linux-gnu-static-gmp.tar.gz | tar xz && \
|
|
|
|
cp yices*/bin/yices-smt2 rootfs/usr/local/bin \
|
2020-07-14 20:58:38 +03:00
|
|
|
&& cp yices*/bin/yices rootfs/usr/local/bin
|
2020-07-14 02:47:25 +03:00
|
|
|
|
2020-07-14 20:58:38 +03:00
|
|
|
# Install CVC4 1.8
|
2020-08-28 01:58:43 +03:00
|
|
|
# The latest CVC4 1.8 and the release version has a minor discrepency between it, causing sbv to fail
|
|
|
|
# https://github.com/CVC4/CVC4/releases/download/1.8/cvc4-1.8-x86_64-linux-opt
|
2021-07-08 23:10:31 +03:00
|
|
|
#RUN latest="$(curl -sSL 'http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/unstable/' | grep linux-opt | tail -n1 | sed -e 's/.*href="//' -e 's/\([^>]*\)">.*$/\1/')" && \
|
|
|
|
RUN latest="cvc4-2021-03-13-x86_64-linux-opt" && \
|
2021-01-14 22:18:06 +03:00
|
|
|
curl --output rootfs/usr/local/bin/cvc4 -sSL "https://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/unstable/$latest"
|
2020-07-14 02:47:25 +03:00
|
|
|
|
2020-07-14 20:58:38 +03:00
|
|
|
# Install MathSAT 5.6.3 - Uncomment if you are in compliance with MathSAT's license.
|
2020-07-14 02:47:25 +03:00
|
|
|
# RUN curl -L https://mathsat.fbk.eu/download.php?file=mathsat-5.6.3-linux-x86_64.tar.gz | tar xz
|
|
|
|
# RUN cp mathsat-5.6.3-linux-x86_64/bin/mathsat rootfs/usr/local/bin
|
|
|
|
|
|
|
|
# Set executable and run tests
|
|
|
|
RUN chmod +x rootfs/usr/local/bin/*
|
2020-07-14 20:58:38 +03:00
|
|
|
|
2020-08-31 21:40:09 +03:00
|
|
|
FROM haskell:8.8.4 AS build
|
2020-07-14 20:58:38 +03:00
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y libncurses-dev
|
|
|
|
COPY --from=solvers /solvers/rootfs /
|
2020-07-28 18:41:27 +03:00
|
|
|
RUN useradd -m cryptol
|
2020-07-14 20:58:38 +03:00
|
|
|
COPY --chown=cryptol:cryptol . /cryptol
|
|
|
|
USER cryptol
|
|
|
|
WORKDIR /cryptol
|
|
|
|
ENV PATH=/cryptol/rootfs/usr/local/bin:$PATH
|
|
|
|
ARG CRYPTOLPATH="/cryptol/.cryptol"
|
|
|
|
ENV LANG=C.UTF-8 \
|
|
|
|
LC_ALL=C.UTF-8
|
2020-08-31 21:40:09 +03:00
|
|
|
COPY cabal.GHC-8.8.4.config cabal.project.freeze
|
2020-07-14 20:58:38 +03:00
|
|
|
RUN mkdir -p rootfs/usr/local/bin
|
2020-08-28 01:58:43 +03:00
|
|
|
RUN cabal v2-update && \
|
|
|
|
cabal v2-build -j cryptol:exe:cryptol && \
|
|
|
|
cp $(cabal v2-exec which cryptol) rootfs/usr/local/bin && \
|
|
|
|
cabal v2-install --install-method=copy --overwrite-policy=always --installdir=bin test-lib
|
2020-07-14 20:58:38 +03:00
|
|
|
RUN ./bin/test-runner --ext=.icry --exe=./rootfs/usr/local/bin/cryptol -F -b tests
|
|
|
|
ENV PATH=/usr/local/bin:/cryptol/rootfs/usr/local/bin:$PATH
|
2020-09-30 23:45:09 +03:00
|
|
|
RUN ! $(cryptol -c ":s prover=yices" | tail -n +2 | grep -q .) \
|
2020-08-28 01:58:43 +03:00
|
|
|
# && ! $(cryptol -c ":s prover=mathsat" | tail -n +2 | grep -q .) \
|
2020-07-14 02:47:25 +03:00
|
|
|
&& ! $(cryptol -c ":s prover=cvc4" | tail -n +2 | grep -q .) \
|
2020-09-30 23:45:09 +03:00
|
|
|
# && ! $(cryptol -c ":s prover=abc" | tail -n +2 | grep -q .) \
|
2020-07-14 02:47:25 +03:00
|
|
|
&& ! $(cryptol -c ":s prover=boolector" | tail -n +2 | grep -q .) \
|
|
|
|
&& ! $(cryptol -c ":s prover=z3" | tail -n +2 | grep -q .)
|
2020-07-14 20:58:38 +03:00
|
|
|
RUN mkdir -p rootfs/"${CRYPTOLPATH}" \
|
|
|
|
&& cp -r lib/* rootfs/"${CRYPTOLPATH}"
|
|
|
|
USER root
|
|
|
|
RUN chown -R root:root /cryptol/rootfs
|
2020-07-14 02:47:25 +03:00
|
|
|
|
2021-06-26 00:26:09 +03:00
|
|
|
FROM debian:buster-20210511-slim
|
2019-04-17 01:16:24 +03:00
|
|
|
RUN apt-get update \
|
2020-07-14 20:58:38 +03:00
|
|
|
&& apt-get install -y libgmp10 libgomp1 libffi6 libncurses6 libtinfo6 libreadline7 \
|
2020-05-14 20:50:22 +03:00
|
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
2020-07-14 20:58:38 +03:00
|
|
|
RUN useradd -m cryptol && chown -R cryptol:cryptol /home/cryptol
|
2018-06-26 21:10:28 +03:00
|
|
|
COPY --from=build /cryptol/rootfs /
|
2020-07-14 02:47:25 +03:00
|
|
|
COPY --from=solvers /solvers/rootfs /
|
2018-06-26 21:10:28 +03:00
|
|
|
USER cryptol
|
2020-07-14 20:58:38 +03:00
|
|
|
ENV LANG=C.UTF-8 \
|
|
|
|
LC_ALL=C.UTF-8
|
2018-06-26 21:10:28 +03:00
|
|
|
ENTRYPOINT ["/usr/local/bin/cryptol"]
|