Files
wasm-simulator/docs/linuxcnc-build-source-map.md
cnc ba2d576f8b 参考所有分组,完成尽量多的内容:收紧构建入口 source-map 守卫
结论:未扩展 smoke 功能行为,仅把 build-policy guard 扩展为同时校验 test-native.sh、test-linuxcnc-source-link.sh、build-wasm.sh 运行同一组 source-map guards。

LinuxCNC 来源依据:src/emc/rs274ngc/Submakefile、src/emc/tooldata/Submakefile、src/emc/ini/Submakefile、src/emc/pythonplugin/Submakefile、src/emc/kinematics/Submakefile 与 kinematics.h 的构建/源码链接边界。

检查通过:./check-linuxcnc-build-source-map.sh;./check-linuxcnc-workstreams-source-map.sh;./test-native.sh;./test-linuxcnc-source-link.sh。
2026-06-05 06:12:59 +08:00

66 lines
3.1 KiB
Markdown

# LinuxCNC build source map
This map records the source basis and boundaries for native, source-link, and
WASM build entry points. It is a build-policy guard only; it must not add CNC
behavior and must not expand the temporary smoke parser.
## LinuxCNC Source Basis
- `src/emc/rs274ngc/Submakefile` defines `LIBRS274SRCS`, including
`rs274ngc_pre.cc`, and links RS274 against LinuxCNC INI, HAL, Python plugin,
and tooldata libraries.
- `src/emc/tooldata/Submakefile` defines the LinuxCNC tooldata common, mmap,
NML, database, reader, and watcher sources tracked by native and WASM
manifests.
- `src/emc/ini/Submakefile` defines `liblinuxcncini` and exported INI headers
used by source-linked and WASM-safe probes.
- `src/emc/pythonplugin/Submakefile` defines `libpyplugin`, which remains a
source-tracked Python/remap dependency for source-link and WASM blocker
coverage.
- `src/emc/kinematics/Submakefile` and `src/emc/kinematics/kinematics.h`
define the kinematics source/header surface consumed by switchkins and RTCP
build coverage.
## Build Coverage
| Entry | Boundary |
| --- | --- |
| `test-native.sh` | Runs source-map guards, cached manifest checks, native bridge/API/RS274 probes, and Node/browser smoke after LinuxCNC source-backed native coverage. |
| `test-linuxcnc-source-link.sh` | Compiles manifest-selected LinuxCNC RS274 objects directly with source-link support objects and project dump bridges. |
| `test-linuxcnc-source-syntax.sh` | Keeps native source syntax validation on persistent dependency-tracked stamps. |
| `test-linuxcnc-wasm-cmake-safe-probe.sh` | Configures source-backed WASM-safe probe targets with persistent CMake signatures. |
| `build-wasm.sh` | Runs source-map guards, blocker, syntax, object, CMake, tooldata, interp, Python, `rs274ngc_pre`, and runtime probes before copying browser artifacts. |
## Boundaries
- Default WASM manifest partition must remain 26 wasm-safe `core` sources and
9 `blocked` sources.
- Build paths must keep `CNC_SIM_BUILD_JOBS` as scheduling only. Persistent
object/configure signatures must not include it.
- Hot object probes must use explicit `BUILD_RULE_VERSION` or
`CONFIGURE_RULE_VERSION` fields instead of hashing whole scripts.
- `build-wasm.sh` must configure with `CNC_SIM_ENABLE_SMOKE_BACKEND=OFF` and
`CNC_SIM_ENABLE_LINUXCNC_WASM_SAFE_PROBE=ON`.
- `test-native.sh`, `test-linuxcnc-source-link.sh`, and `build-wasm.sh` must
run the same source-map guards before consuming generated config aliases,
source-linked LinuxCNC objects, or browser artifacts.
- `build-wasm.sh` must build `cnc_sim_wasm_runtime_probe` before
`cnc_sim_wasm`, copy `cnc_sim.js` and `cnc_sim.wasm` exactly once, compare
copied artifacts with `cmp -s`, and run Node smoke before browser smoke.
- Build directory overrides must be non-empty, whitespace-free, and outside the
filesystem root.
## Checks
Run:
```bash
./check-linuxcnc-build-source-map.sh
./test-native.sh
./test-linuxcnc-source-link.sh
```
`check-linuxcnc-build-source-map.sh` keeps this document, LinuxCNC build-source
anchors, manifest partition assumptions, build script ordering, and
source-backed build-policy boundaries synchronized.