每轮只推进合理适量的上下文、禁止顺手扩功能 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

@@ -13,6 +13,11 @@ if ! [[ "$build_jobs" =~ ^[1-9][0-9]*$ ]]; then
echo "CNC_SIM_BUILD_JOBS must be a positive integer: $build_jobs" >&2
exit 1
fi
self_checks=${CNC_SIM_SOURCE_SYNTAX_SELF_CHECKS:-0}
if [[ "$self_checks" != "0" && "$self_checks" != "1" ]]; then
echo "CNC_SIM_SOURCE_SYNTAX_SELF_CHECKS must be 0 or 1: $self_checks" >&2
exit 1
fi
build_dir=${CNC_SIM_SOURCE_SYNTAX_BUILD_DIR-build/source-syntax-test}
if [[ -z "$build_dir" ]]; then
echo "CNC_SIM_SOURCE_SYNTAX_BUILD_DIR must not be empty" >&2
@@ -31,8 +36,9 @@ fi
exec 9>"$build_dir/source-syntax.lock"
flock 9
manifest=${1:-linuxcnc-rs274-source-files.txt}
preflight_cache_dir="$build_dir/preflight-cache"
LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs.sh "$manifest"
LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs-cached.sh --cache-dir "$preflight_cache_dir" "$manifest"
missing_source_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_rs274_manifest_source.XXXXXX.txt")
missing_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_rs274_manifest_source.XXXXXX.log")
@@ -46,9 +52,11 @@ if awk '/^rm -f "\$missing_source_manifest" "\$missing_source_log"$/{ found = 1
echo "linuxcnc source syntax probe still relies on manual cleanup for missing-source temporaries" >&2
exit 1
fi
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-manifest-sources.sh "$manifest" core full > "$source_list"
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-manifest-sources.sh "$manifest" binding full >> "$source_list"
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-manifest-sources.sh "$manifest" tooldata full >> "$source_list"
CNC_SIM_PREFLIGHT_CACHE_DIR="$preflight_cache_dir" LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-manifest-sources.sh "$manifest" core full > "$source_list"
CNC_SIM_PREFLIGHT_CACHE_DIR="$preflight_cache_dir" LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-manifest-sources.sh "$manifest" binding full >> "$source_list"
CNC_SIM_PREFLIGHT_CACHE_DIR="$preflight_cache_dir" LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-manifest-sources.sh "$manifest" tooldata full >> "$source_list"
if [[ "$self_checks" == "1" ]]; then
printf 'core:src/emc/rs274ngc/does_not_exist.cc:test missing source\n' >"$missing_source_manifest"
if ./test-linuxcnc-source-objects.sh "$missing_source_manifest" >"$missing_source_log" 2>&1; then
@@ -70,6 +78,8 @@ if ! grep -F "missing manifest source: src/emc/rs274ngc/does_not_exist.cc" "$mis
exit 1
fi
fi
common_flag_output=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-common-cxxflags.sh --python --syntax-only)
mapfile -t common_flags <<<"$common_flag_output"
@@ -80,7 +90,7 @@ source_syntax_next_signature="$build_dir/source-syntax.signature.next"
printf 'PWD=%s\n' "$PWD"
printf 'LINUXCNC_ROOT=%s\n' "$(cd "$linuxcnc_root" && pwd)"
printf 'MANIFEST=%s\n' "$(cd "$(dirname "$manifest")" && pwd)/$(basename "$manifest")"
printf 'BUILD_JOBS=%s\n' "$build_jobs"
printf 'BUILD_RULE_VERSION=1\n'
printf 'COMMON_FLAGS='
printf ' %s' "${common_flags[@]}"
printf '\n'