Merge pull request #13424 from ethereum/update-emscripten-dockerfile

Update emscripten Dockerfile to 3.1.19
This commit is contained in:
Mathias L. Baumann 2022-08-25 16:08:03 +02:00 committed by GitHub
commit c4d9cdf643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 28 deletions

View File

@ -40,7 +40,8 @@ else
BUILD_DIR="$1"
fi
apt-get update && apt-get install lz4
apt-get update
apt-get install lz4 --no-install-recommends
WORKSPACE=/root/project
@ -61,12 +62,20 @@ then
echo -n "$CIRCLE_SHA1" >commit_hash.txt
fi
# Disable warnings for unqualified "move()" calls, introduced and enabled by
# default in clang-16 which is what the emscripten docker image uses.
# Additionally, disable the warning for unknown warnings here, as this script is
# also used with earlier clang versions.
CMAKE_CXX_FLAGS="-Wno-unqualified-std-cast-call -Wno-unknown-warning-option"
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
emcmake cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBoost_USE_STATIC_LIBS=1 \
-DBoost_USE_STATIC_RUNTIME=1 \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \
-DTESTS=0 \
..
make soljson

View File

@ -32,16 +32,20 @@
# 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.
FROM emscripten/emsdk:2.0.33 AS base
LABEL version="11"
FROM emscripten/emsdk:3.1.19 AS base
LABEL version="12"
ADD emscripten.jam /usr/src
RUN set -ex; \
cd /usr/src; \
git clone https://github.com/Z3Prover/z3.git -b z3-4.8.17 --depth 1 ; \
cd z3; \
mkdir build; \
cd build; \
RUN set -ex && \
\
apt-get update && \
apt-get install lz4 --no-install-recommends && \
\
cd /usr/src && \
git clone https://github.com/Z3Prover/z3.git -b z3-4.8.17 --depth 1 && \
cd z3 && \
mkdir build && \
cd build && \
emcmake cmake \
-DCMAKE_INSTALL_PREFIX=$(em-config CACHE)/sysroot/usr \
-DCMAKE_BUILD_TYPE=MinSizeRel \
@ -51,21 +55,22 @@ RUN set -ex; \
-DZ3_BUILD_EXECUTABLE=OFF \
-DZ3_SINGLE_THREADED=ON \
-DCMAKE_CXX_FLAGS="-s DISABLE_EXCEPTION_CATCHING=0" \
..; \
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 ; \
.. && \
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 && \
./b2 toolset=emscripten link=static variant=release threading=single runtime-link=static \
--with-system --with-filesystem --with-test --with-program_options \
cxxflags="-s DISABLE_EXCEPTION_CATCHING=0 -Wno-unused-local-typedef -Wno-variadic-macros -Wno-c99-extensions -Wno-all" \
--prefix=$(em-config CACHE)/sysroot/usr install; \
--prefix=$(em-config CACHE)/sysroot/usr install && \
rm -r /usr/src/boost_1_75_0

View File

@ -18,16 +18,18 @@ located in `develop`.
### Build, Test & Push
Note that the whole workflow - including all defined strategies (image variants) - will be triggered,
even if only a single Dockerfile was change. The full workflow will only gets executed, if the corresponding
even if only a single Dockerfile was changed. The full workflow will only get executed, if the corresponding
Dockerfile was changed. The execution of workflows of unchanged Dockerfiles will not continue and just return success.
See `scripts/ci/docker_upgrade.sh`.
If the version check was successful, the docker image will be built using the Dockerfile located in
`scripts/docker/buildpack-deps/Dockerfile.*`.
The resulting docker image will be tested by executing
the corresponding `scripts/ci/buildpack-deps_test_*` scripts. These scripts are normally symlinked to `scripts/ci/build.sh`,
except for the `buildpack-deps-ubuntu1604.clang.ossfuzz` docker image, that is symlinked to `scripts/ci/build_ossfuzz.sh`.
The resulting docker image will be tested by executing the corresponding `scripts/ci/buildpack-deps_test_*` scripts.
Some of these scripts are symlinked to `scripts/ci/build.sh`, except the following two:
* `buildpack-deps-ubuntu1604.clang.ossfuzz` => `scripts/ci/build_ossfuzz.sh`
* `buildpack-deps_test_emscripten.sh` => `scripts/ci/build_emscripten.sh`
These scripts `scripts/ci/build.sh` and `scripts/ci/build_ossfuzz.sh` are also used by CircleCI, see `.circleci/config.yml`.
If the tests passed successfully, the docker image will get tagged by the version defined within the corresponding `Dockerfile`.