Repository navigation
Closed
Description
See #402 for a log of getting s390x Bazel built.
I managed a build of Bazel despite this being quite flaky (Dockerfile below):
$ sudo docker buildx build --no-cache --platform linux/s390x -t build-tools:ubuntu-20.04-bazel-6.5.0 -f Dockerfile.bazel .
[+] Building 4802.4s (20/20) FINISHED
But it doesn't work locally (emscripten/emcc.py missing?):
$ sudo docker run --rm --volume $(pwd):/mnt --workdir /mnt --platform linux/s390x build-tools:ubuntu-20.04-bazel-6.5.0 bazel test --verbose_failures --test_output=errors --define engine=wasmtime --config=clang --test_timeout=1800 -- //test/...
...
ERROR: /mnt/test/test_data/BUILD:88:21: Compiling test/test_data/http_logging.cc failed: (Exit 2): emcc.sh failed: error executing command (from target //test/test_data:proxy_wasm_http
_logging)
(cd /root/.cache/bazel/_bazel_root/bede119f64a38032435c6e05a554a267/sandbox/processwrapper-sandbox/10/execroot/proxy_wasm_cpp_host && \
exec env - \ BAZEL_COMPILER=clang \
CC=clang \
CXX=clang++ \
EMCC_WASM_BACKEND=1 \
EM_BIN_PATH=external/emsdk \
EM_CONFIG_PATH=external/emsdk/emscripten_toolchain/emscripten_config \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
PWD=/proc/self/cwd \
external/emsdk/emscripten_toolchain/emcc.sh '--sysroot=external/emsdk/emscripten/cache/sysroot' -fdiagnostics-color -fno-exceptions -fno-strict-aliasing -funsigned-char -no-canonical-prefixes '-std=gnu++17' -nostdinc -nostdinc++ -fomit-frame-pointer -O0 -Wall '-DBAZEL_CURRENT_REPOSITORY=""' -iquote . -iquote bazel-out/wasm-fastbuild-ST-ca831c069035/bin -iquote external/proxy_wasm_cpp_sdk -iquote bazel-out/wasm-fastbuild-ST-ca831c069035/bin/external/proxy_wasm_cpp_sdk -iquote external/emsdk -iquote bazel-out/wasm-fastbuild-ST-ca831c069035/bin/external/emsdk -O3 -iwithsysroot/include/c++/v1 -iwithsysroot/include/compat -iwithsysroot/include -isystem external/emsdk/lib/clang/15.0.0/include -MD -MF bazel-out/wasm-fastbuild-ST-ca831c069035/bin/test/test_data/_objs/proxy_wasm_http_logging/http_logging.d -c test/test_data/http_logging.cc -o bazel-out/wasm-fastbuild-ST-ca831c069035/bin/test/test_data/_objs/proxy_wasm_http_logging/http_logging.o -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -Werror)
# Configuration: c8778a672e7196fd832fc49695b58b09d50dfe3e8617c6ffd959f0b0e0dfe535
# Execution platform: @local_config_platform//:host
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/usr/bin/python3: can't open file '/root/.cache/bazel/_bazel_root/bede119f64a38032435c6e05a554a267/sandbox/processwrapper-sandbox/10/execroot/proxy_wasm_cpp_host/external/emsdk/emscripten/emcc.py': [Errno 2] No such file or directory
The Dockerfile below works natively on linux/amd64:
# syntax=docker/dockerfile:1
# Prep:
# docker run --rm --privileged tonistiigi/binfmt --install all
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# cat /proc/sys/fs/binfmt_misc/qemu-*
#
# Build:
# docker buildx build --platform linux/s390x -t $IMAGE -f Dockerfile.bazel
#
# Push:
# docker image tag $IMAGE $REPO/$IMAGE:latest
# docker push $IMAGE
#
# Test:
# docker run --rm --volume $(pwd):/mnt --workdir /mnt \
# --platform linux/s390x $IMAGE \
# bazel test --verbose_failures --test_output=errors \
# --define engine=null --config=clang --test_timeout=1800 \
# -- //test/...
# Update base image
ARG UBUNTU_VERSION=20.04
FROM ubuntu:${UBUNTU_VERSION} as build
RUN apt update && apt upgrade -y
RUN apt autoremove -y
# Install Bazel deps
RUN apt install -y software-properties-common
RUN add-apt-repository ppa:openjdk-r/ppa
RUN apt install -y \
build-essential \
openjdk-11-jdk \
python3 \
curl \
zip \
unzip
# Download Bazel source
ARG BAZEL_VERSION=6.5.0
RUN cd ~ && mkdir bazel && cd bazel
RUN curl -LO https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip
RUN unzip -q bazel-${BAZEL_VERSION}-dist.zip
# Build Bazel
# NOTE: This step is flaky and frequently hangs for multiarch / buildx.
# If it takes more than 2 hours, restart the Docker build and try again.
ENV EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk"
RUN bash ./compile.sh
# Copy output to /usr/bin
RUN cp /output/bazel /usr/bin/bazel
# Install ProxyWasm build deps
RUN apt install -y \
git \
python3-distutils \
clang \
libstdc++6
Metadata
Metadata
Assignees
Labels
No labels
Activity
knm3000 commentedon Aug 9, 2024
Actually
emscripten/emsdkis not supported on s390x. If we need to compile C++ WASM, then it is not possible on s390x. But Rust WASM can be compiled withoutemscripten. I believe we need emscripten to compile C++ WASM modules intest/test_data. Is it possible to exclude C++ WASM from s390x tests and compile Rust WASM only?PiotrSikora commentedon Aug 9, 2024
Note that on the CI we build test data (both C++ and Rust) once in a separate step, so those files are not compiled on s390x.
Maybe push this image to DockerHub or GitHub and update the reference in #402?
martijneken commentedon Aug 9, 2024
Progress. Now we have an openssl error:
https://github.com/proxy-wasm/proxy-wasm-cpp-host/actions/runs/10324222910/job/28583305756?pr=402
martijneken commentedon Aug 9, 2024
Next error: https://github.com/proxy-wasm/proxy-wasm-cpp-host/actions/runs/10324463000/job/28584062353?pr=402
PiotrSikora commentedon Aug 9, 2024
That's new. I imagine that this might disappear with update to any of: Clang (or ideally, Ubuntu base image), Rust (as part of
rules_rust) or Wasmtime, so you could revisit this after all of those are done.chore: bump Bazel from 5.2.0 to 6.5.0 (#402)
martijneken commentedon Aug 12, 2024
Yeah . I think your old image used clang-14 (given its name), whereas Ubuntu 20.04 used clang-10 by default. I'll start with an update to Ubuntu 22.04 which gets us back to clang-14.
martijneken commentedon Aug 12, 2024
Yippee, success: https://github.com/proxy-wasm/proxy-wasm-cpp-host/actions/runs/10352997621/job/28654988504?pr=408
feat: add knob to customise on{Request,Response}Headers StopIteration…