mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
🔧 Fail CI when render-wasm JS glue exports invoke_*V (#12243)
* 🔧 Fail CI when render-wasm JS glue exports invoke_*V Add check-no-invoke-v (path from _build_env) and run it in CI: WASM after a production frontend build so JS longjmp + SIMD ABI regressions are caught in the pipeline. * 🐛 Fail closed in render-wasm invoke_* glue check * 🔧 Check exporter wasm glue for any invoke_* wrapper --------- Co-authored-by: Elena Torro <elenatorro@gmail.com>
This commit is contained in:
parent
4023642acb
commit
1ebb4f3866
5
.github/workflows/tests-exporter.yml
vendored
5
.github/workflows/tests-exporter.yml
vendored
@ -61,3 +61,8 @@ jobs:
|
||||
working-directory: ./exporter
|
||||
run: |
|
||||
./scripts/test
|
||||
|
||||
- name: Check no invoke_* in exporter JS glue
|
||||
working-directory: ./render-wasm
|
||||
run: |
|
||||
./check-no-invoke-v export
|
||||
|
||||
10
.github/workflows/tests-wasm.yml
vendored
10
.github/workflows/tests-wasm.yml
vendored
@ -60,3 +60,13 @@ jobs:
|
||||
working-directory: ./render-wasm
|
||||
run: |
|
||||
./test
|
||||
|
||||
- name: Build
|
||||
working-directory: ./render-wasm
|
||||
run: |
|
||||
NODE_ENV=production ./build frontend
|
||||
|
||||
- name: Check no invoke_*V in JS glue
|
||||
working-directory: ./render-wasm
|
||||
run: |
|
||||
./check-no-invoke-v
|
||||
|
||||
41
render-wasm/check-no-invoke-v
Executable file
41
render-wasm/check-no-invoke-v
Executable file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
# Usage: ./check-no-invoke-v [frontend|export] [glue-path]
|
||||
#
|
||||
# Fail if the Emscripten JS glue has any invoke_* wrapper. With Wasm EH and
|
||||
# Wasm SjLj there should be none; invoke_*V (v128) throws a TypeError at the
|
||||
# JS boundary.
|
||||
set -euo pipefail
|
||||
|
||||
_SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||||
TARGET=${1:-frontend}
|
||||
# _build_env reads NODE_ENV without a default; keep set -u happy.
|
||||
NODE_ENV=${NODE_ENV:-}
|
||||
RENDER_TARGET=$TARGET
|
||||
# shellcheck source=/dev/null
|
||||
. "$_SCRIPT_DIR/_build_env" "$TARGET"
|
||||
|
||||
if [[ $# -ge 2 ]]; then
|
||||
GLUE=$2
|
||||
elif [[ "$TARGET" = "export" ]]; then
|
||||
GLUE="$_SCRIPT_DIR/$EXPORT_DEST/$BUILD_NAME.js"
|
||||
else
|
||||
GLUE="$_SCRIPT_DIR/$FRONTEND_DEST/$BUILD_NAME.js"
|
||||
fi
|
||||
|
||||
if [[ ! -f "$GLUE" ]]; then
|
||||
echo "error: JS glue not found: $GLUE" >&2
|
||||
echo "hint: run ./build $TARGET first" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
status=0
|
||||
grep -qE 'invoke_[A-Za-z0-9]+' "$GLUE" || status=$?
|
||||
|
||||
if [[ $status -eq 0 ]]; then
|
||||
echo "error: JS glue has invoke_* wrappers: $GLUE" >&2
|
||||
grep -oE 'invoke_[A-Za-z0-9]+' "$GLUE" | sort -u >&2
|
||||
exit 1
|
||||
elif [[ $status -gt 1 ]]; then
|
||||
echo "error: grep failed on $GLUE" >&2
|
||||
exit "$status"
|
||||
fi
|
||||
Loading…
x
Reference in New Issue
Block a user