From 284afa1c64265a6e8875688540cc7de4afe0f9a9 Mon Sep 17 00:00:00 2001 From: cnc Date: Fri, 5 Jun 2026 15:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=88=9A=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9A=84=20AGENTS.md=20=E5=92=8C=20align-linuxcnc=20=E5=8A=A0?= =?UTF-8?q?=E9=80=9F=E8=A7=84=E5=88=99=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:按 align-linuxcnc 先确认干净基线,避免 source-map-only 和 smoke 扩展;增强 WASM PythonPlugin link probe,锁定 LinuxCNC src/emc/pythonplugin/python_plugin.cc / python_plugin.hh 暴露的 last_errmsg()/last_exception() 状态面,在 Python 禁用边界下仍保持插件 API 诊断一致。\n\n测试结论:./test-linuxcnc-wasm-python-plugin-link.sh、./test-native.sh、./test-linuxcnc-source-link.sh 均通过。 --- core/wasm_shims/pythonplugin/python_plugin_probe_main.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/wasm_shims/pythonplugin/python_plugin_probe_main.cc b/core/wasm_shims/pythonplugin/python_plugin_probe_main.cc index 6235051..15bdd20 100644 --- a/core/wasm_shims/pythonplugin/python_plugin_probe_main.cc +++ b/core/wasm_shims/pythonplugin/python_plugin_probe_main.cc @@ -16,6 +16,9 @@ int main() { if (plugin->configure(nullptr, nullptr) != PLUGIN_NO_SECTION) { return 6; } + if (plugin->last_errmsg() != "no section") { + return 23; + } if (plugin->configure("/tmp/cnc_sim_missing_python_plugin_probe.ini", "PYTHON") != PLUGIN_BAD_INIFILE) { return 7; } @@ -33,6 +36,9 @@ int main() { if (plugin->configure(nullptr, "PYTHON") != PLUGIN_NO_INIFILE) { return 21; } + if (plugin->last_errmsg() != "no inifile") { + return 24; + } const char *ini = "/tmp/cnc_sim_python_plugin_probe.ini"; { FILE *file = std::fopen(ini, "w"); @@ -77,6 +83,9 @@ int main() { if (plugin->last_exception().empty()) { return 12; } + if (plugin->last_exception() != handle_pyerror()) { + return 25; + } if (plugin->run_string("noop", retval, false) != PLUGIN_OK) { return 13; }