2020-05-12 12:52:21 +00:00
|
|
|
# vim:syntax=dockerfile
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Dockerfile for building and testing Solidity Compiler on CI
|
|
|
|
# Target: Emscripten
|
|
|
|
# URL: https://hub.docker.com/r/ethereum/solidity-buildpack-deps
|
|
|
|
#
|
|
|
|
# This file is part of solidity.
|
|
|
|
#
|
|
|
|
# solidity is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# solidity is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with solidity. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
#
|
|
|
|
# (c) 2016-2019 solidity contributors.
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# The Emscripten SDK at https://github.com/emscripten-core/emsdk/
|
|
|
|
# contains a Makefile in the docker/ subdirectory that can be used to create the
|
|
|
|
# required base image using:
|
|
|
|
#
|
2021-11-04 14:09:48 +00:00
|
|
|
# make version=2.0.33 build
|
2020-05-12 12:52:21 +00:00
|
|
|
#
|
2021-11-04 14:09:48 +00:00
|
|
|
# Note that emscripten is supposed to automatically install to $(em-config CACHE)/sysroot, but
|
|
|
|
# apparently this currently breaks due to conflicting compatibility headers.
|
|
|
|
# Using $(em-config CACHE)/sysroot/usr seems to work, though, and still has cmake find the
|
|
|
|
# dependencies automatically.
|
2022-08-13 02:41:04 +00:00
|
|
|
FROM emscripten/emsdk:3.1.19 AS base
|
2023-05-15 17:37:53 +00:00
|
|
|
LABEL version="16"
|
2020-05-12 12:52:21 +00:00
|
|
|
|
|
|
|
ADD emscripten.jam /usr/src
|
2022-08-23 20:48:42 +00:00
|
|
|
RUN set -ex && \
|
|
|
|
\
|
2022-08-13 02:41:04 +00:00
|
|
|
apt-get update && \
|
2023-05-15 17:37:53 +00:00
|
|
|
apt-get install lz4 sudo --no-install-recommends && \
|
2022-08-23 20:48:42 +00:00
|
|
|
\
|
|
|
|
cd /usr/src && \
|
2023-03-28 09:02:18 +00:00
|
|
|
git clone https://github.com/Z3Prover/z3.git -b z3-4.12.1 --depth 1 && \
|
2022-08-23 20:48:42 +00:00
|
|
|
cd z3 && \
|
|
|
|
mkdir build && \
|
|
|
|
cd build && \
|
2020-05-12 12:52:21 +00:00
|
|
|
emcmake cmake \
|
2021-11-04 14:09:48 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX=$(em-config CACHE)/sysroot/usr \
|
2020-05-12 12:52:21 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
|
|
|
-DZ3_BUILD_LIBZ3_SHARED=OFF \
|
|
|
|
-DZ3_ENABLE_EXAMPLE_TARGETS=OFF \
|
|
|
|
-DZ3_BUILD_TEST_EXECUTABLES=OFF \
|
|
|
|
-DZ3_BUILD_EXECUTABLE=OFF \
|
|
|
|
-DZ3_SINGLE_THREADED=ON \
|
2020-06-03 17:22:17 +00:00
|
|
|
-DCMAKE_CXX_FLAGS="-s DISABLE_EXCEPTION_CATCHING=0" \
|
2022-08-23 20:48:42 +00:00
|
|
|
.. && \
|
|
|
|
make && \
|
|
|
|
make install && \
|
|
|
|
rm -r /usr/src/z3 && \
|
|
|
|
cd /usr/src && \
|
|
|
|
\
|
|
|
|
wget -q 'https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2' -O boost.tar.bz2 && \
|
|
|
|
test "$(sha256sum boost.tar.bz2)" = "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb boost.tar.bz2" && \
|
|
|
|
tar -xf boost.tar.bz2 && \
|
|
|
|
rm boost.tar.bz2 && \
|
|
|
|
cd boost_1_75_0 && \
|
|
|
|
mv ../emscripten.jam . && \
|
|
|
|
./bootstrap.sh && \
|
|
|
|
echo "using emscripten : : em++ ;" >> project-config.jam && \
|
2020-05-12 12:52:21 +00:00
|
|
|
./b2 toolset=emscripten link=static variant=release threading=single runtime-link=static \
|
|
|
|
--with-system --with-filesystem --with-test --with-program_options \
|
2020-06-03 17:22:17 +00:00
|
|
|
cxxflags="-s DISABLE_EXCEPTION_CATCHING=0 -Wno-unused-local-typedef -Wno-variadic-macros -Wno-c99-extensions -Wno-all" \
|
2022-08-23 20:48:42 +00:00
|
|
|
--prefix=$(em-config CACHE)/sysroot/usr install && \
|
2021-01-12 23:33:03 +00:00
|
|
|
rm -r /usr/src/boost_1_75_0
|