From 0685ee1847ceb016947bc1866952215ce58c351d Mon Sep 17 00:00:00 2001 From: kevmoo Date: Sat, 14 Mar 2026 14:26:37 -0700 Subject: [PATCH 1/4] ci: modernize and fix GitHub Actions workflow - Bump actions/checkout from v1/v3 to v4 to avoid Node.js deprecation warnings. - Bump actions/setup-python from v1 to v5 for the same reason. - Add `-y` to all `apt-get install` and `apt-get update` commands to prevent process hangs. - Modernize CMake configuration by using `-S . -B out` instead of manually creating directories and using `working-directory: out`. - Fix the Windows build step missing the `-G Ninja` flag, ensuring it actually uses the Ninja binary installed in the previous step (issue present since initial GH actions migration in a08df5c). - Fix minor typo ('Temporatily' -> 'Temporarily'). - Unified some install commands --- .github/workflows/build.yml | 64 +++++++++++++++---------------------- 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31204ee7fa..bf2f4495cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,14 +13,14 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 with: python-version: '3.x' - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: install tools run: | pip3 install flake8==7.3.0 - sudo apt-get install clang-format + sudo apt-get install -y clang-format - run: flake8 - run: ./scripts/clang-format-diff.sh env: @@ -37,11 +37,11 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.x' - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: true - name: install ninja (linux) - run: sudo apt-get install ninja-build + run: sudo apt-get install -y ninja-build if: matrix.os == 'ubuntu-latest' - name: install ninja (osx) run: brew install ninja @@ -49,20 +49,12 @@ jobs: - name: install ninja (win) run: choco install ninja if: matrix.os == 'windows-latest' - - name: mkdir - run: mkdir -p out - name: tool versions run: | cmake --version ninja --version - name: cmake - run: cmake .. -G Ninja -DWERROR=ON -Werror=dev -DCMAKE_ERROR_DEPRECATED=OFF - working-directory: out - if: matrix.os != 'windows-latest' - - name: cmake (windows) - run: cmake .. -DWERROR=ON -Werror=dev -DCMAKE_ERROR_DEPRECATED=OFF - working-directory: out - if: matrix.os == 'windows-latest' + run: cmake -S . -B out -G Ninja -DWERROR=ON -Werror=dev -DCMAKE_ERROR_DEPRECATED=OFF - name: build run: cmake --build out - name: check if generated files are up-to-date @@ -77,7 +69,7 @@ jobs: name: emscripten runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: true - name: build @@ -91,7 +83,7 @@ jobs: name: wasi runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: build-tools @@ -115,13 +107,13 @@ jobs: sanitizer: [asan, ubsan, fuzz] type: [debug, release] steps: - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 with: python-version: '3.x' - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: true - - run: sudo apt-get install ninja-build + - run: sudo apt-get install -y ninja-build - name: workaround for ASLR+ASAN compatibility # See https://github.com/actions/runner/issues/3207 run: sudo sysctl -w vm.mmap_rnd_bits=28 - run: make clang-${{ matrix.type }}-${{ matrix.sanitizer }} @@ -135,13 +127,13 @@ jobs: CC: "clang" # used by the wasm2c tests WASM2C_CFLAGS: "-march=x86-64-v2 -fsanitize=address -DWASM_RT_USE_MMAP=0" steps: - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 with: python-version: '3.x' - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: true - - run: sudo apt-get install ninja-build + - run: sudo apt-get install -y ninja-build - name: workaround for ASLR+ASAN compatibility # See https://github.com/actions/runner/issues/3207 run: sudo sysctl -w vm.mmap_rnd_bits=28 - run: make clang-debug-asan @@ -151,14 +143,14 @@ jobs: name: min-cmake runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: true - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install Ninja - run: sudo apt-get install ninja-build + run: sudo apt-get install -y ninja-build - name: Detect minimum CMake version run: > awk 'match($0, /cmake_minimum_required\(VERSION *([0-9]+\.[0-9]+)\)/, a) @@ -211,20 +203,20 @@ jobs: WASM2C_CC: "clang" WASM2C_CFLAGS: "-DWASM_RT_USE_MMAP=1 -DWASM_RT_SKIP_SIGNAL_RECOVERY=1 -DWASM_RT_NONCONFORMING_UNCHECKED_STACK_EXHAUSTION=1 -DWASM2C_TEST_EMBEDDER_SIGNAL_HANDLING -DWASM_RT_ALLOW_SEGUE=1 -DWASM_RT_SEGUE_FREE_SEGMENT=1 -mfsgsbase -DWASM_RT_SANITY_CHECKS=1 -Wno-pass-failed" steps: - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 with: python-version: '3.x' - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: true - - run: sudo apt-get install ninja-build + - run: sudo apt-get install -y ninja-build - run: make clang-debug - name: tests (wasm2c tests excluding memory64) run: ./test/run-tests.py wasm2c --exclude-dir memory64 build-cross: runs-on: ubuntu-latest - # Temporatily disabled until we can get it fixed: + # Temporarily disabled until we can get it fixed: # https://github.com/WebAssembly/wabt/issues/2655 if: ${{ false }} strategy: @@ -240,10 +232,10 @@ jobs: env: QEMU_LD_PREFIX: /usr/${{matrix.arch}}-linux-gnu/ steps: - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 with: python-version: '3.x' - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: true - name: Set up QEMU @@ -252,13 +244,9 @@ jobs: platforms: ${{matrix.arch}} image: "tonistiigi/binfmt:master" - name: apt-get update - run: sudo apt-get update - - name: install ninja - run: sudo apt-get install ninja-build - - name: install the toolchain - run: sudo apt-get install g++-${{matrix.arch}}-linux-gnu - - name: install distcc - run: sudo apt-get install distcc + run: sudo apt-get update -y + - name: install dependencies + run: sudo apt-get install -y ninja-build g++-${{matrix.arch}}-linux-gnu distcc - name: mkdir distcc symlinks run: sudo mkdir -p /opt/bin/distcc_symlinks - name: distcc symlink From ea995cd924c925d3836cd136e9ef48633b69db54 Mon Sep 17 00:00:00 2001 From: kevmoo Date: Sat, 14 Mar 2026 14:54:51 -0700 Subject: [PATCH 2/4] Fix CI failures introduced in PR 2717 --- .github/workflows/build.yml | 4 ++++ CMakeLists.txt | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf2f4495cc..d5ef41c304 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,8 @@ jobs: with: python-version: '3.x' - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: install tools run: | pip3 install flake8==7.3.0 @@ -49,6 +51,8 @@ jobs: - name: install ninja (win) run: choco install ninja if: matrix.os == 'windows-latest' + - uses: ilammy/msvc-dev-cmd@v1 + if: matrix.os == 'windows-latest' - name: tool versions run: | cmake --version diff --git a/CMakeLists.txt b/CMakeLists.txt index dab70edb60..ddee939eb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -758,7 +758,11 @@ if (BUILD_TESTS) if (COMPILER_IS_MSVC) set_target_properties(${EXENAME} PROPERTIES COMPILE_FLAGS "-wd4311") else () - set_target_properties(${EXENAME} PROPERTIES COMPILE_FLAGS "-std=gnu11 -Wno-pointer-to-int-cast") + set(C_API_FLAGS "-std=gnu11 -Wno-pointer-to-int-cast") + if (COMPILER_IS_CLANG) + set(C_API_FLAGS "${C_API_FLAGS} -Wno-gnu-folding-constant") + endif () + set_target_properties(${EXENAME} PROPERTIES COMPILE_FLAGS "${C_API_FLAGS}") endif () target_link_libraries(${EXENAME} wasm Threads::Threads) From 78604126829fd12b47677c7b737d79d740c4bc5d Mon Sep 17 00:00:00 2001 From: kevmoo Date: Sat, 14 Mar 2026 15:17:35 -0700 Subject: [PATCH 3/4] ci: Fix wasm2c MSVC test failures and bump GitHub actions --- .github/workflows/build.yml | 32 ++++++++++++++++---------------- CMakeLists.txt | 6 +++++- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5ef41c304..1dd21a1cb1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,10 +13,10 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: '3.x' - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - name: install tools @@ -36,10 +36,10 @@ jobs: # See https://github.com/WebAssembly/wabt/issues/2654 os: [ubuntu-latest, macos-14, windows-latest] steps: - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: '3.x' - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: true - name: install ninja (linux) @@ -73,7 +73,7 @@ jobs: name: emscripten runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: true - name: build @@ -87,7 +87,7 @@ jobs: name: wasi runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: true - name: build-tools @@ -111,10 +111,10 @@ jobs: sanitizer: [asan, ubsan, fuzz] type: [debug, release] steps: - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: '3.x' - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: true - run: sudo apt-get install -y ninja-build @@ -131,10 +131,10 @@ jobs: CC: "clang" # used by the wasm2c tests WASM2C_CFLAGS: "-march=x86-64-v2 -fsanitize=address -DWASM_RT_USE_MMAP=0" steps: - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: '3.x' - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: true - run: sudo apt-get install -y ninja-build @@ -147,10 +147,10 @@ jobs: name: min-cmake runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: true - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: '3.x' - name: Install Ninja @@ -207,10 +207,10 @@ jobs: WASM2C_CC: "clang" WASM2C_CFLAGS: "-DWASM_RT_USE_MMAP=1 -DWASM_RT_SKIP_SIGNAL_RECOVERY=1 -DWASM_RT_NONCONFORMING_UNCHECKED_STACK_EXHAUSTION=1 -DWASM2C_TEST_EMBEDDER_SIGNAL_HANDLING -DWASM_RT_ALLOW_SEGUE=1 -DWASM_RT_SEGUE_FREE_SEGMENT=1 -mfsgsbase -DWASM_RT_SANITY_CHECKS=1 -Wno-pass-failed" steps: - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: '3.x' - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: true - run: sudo apt-get install -y ninja-build @@ -236,10 +236,10 @@ jobs: env: QEMU_LD_PREFIX: /usr/${{matrix.arch}}-linux-gnu/ steps: - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: '3.x' - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: submodules: true - name: Set up QEMU diff --git a/CMakeLists.txt b/CMakeLists.txt index ddee939eb6..0f33e8ee0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -654,7 +654,11 @@ endif () if (BUILD_TESTS) if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(WASM2C_CFLAGS "${WASM2C_CFLAGS} -g -O0") + if (COMPILER_IS_MSVC) + set(WASM2C_CFLAGS "${WASM2C_CFLAGS} /Zi /Od") + else () + set(WASM2C_CFLAGS "${WASM2C_CFLAGS} -g -O0") + endif () endif () if (WABT_BIG_ENDIAN) From ff81e6fd14429d6e9f373b845cfda2bac65e1891 Mon Sep 17 00:00:00 2001 From: kevmoo Date: Sat, 14 Mar 2026 20:20:06 -0700 Subject: [PATCH 4/4] ci: add /FS msvc flag for concurrent wasm2c tests --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f33e8ee0c..e6a6ac72ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -655,7 +655,7 @@ endif () if (BUILD_TESTS) if (CMAKE_BUILD_TYPE STREQUAL "Debug") if (COMPILER_IS_MSVC) - set(WASM2C_CFLAGS "${WASM2C_CFLAGS} /Zi /Od") + set(WASM2C_CFLAGS "${WASM2C_CFLAGS} /Zi /Od /FS") else () set(WASM2C_CFLAGS "${WASM2C_CFLAGS} -g -O0") endif ()