Skip to content

Commit c4d9cdf

Browse files
authored
Merge pull request #13424 from ethereum/update-emscripten-dockerfile
Update emscripten Dockerfile to 3.1.19
2 parents 22a0c46 + 3587054 commit c4d9cdf

File tree

3 files changed

+44
-28
lines changed

3 files changed

+44
-28
lines changed

scripts/ci/build_emscripten.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ else
4040
BUILD_DIR="$1"
4141
fi
4242

43-
apt-get update && apt-get install lz4
43+
apt-get update
44+
apt-get install lz4 --no-install-recommends
4445

4546
WORKSPACE=/root/project
4647

@@ -61,12 +62,20 @@ then
6162
echo -n "$CIRCLE_SHA1" >commit_hash.txt
6263
fi
6364

65+
# Disable warnings for unqualified "move()" calls, introduced and enabled by
66+
# default in clang-16 which is what the emscripten docker image uses.
67+
# Additionally, disable the warning for unknown warnings here, as this script is
68+
# also used with earlier clang versions.
69+
CMAKE_CXX_FLAGS="-Wno-unqualified-std-cast-call -Wno-unknown-warning-option"
70+
71+
6472
mkdir -p "$BUILD_DIR"
6573
cd "$BUILD_DIR"
6674
emcmake cmake \
6775
-DCMAKE_BUILD_TYPE=Release \
6876
-DBoost_USE_STATIC_LIBS=1 \
6977
-DBoost_USE_STATIC_RUNTIME=1 \
78+
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \
7079
-DTESTS=0 \
7180
..
7281
make soljson

scripts/docker/buildpack-deps/Dockerfile.emscripten

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,20 @@
3232
# apparently this currently breaks due to conflicting compatibility headers.
3333
# Using $(em-config CACHE)/sysroot/usr seems to work, though, and still has cmake find the
3434
# dependencies automatically.
35-
FROM emscripten/emsdk:2.0.33 AS base
36-
LABEL version="11"
35+
FROM emscripten/emsdk:3.1.19 AS base
36+
LABEL version="12"
3737

3838
ADD emscripten.jam /usr/src
39-
RUN set -ex; \
40-
cd /usr/src; \
41-
git clone https://github.com/Z3Prover/z3.git -b z3-4.8.17 --depth 1 ; \
42-
cd z3; \
43-
mkdir build; \
44-
cd build; \
39+
RUN set -ex && \
40+
\
41+
apt-get update && \
42+
apt-get install lz4 --no-install-recommends && \
43+
\
44+
cd /usr/src && \
45+
git clone https://github.com/Z3Prover/z3.git -b z3-4.8.17 --depth 1 && \
46+
cd z3 && \
47+
mkdir build && \
48+
cd build && \
4549
emcmake cmake \
4650
-DCMAKE_INSTALL_PREFIX=$(em-config CACHE)/sysroot/usr \
4751
-DCMAKE_BUILD_TYPE=MinSizeRel \
@@ -51,21 +55,22 @@ RUN set -ex; \
5155
-DZ3_BUILD_EXECUTABLE=OFF \
5256
-DZ3_SINGLE_THREADED=ON \
5357
-DCMAKE_CXX_FLAGS="-s DISABLE_EXCEPTION_CATCHING=0" \
54-
..; \
55-
make ; make install; \
56-
rm -r /usr/src/z3; \
57-
cd /usr/src; \
58-
59-
wget -q 'https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2' -O boost.tar.bz2; \
60-
test "$(sha256sum boost.tar.bz2)" = "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb boost.tar.bz2"; \
61-
tar -xf boost.tar.bz2; \
62-
rm boost.tar.bz2; \
63-
cd boost_1_75_0; \
64-
mv ../emscripten.jam .; \
65-
./bootstrap.sh; \
66-
echo "using emscripten : : em++ ;" >> project-config.jam ; \
58+
.. && \
59+
make && \
60+
make install && \
61+
rm -r /usr/src/z3 && \
62+
cd /usr/src && \
63+
\
64+
wget -q 'https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2' -O boost.tar.bz2 && \
65+
test "$(sha256sum boost.tar.bz2)" = "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb boost.tar.bz2" && \
66+
tar -xf boost.tar.bz2 && \
67+
rm boost.tar.bz2 && \
68+
cd boost_1_75_0 && \
69+
mv ../emscripten.jam . && \
70+
./bootstrap.sh && \
71+
echo "using emscripten : : em++ ;" >> project-config.jam && \
6772
./b2 toolset=emscripten link=static variant=release threading=single runtime-link=static \
6873
--with-system --with-filesystem --with-test --with-program_options \
6974
cxxflags="-s DISABLE_EXCEPTION_CATCHING=0 -Wno-unused-local-typedef -Wno-variadic-macros -Wno-c99-extensions -Wno-all" \
70-
--prefix=$(em-config CACHE)/sysroot/usr install; \
75+
--prefix=$(em-config CACHE)/sysroot/usr install && \
7176
rm -r /usr/src/boost_1_75_0

scripts/docker/buildpack-deps/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,20 @@ located in `develop`.
1818
### Build, Test & Push
1919

2020
Note that the whole workflow - including all defined strategies (image variants) - will be triggered,
21-
even if only a single Dockerfile was change. The full workflow will only gets executed, if the corresponding
21+
even if only a single Dockerfile was changed. The full workflow will only get executed, if the corresponding
2222
Dockerfile was changed. The execution of workflows of unchanged Dockerfiles will not continue and just return success.
2323
See `scripts/ci/docker_upgrade.sh`.
2424

2525
If the version check was successful, the docker image will be built using the Dockerfile located in
2626
`scripts/docker/buildpack-deps/Dockerfile.*`.
2727

28-
The resulting docker image will be tested by executing
29-
the corresponding `scripts/ci/buildpack-deps_test_*` scripts. These scripts are normally symlinked to `scripts/ci/build.sh`,
30-
except for the `buildpack-deps-ubuntu1604.clang.ossfuzz` docker image, that is symlinked to `scripts/ci/build_ossfuzz.sh`.
28+
The resulting docker image will be tested by executing the corresponding `scripts/ci/buildpack-deps_test_*` scripts.
29+
Some of these scripts are symlinked to `scripts/ci/build.sh`, except the following two:
30+
* `buildpack-deps-ubuntu1604.clang.ossfuzz` => `scripts/ci/build_ossfuzz.sh`
31+
* `buildpack-deps_test_emscripten.sh` => `scripts/ci/build_emscripten.sh`
32+
3133
These scripts `scripts/ci/build.sh` and `scripts/ci/build_ossfuzz.sh` are also used by CircleCI, see `.circleci/config.yml`.
3234

3335
If the tests passed successfully, the docker image will get tagged by the version defined within the corresponding `Dockerfile`.
3436
Finally, a comment will be added to the PR that contains the full repository, version and repository digest
35-
of the freshly created docker image.
37+
of the freshly created docker image.

0 commit comments

Comments
 (0)