From 640c74e76c8ac63dde62dbb47d5dbe8e784a34a1 Mon Sep 17 00:00:00 2001 From: Graham Date: Tue, 15 Sep 2026 08:28:22 -0700 Subject: [PATCH] Tools: add WebAssembly SITL support --- .../install-wasm-prereqs-ubuntu.sh | 28 +++++++++++++++++++ Tools/scripts/test_new_boards.py | 5 ++++ 2 files changed, 33 insertions(+) create mode 100755 Tools/environment_install/install-wasm-prereqs-ubuntu.sh diff --git a/Tools/environment_install/install-wasm-prereqs-ubuntu.sh b/Tools/environment_install/install-wasm-prereqs-ubuntu.sh new file mode 100755 index 00000000000..cad5862c08b --- /dev/null +++ b/Tools/environment_install/install-wasm-prereqs-ubuntu.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e +set -x + +EMSCRIPTEN_VERSION=${EMSCRIPTEN_VERSION:-6.0.8} +EMSDK_ROOT=${EMSDK_ROOT:-$HOME/emsdk} +SHELL_LOGIN=${SHELL_LOGIN:-.profile} + +if ! python3 -c 'import sys; sys.exit(sys.version_info < (3, 10))'; then + echo "Emscripten SDK requires Python 3.10 or newer." + exit 1 +fi + +if [ ! -d "$EMSDK_ROOT/.git" ]; then + git clone https://github.com/emscripten-core/emsdk.git "$EMSDK_ROOT" +else + if ! git -C "$EMSDK_ROOT" pull --ff-only; then + echo "Warning: could not update emsdk; continuing with the existing checkout." >&2 + fi +fi + +"$EMSDK_ROOT/emsdk" install "$EMSCRIPTEN_VERSION" +"$EMSDK_ROOT/emsdk" activate "$EMSCRIPTEN_VERSION" + +exportline_wasm=". \"$EMSDK_ROOT/emsdk_env.sh\" >/dev/null" +grep -Fxq "$exportline_wasm" "$HOME/$SHELL_LOGIN" 2>/dev/null || echo "$exportline_wasm" >> "$HOME/$SHELL_LOGIN" +eval "$exportline_wasm" diff --git a/Tools/scripts/test_new_boards.py b/Tools/scripts/test_new_boards.py index e79d113e739..1057572c65c 100755 --- a/Tools/scripts/test_new_boards.py +++ b/Tools/scripts/test_new_boards.py @@ -312,6 +312,11 @@ class TestNewBoards(BuildScriptBase): self.progress(f"Skipping arm-linux board {board.name}") continue + # Skip Emscripten boards - CI machine doesn't have the SDK + if board.toolchain == "emscripten": + self.progress(f"Skipping Emscripten board {board.name}") + continue + self.progress(f"Building board {board.name}") if boards_to_test[board_name].test_vehicles: self.build_board(board)