Closed martijneken closed 3 months ago
Actually emscripten/emsdk
is not supported on s390x. If we need to compile C++ WASM, then it is not possible on s390x. But Rust WASM can be compiled without emscripten
. I believe we need emscripten to compile C++ WASM modules in test/test_data
. Is it possible to exclude C++ WASM from s390x tests and compile Rust WASM only?
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?
Progress. Now we have an openssl error:
https://github.com/proxy-wasm/proxy-wasm-cpp-host/actions/runs/10324222910/job/28583305756?pr=402
[138 / 270] Compiling src/context.cc; 6s processwrapper-sandbox ... (4 actions running)
ERROR: /home/runner/work/proxy-wasm-cpp-host/proxy-wasm-cpp-host/BUILD:64:11: Compiling src/context.cc failed: (Exit 1): clang failed: error executing command (from target //:base_lib)
(cd /home/runner/.cache/bazel/_bazel_runner/6e9090fa382dda61db70769c6a68a5bd/sandbox/processwrapper-sandbox/42/execroot/proxy_wasm_cpp_host && \
exec env - \
BAZEL_COMPILER=clang \
CC=clang \
CXX=clang++ \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
*** \
/usr/lib/llvm-10/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++14' -MD -MF bazel-out/s390x-fastbuild-ST-5c2a6e57c052/bin/_objs/base_lib/context.pic.d '-frandom-seed=bazel-out/s390x-fastbuild-ST-5c2a6e57c052/bin/_objs/base_lib/context.pic.o' -fPIC '-DBAZEL_CURRENT_REPOSITORY=""' -iquote . -iquote bazel-out/s390x-fastbuild-ST-5c2a6e57c052/bin -iquote external/proxy_wasm_cpp_sdk -iquote bazel-out/s390x-fastbuild-ST-5c2a6e57c052/bin/external/proxy_wasm_cpp_sdk -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION '-std=c++17' -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c src/context.cc -o bazel-out/s390x-fastbuild-ST-5c2a6e57c052/bin/_objs/base_lib/context.pic.o)
# Configuration: 625f8fbb3895b70a5d54a3af298554c84e6fcd48ed087b00fbf5d7329c1a8bca
# Execution platform: @local_config_platform//:host
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from src/context.cc:25:
./src/hash.h:20:10: fatal error: 'openssl/sha.h' file not found
#include <openssl/sha.h>
^~~~~~~~~~~~~~~
1 error generated.
Next error: https://github.com/proxy-wasm/proxy-wasm-cpp-host/actions/runs/10324463000/job/28584062353?pr=402
cargo:warning=src/trampolines/s390x.S:4:9: error: unknown directive
cargo:warning= .machine z13
cargo:warning= ^
--stderr:
error occurred: Command "/usr/lib/llvm-10/bin/clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "--target=s390x-unknown-linux-gnu" "-U_FORTIFY_SOURCE" "-fstack-protector" "-Wall" "-Wthread-safety" "-Wself-assign" "-fcolor-diagnostics" "-fno-omit-frame-pointer" "-no-canonical-prefixes" "-Wno-builtin-macro-redefined" "-D__DATE__=\"redacted\"" "-D__TIMESTAMP__=\"redacted\"" "-D__TIME__=\"redacted\"" "-Wall" "-Wextra" "-DCFG_TARGET_OS_linux" "-DCFG_TARGET_ARCH_s390x" "-o" "/home/runner/.cache/bazel/_bazel_runner/6e9090fa382dda61db70769c6a68a5bd/sandbox/processwrapper-sandbox/218/execroot/proxy_wasm_cpp_host/bazel-out/s390x-fastbuild/bin/external/cu__wasmtime-runtime-9.0.4/wasmtime-runtime_build_script.out_dir/eb6e60f2655818a1-s390x.o" "-c" "src/trampolines/s390x.S" with args clang did not execute successfully (status code exit status: 1).
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.
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.
See https://github.com/proxy-wasm/proxy-wasm-cpp-host/pull/402 for a log of getting s390x Bazel built.
I managed a build of Bazel despite this being quite flaky (Dockerfile below):
But it doesn't work locally (emscripten/emcc.py missing?):
The Dockerfile below works natively on linux/amd64: