|
44 | 44 | # conflicts in case of parallel compilation. |
45 | 45 | # 3. Configuration variables are shared between runs using /root/env file. |
46 | 46 |
|
47 | | -ARG ALPINE_VERSION=3.18 |
| 47 | +ARG ALPINE_VERSION=3.21 |
48 | 48 |
|
49 | 49 | # deps-${RUSTC_WRAPPER:-base} |
50 | 50 | # If one of SCCACHE_GHA_ENABLED, SCCACHE_BUCKET, SCCACHE_MEMCACHED is set, then deps-sccache is used, otherwise deps-base |
@@ -72,6 +72,7 @@ RUN apk add --no-cache \ |
72 | 72 | ca-certificates \ |
73 | 73 | clang-static clang-dev \ |
74 | 74 | cmake \ |
| 75 | + curl \ |
75 | 76 | git \ |
76 | 77 | libc-dev \ |
77 | 78 | linux-headers \ |
@@ -148,7 +149,13 @@ RUN if [[ "$TARGETARCH" == "arm64" ]] ; then export PROTOC_ARCH=aarch_64; else e |
148 | 149 | ln -s /opt/protoc/bin/protoc /usr/bin/ |
149 | 150 |
|
150 | 151 | # Switch to clang |
151 | | -RUN rm /usr/bin/cc && ln -s /usr/bin/clang /usr/bin/cc |
| 152 | +# Note that CC / CXX can be updated later on (eg. when configuring sccache) |
| 153 | +RUN rm /usr/bin/cc && \ |
| 154 | + ln -s /usr/bin/clang /usr/bin/cc |
| 155 | +RUN <<EOS |
| 156 | +echo "export CXX='clang++'" >> /root/env |
| 157 | +echo "export CC='clang'" >> /root/env |
| 158 | +EOS |
152 | 159 |
|
153 | 160 | ARG NODE_ENV=production |
154 | 161 | ENV NODE_ENV=${NODE_ENV} |
@@ -287,6 +294,7 @@ git clone https://github.com/facebook/rocksdb.git -b v9.9.3 --depth 1 . |
287 | 294 | source /root/env |
288 | 295 |
|
289 | 296 | make -j$(nproc) static_lib |
| 297 | + |
290 | 298 | mkdir -p /opt/rocksdb/usr/local/lib |
291 | 299 | cp librocksdb.a /opt/rocksdb/usr/local/lib/ |
292 | 300 | cp -r include /opt/rocksdb/usr/local/ |
@@ -492,11 +500,13 @@ WORKDIR /platform |
492 | 500 | COPY --from=build-planner /platform/recipe.json recipe.json |
493 | 501 |
|
494 | 502 | # Build dependencies - this is the caching Docker layer! |
| 503 | +# Note we unset CFLAGS and CXXFLAGS as they have `-march` included, which breaks wasm32 build |
495 | 504 | RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOME}/registry/index \ |
496 | 505 | --mount=type=cache,sharing=shared,id=cargo_registry_cache,target=${CARGO_HOME}/registry/cache \ |
497 | 506 | --mount=type=cache,sharing=shared,id=cargo_git,target=${CARGO_HOME}/git/db \ |
498 | 507 | --mount=type=secret,id=AWS \ |
499 | 508 | source /root/env && \ |
| 509 | + unset CFLAGS CXXFLAGS && \ |
500 | 510 | cargo chef cook \ |
501 | 511 | --recipe-path recipe.json \ |
502 | 512 | --profile "$CARGO_BUILD_PROFILE" \ |
@@ -543,12 +553,14 @@ COPY --parents \ |
543 | 553 | packages/dash-spv \ |
544 | 554 | /platform/ |
545 | 555 |
|
| 556 | +# We unset CFLAGS CXXFLAGS because they hold `march` flags which break wasm32 build |
546 | 557 | RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOME}/registry/index \ |
547 | 558 | --mount=type=cache,sharing=shared,id=cargo_registry_cache,target=${CARGO_HOME}/registry/cache \ |
548 | 559 | --mount=type=cache,sharing=shared,id=cargo_git,target=${CARGO_HOME}/git/db \ |
549 | 560 | --mount=type=cache,sharing=shared,id=unplugged_${TARGETARCH},target=/tmp/unplugged \ |
550 | 561 | --mount=type=secret,id=AWS \ |
551 | 562 | source /root/env && \ |
| 563 | + unset CFLAGS CXXFLAGS && \ |
552 | 564 | cp -R /tmp/unplugged /platform/.yarn/ && \ |
553 | 565 | yarn install --inline-builds && \ |
554 | 566 | cp -R /platform/.yarn/unplugged /tmp/ && \ |
|
0 commit comments