每轮只推进合理适量的上下文、禁止顺手扩功能 smoke:源码链接构建约束

This commit is contained in:
cnc
2026-06-01 19:54:04 +08:00
parent 6f9431a389
commit 5ec10abf38
41 changed files with 3301 additions and 670 deletions

View File

@@ -5,33 +5,18 @@ cd "$(dirname "$0")"
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
manifest=${1:-linuxcnc-rs274-wasm-source-files.txt}
cxx=${CXX:-g++}
build_dir=$(mktemp -d "${TMPDIR:-/tmp}/cnc_sim_linuxcnc_wasm_safe_probe.XXXXXX")
trap 'rm -rf "$build_dir"' EXIT
LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs.sh "$manifest"
preflight_cache_dir=${CNC_SIM_PREFLIGHT_CACHE_DIR:-build/wasm-probe-preflight-cache}
shim_output=$(./list-linuxcnc-wasm-safe-shims.sh)
mapfile -t shim_sources <<<"$shim_output"
common_flag_output=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-common-cxxflags.sh --profile core20)
mapfile -t common_flags <<<"$common_flag_output"
object_output=$(CNC_SIM_PREFLIGHT_CACHE_DIR="$preflight_cache_dir" LINUXCNC_ROOT="$linuxcnc_root" ./build-linuxcnc-wasm-probe-objects.sh --mode source-objects "$manifest")
mapfile -t objects <<<"$object_output"
if [[ "${#objects[@]}" -lt "${#shim_sources[@]}" ]]; then
echo "unexpected wasm-safe object cache count: got ${#objects[@]} fewer than ${#shim_sources[@]} shims" >&2
exit 1
fi
linuxcnc_object_count=$((${#objects[@]} - ${#shim_sources[@]}))
source_output=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core full)
mapfile -t sources <<<"$source_output"
shim_index=0
for source in "${shim_sources[@]}"; do
obj="$build_dir/shim_${shim_index}.o"
"$cxx" "${common_flags[@]}" -c "$source" -o "$obj"
shim_index=$((shim_index + 1))
done
source_index=0
for source in "${sources[@]}"; do
obj="$build_dir/linuxcnc_${source_index}.o"
"$cxx" "${common_flags[@]}" -c "$source" -o "$obj"
source_index=$((source_index + 1))
done
echo "linuxcnc wasm-safe source object probe passed (${#sources[@]} linuxcnc objects + ${#shim_sources[@]} shims)"
echo "linuxcnc wasm-safe source object probe passed ($linuxcnc_object_count linuxcnc objects + ${#shim_sources[@]} shims)"