Harden LinuxCNC wasm and native probe workflows

This commit is contained in:
cnc
2026-05-26 17:00:58 +08:00
parent 86734622d7
commit ce2f3f3769
98 changed files with 7384 additions and 877 deletions

View File

@@ -5,11 +5,21 @@ cd "$(dirname "$0")"
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
cxx=${CXX:-g++}
build_dir=${TMPDIR:-/tmp}/cnc_sim_rs274_objects
build_dir=$(mktemp -d "${TMPDIR:-/tmp}/cnc_sim_rs274_objects.XXXXXX")
python_includes=$(python3.13-config --includes 2>/dev/null || python3-config --includes)
manifest=${1:-linuxcnc-rs274-source-files.txt}
rm -rf "$build_dir"
mkdir -p "$build_dir"
if [[ ! -f "$manifest" ]]; then
echo "missing manifest: $manifest" >&2
exit 1
fi
if [[ ! -d "$linuxcnc_root" ]]; then
echo "missing LinuxCNC root: $linuxcnc_root" >&2
exit 1
fi
trap 'rm -rf "$build_dir"' EXIT
common_flags=(
-std=c++17
@@ -27,6 +37,10 @@ sources=()
while IFS=: read -r group path note; do
case "$group" in
core)
if [[ ! -f "$linuxcnc_root/$path" ]]; then
echo "missing manifest file: $path" >&2
exit 1
fi
sources+=("$path")
;;
""|\#*|binding|tooldata)
@@ -36,14 +50,15 @@ while IFS=: read -r group path note; do
exit 1
;;
esac
done < linuxcnc-rs274-source-files.txt
done < "$manifest"
source_index=0
for source in "${sources[@]}"; do
obj="$build_dir/$(basename "$source" .cc).o"
obj="$build_dir/linuxcnc_${source_index}.o"
# shellcheck disable=SC2086
"$cxx" "${common_flags[@]}" $python_includes -c "$linuxcnc_root/$source" -o "$obj"
source_index=$((source_index + 1))
done
echo "linuxcnc rs274 source object build passed (${#sources[@]} objects)"
echo "built objects in $build_dir"