按源标记Python绑定编译覆盖
结论:依据 LinuxCNC RS274 Python/Boost.Python 绑定源 canonmodule.cc、gcodemodule.cc、interpmodule.cc 与 py*.cc,blocker 分析新增 python-compile-covered 分组,锁定这些 blocker 已由 inert Python C API symbol probe 编译覆盖;Python/remap 执行仍保持禁用,未扩展 smoke。 检查:./test-linuxcnc-wasm-python-c-api-symbols.sh;./test-linuxcnc-wasm-blockers.sh linuxcnc-rs274-wasm-source-files.txt;CNC_SIM_WASM_BLOCKERS_SELF_CHECKS=1 ./test-linuxcnc-wasm-blockers.sh linuxcnc-rs274-wasm-source-files.txt;./check-linuxcnc-wasm-blockers-source-map.sh;./test-native.sh;./test-linuxcnc-source-link.sh。
This commit is contained in:
@@ -17,6 +17,7 @@ LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh "$manifest"
|
|||||||
linuxcnc_root=$(cd "$linuxcnc_root" && pwd)
|
linuxcnc_root=$(cd "$linuxcnc_root" && pwd)
|
||||||
|
|
||||||
python_blockers=()
|
python_blockers=()
|
||||||
|
python_compile_covered=()
|
||||||
core_python_sources=()
|
core_python_sources=()
|
||||||
dlopen_blockers=()
|
dlopen_blockers=()
|
||||||
core_dlopen_sources=()
|
core_dlopen_sources=()
|
||||||
@@ -61,6 +62,10 @@ wasm_safe_shim_in_build() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
python_compile_probe_covers() {
|
||||||
|
grep -F "$1" test-linuxcnc-wasm-python-c-api-symbols.sh >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
core_sources=()
|
core_sources=()
|
||||||
blocked_sources=()
|
blocked_sources=()
|
||||||
manifest_line_number=0
|
manifest_line_number=0
|
||||||
@@ -134,6 +139,9 @@ scan_source() {
|
|||||||
if grep -Eq 'Python\.h|boost/python|pythonplugin|PyObject|PyInit_' "$full_path"; then
|
if grep -Eq 'Python\.h|boost/python|pythonplugin|PyObject|PyInit_' "$full_path"; then
|
||||||
if [[ "$group" == "blocked" ]]; then
|
if [[ "$group" == "blocked" ]]; then
|
||||||
python_blockers+=("$path")
|
python_blockers+=("$path")
|
||||||
|
if python_compile_probe_covers "$path"; then
|
||||||
|
python_compile_covered+=("$path")
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
core_python_sources+=("$path")
|
core_python_sources+=("$path")
|
||||||
fi
|
fi
|
||||||
@@ -192,6 +200,7 @@ echo "blocked=$blocked_count"
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
print_group "python" "${python_blockers[@]}"
|
print_group "python" "${python_blockers[@]}"
|
||||||
|
print_group "python-compile-covered" "${python_compile_covered[@]}"
|
||||||
print_group "dlopen" "${dlopen_blockers[@]}"
|
print_group "dlopen" "${dlopen_blockers[@]}"
|
||||||
print_group "tooldata" "${tooldata_blockers[@]}"
|
print_group "tooldata" "${tooldata_blockers[@]}"
|
||||||
print_group "tooldata-users" "${shimmed_tooldata_users[@]}"
|
print_group "tooldata-users" "${shimmed_tooldata_users[@]}"
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ expected_counts = {
|
|||||||
"manifest-core": "core=26",
|
"manifest-core": "core=26",
|
||||||
"manifest-blocked": "blocked=9",
|
"manifest-blocked": "blocked=9",
|
||||||
"python": 8,
|
"python": 8,
|
||||||
|
"python-compile-covered": 8,
|
||||||
"tooldata": 1,
|
"tooldata": 1,
|
||||||
"native-backend": 1,
|
"native-backend": 1,
|
||||||
"native-fs": 1,
|
"native-fs": 1,
|
||||||
@@ -111,6 +112,8 @@ if sections.get("dlopen") != ["(none)"]:
|
|||||||
raise SystemExit("blocked dlopen section is no longer empty")
|
raise SystemExit("blocked dlopen section is no longer empty")
|
||||||
if sections.get("tooldata-users") != ["(none)"]:
|
if sections.get("tooldata-users") != ["(none)"]:
|
||||||
raise SystemExit("blocked tooldata-users section is no longer empty")
|
raise SystemExit("blocked tooldata-users section is no longer empty")
|
||||||
|
if sections.get("python") != sections.get("python-compile-covered"):
|
||||||
|
raise SystemExit("blocked Python sources are no longer fully compile-covered by the inert Python C API probe")
|
||||||
|
|
||||||
shim_paths = set(Path(line).as_posix() for line in subprocess.check_output(
|
shim_paths = set(Path(line).as_posix() for line in subprocess.check_output(
|
||||||
["./list-linuxcnc-wasm-safe-shims.sh"],
|
["./list-linuxcnc-wasm-safe-shims.sh"],
|
||||||
@@ -166,6 +169,7 @@ for phrase in [
|
|||||||
'parameter-file replacement through `filename + ".new"`',
|
'parameter-file replacement through `filename + ".new"`',
|
||||||
"O-word lookup and parameter-file replacement",
|
"O-word lookup and parameter-file replacement",
|
||||||
"Python/Boost.Python remap paths remain tracked blockers",
|
"Python/Boost.Python remap paths remain tracked blockers",
|
||||||
|
"Python/Boost.Python blockers are compile-covered by the inert Python C API probe",
|
||||||
"./check-linuxcnc-wasm-blockers-source-map.sh",
|
"./check-linuxcnc-wasm-blockers-source-map.sh",
|
||||||
"does not interpret G-code",
|
"does not interpret G-code",
|
||||||
]:
|
]:
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ a source-link/build guard only; it does not add CNC behavior and must not become
|
|||||||
|
|
||||||
- `src/emc/rs274ngc/gcodemodule.cc`, `canonmodule.cc`, `interpmodule.cc`, and
|
- `src/emc/rs274ngc/gcodemodule.cc`, `canonmodule.cc`, `interpmodule.cc`, and
|
||||||
`py*.cc` provide the Python and Boost.Python module binding blockers.
|
`py*.cc` provide the Python and Boost.Python module binding blockers.
|
||||||
|
- `test-linuxcnc-wasm-python-c-api-symbols.sh` compiles the blocked
|
||||||
|
Python/Boost.Python binding sources with inert Python/runtime shims so their
|
||||||
|
source surface is covered without enabling Python execution.
|
||||||
- `src/emc/rs274ngc/interp_python.cc`, `interp_remap.cc`,
|
- `src/emc/rs274ngc/interp_python.cc`, `interp_remap.cc`,
|
||||||
`interp_namedparams.cc`, `interp_o_word.cc`, `interp_setup.cc`, and
|
`interp_namedparams.cc`, `interp_o_word.cc`, `interp_setup.cc`, and
|
||||||
`rs274ngc_pre.cc` keep Python/Boost.Python remap paths as shimmed core
|
`rs274ngc_pre.cc` keep Python/Boost.Python remap paths as shimmed core
|
||||||
@@ -35,6 +38,7 @@ a source-link/build guard only; it does not add CNC behavior and must not become
|
|||||||
| Analyzer section | Count | Boundary |
|
| Analyzer section | Count | Boundary |
|
||||||
| --- | ---: | --- |
|
| --- | ---: | --- |
|
||||||
| `python` | 8 | Blocked Python/Boost.Python module sources. |
|
| `python` | 8 | Blocked Python/Boost.Python module sources. |
|
||||||
|
| `python-compile-covered` | 8 | Blocked Python/Boost.Python module sources compiled by the inert Python C API symbol probe while remaining blockers. |
|
||||||
| `dlopen` | 0 | blocked `dlopen` and blocked tooldata-users remain empty. |
|
| `dlopen` | 0 | blocked `dlopen` and blocked tooldata-users remain empty. |
|
||||||
| `tooldata` | 1 | Native tooldata mmap blocker. |
|
| `tooldata` | 1 | Native tooldata mmap blocker. |
|
||||||
| `tooldata-users` | 0 | Blocked tooldata user sources remain empty. |
|
| `tooldata-users` | 0 | Blocked tooldata user sources remain empty. |
|
||||||
@@ -80,6 +84,9 @@ Required tracked core examples:
|
|||||||
blocked-source replacements stay executable failures.
|
blocked-source replacements stay executable failures.
|
||||||
- The WASM blockers source-map guard validates LinuxCNC source/blocker
|
- The WASM blockers source-map guard validates LinuxCNC source/blocker
|
||||||
ownership and manifest drift only; it does not interpret G-code.
|
ownership and manifest drift only; it does not interpret G-code.
|
||||||
|
- Python/Boost.Python blockers are compile-covered by the inert Python C API probe,
|
||||||
|
but they remain tracked blockers until Python/remap execution is ported,
|
||||||
|
wrapped, or replaced by a source-backed browser-safe LinuxCNC adaptation.
|
||||||
|
|
||||||
## Checks
|
## Checks
|
||||||
|
|
||||||
|
|||||||
@@ -195,6 +195,14 @@ grep -F "src/emc/rs274ngc/gcodemodule.cc" <<<"$(sed -n '/^\[python\]/,/^$/p' <<<
|
|||||||
grep -F "src/emc/rs274ngc/interpmodule.cc" <<<"$(sed -n '/^\[python\]/,/^$/p' <<<"$output")" >/dev/null
|
grep -F "src/emc/rs274ngc/interpmodule.cc" <<<"$(sed -n '/^\[python\]/,/^$/p' <<<"$output")" >/dev/null
|
||||||
grep -F "src/emc/rs274ngc/pyarrays.cc" <<<"$(sed -n '/^\[python\]/,/^$/p' <<<"$output")" >/dev/null
|
grep -F "src/emc/rs274ngc/pyarrays.cc" <<<"$(sed -n '/^\[python\]/,/^$/p' <<<"$output")" >/dev/null
|
||||||
grep -F "src/emc/rs274ngc/pyparamclass.cc" <<<"$(sed -n '/^\[python\]/,/^$/p' <<<"$output")" >/dev/null
|
grep -F "src/emc/rs274ngc/pyparamclass.cc" <<<"$(sed -n '/^\[python\]/,/^$/p' <<<"$output")" >/dev/null
|
||||||
|
grep -F "[python-compile-covered]" <<<"$output" >/dev/null
|
||||||
|
grep -F "src/emc/rs274ngc/canonmodule.cc" <<<"$(sed -n '/^\[python-compile-covered\]/,/^$/p' <<<"$output")" >/dev/null
|
||||||
|
grep -F "src/emc/rs274ngc/gcodemodule.cc" <<<"$(sed -n '/^\[python-compile-covered\]/,/^$/p' <<<"$output")" >/dev/null
|
||||||
|
grep -F "src/emc/rs274ngc/interpmodule.cc" <<<"$(sed -n '/^\[python-compile-covered\]/,/^$/p' <<<"$output")" >/dev/null
|
||||||
|
grep -F "src/emc/rs274ngc/pyarrays.cc" <<<"$(sed -n '/^\[python-compile-covered\]/,/^$/p' <<<"$output")" >/dev/null
|
||||||
|
grep -F "src/emc/rs274ngc/pyparamclass.cc" <<<"$(sed -n '/^\[python-compile-covered\]/,/^$/p' <<<"$output")" >/dev/null
|
||||||
|
grep -F 'python_compile_probe_covers "$path"' analyze-linuxcnc-wasm-blockers.sh >/dev/null
|
||||||
|
grep -F 'test-linuxcnc-wasm-python-c-api-symbols.sh' analyze-linuxcnc-wasm-blockers.sh >/dev/null
|
||||||
grep -F "[dlopen]" <<<"$output" >/dev/null
|
grep -F "[dlopen]" <<<"$output" >/dev/null
|
||||||
grep -F "(none)" <<<"$(sed -n '/^\[dlopen\]/,/^$/p' <<<"$output")" >/dev/null
|
grep -F "(none)" <<<"$(sed -n '/^\[dlopen\]/,/^$/p' <<<"$output")" >/dev/null
|
||||||
grep -F "[tooldata]" <<<"$output" >/dev/null
|
grep -F "[tooldata]" <<<"$output" >/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user