接入 WASM blocker 自检

结论:native/source-link 必跑入口已执行 blocker 分析器负路径自检,防止坏 manifest、缺失源根、重复条目和缺失替换映射退化。
This commit is contained in:
cnc
2026-06-05 23:26:02 +08:00
parent e928b32e69
commit 6bd1c6a429
4 changed files with 15 additions and 0 deletions

View File

@@ -180,4 +180,11 @@ for entry in [
text = Path(entry).read_text(encoding="utf-8")
if "./check-linuxcnc-wasm-blockers-source-map.sh" not in text:
raise SystemExit(f"{entry} must run ./check-linuxcnc-wasm-blockers-source-map.sh")
for entry in [
"test-native.sh",
"test-linuxcnc-source-link.sh",
]:
text = Path(entry).read_text(encoding="utf-8")
if "CNC_SIM_WASM_BLOCKERS_SELF_CHECKS=1" not in text:
raise SystemExit(f"{entry} must run wasm blocker analyzer self-checks")
PY

View File

@@ -74,6 +74,10 @@ Required tracked core examples:
- `test-native.sh`, `test-linuxcnc-source-link.sh`, and `build-wasm.sh` must
run `./check-linuxcnc-wasm-blockers-source-map.sh` before consuming blocker
analyzer output, source-linked LinuxCNC objects, or browser artifacts.
- `test-native.sh` and `test-linuxcnc-source-link.sh` must run
`test-linuxcnc-wasm-blockers.sh` with `CNC_SIM_WASM_BLOCKERS_SELF_CHECKS=1`
so bad manifests, missing LinuxCNC roots, duplicate entries, and missing
blocked-source replacements stay executable failures.
- The WASM blockers source-map guard validates LinuxCNC source/blocker
ownership and manifest drift only; it does not interpret G-code.

View File

@@ -47,6 +47,8 @@ LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh --cache-dir "$p
./check-linuxcnc-tooldata-source-map.sh
./check-linuxcnc-wasm-shims-source-map.sh
./check-linuxcnc-wasm-blockers-source-map.sh
CNC_SIM_PREFLIGHT_CACHE_DIR="$preflight_cache_dir" CNC_SIM_WASM_BLOCKERS_SELF_CHECKS=1 \
./test-linuxcnc-wasm-blockers.sh linuxcnc-rs274-wasm-source-files.txt
LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-switchkins-remap-table-cached.sh --cache-dir "$preflight_cache_dir" linuxcnc-kinematics-source-files.txt
# The LinuxCNC source-linked dump path is not concurrency-safe under parallel execution.
exec 9>"${TMPDIR:-/tmp}/cnc_sim_rs274_source_link.lock"

View File

@@ -45,6 +45,8 @@ preflight_cache_dir="$build_dir/preflight-cache"
./check-linuxcnc-tooldata-source-map.sh
./check-linuxcnc-wasm-shims-source-map.sh
./check-linuxcnc-wasm-blockers-source-map.sh
CNC_SIM_PREFLIGHT_CACHE_DIR="$preflight_cache_dir" CNC_SIM_WASM_BLOCKERS_SELF_CHECKS=1 \
./test-linuxcnc-wasm-blockers.sh linuxcnc-rs274-wasm-source-files.txt
./check-linuxcnc-switchkins-remap-table-cached.sh --cache-dir "$preflight_cache_dir" linuxcnc-kinematics-source-files.txt
grep -F 'tooldata:src/emc/tooldata/tooldata_nml.cc:NML tool table backend selected by LinuxCNC TOOL_NML_FLAG' linuxcnc-rs274-source-files.txt >/dev/null
grep -F 'tooldata:src/emc/tooldata/tool_mmap_read.cc:LinuxCNC tooldata mmap reader utility source from tooldata Submakefile' linuxcnc-rs274-source-files.txt >/dev/null