From e0316cf3e391620be201c8f9601ea292394a3238 Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 29 Apr 2026 01:06:41 +0800 Subject: [PATCH] Avoid network updates in interface generation --- AG/generate_swiftinterface.sh | 12 ++++++++++-- GF/generate_swiftinterface.sh | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/AG/generate_swiftinterface.sh b/AG/generate_swiftinterface.sh index d916b33..2f8d465 100755 --- a/AG/generate_swiftinterface.sh +++ b/AG/generate_swiftinterface.sh @@ -53,14 +53,22 @@ fi # scratch path for this nested build so update-xcframeworks does not deadlock. SWIFTPM_BUILD_LOG=$(mktemp) mkdir -p "${SWIFTPM_CACHE_PATH}" -if ! swift build --disable-sandbox --package-path "${PACKAGE_DIR}" --cache-path "${SWIFTPM_CACHE_PATH}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --target _AttributeGraphDeviceSwiftShims 2>"${SWIFTPM_BUILD_LOG}"; then +SWIFTPM_BUILD_FLAGS=( + --disable-sandbox + --package-path "${PACKAGE_DIR}" + --cache-path "${SWIFTPM_CACHE_PATH}" + --scratch-path "${SWIFTPM_SCRATCH_PATH}" + --skip-update + --disable-automatic-resolution +) +if ! swift build "${SWIFTPM_BUILD_FLAGS[@]}" --target _AttributeGraphDeviceSwiftShims 2>"${SWIFTPM_BUILD_LOG}"; then cat "${SWIFTPM_BUILD_LOG}" >&2 echo "Error: failed to build package dependencies" exit 1 fi # Locate the SPM modules directory for import search paths -if ! BUILD_BIN_PATH=$(swift build --disable-sandbox --package-path "${PACKAGE_DIR}" --cache-path "${SWIFTPM_CACHE_PATH}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --show-bin-path 2>"${SWIFTPM_BUILD_LOG}"); then +if ! BUILD_BIN_PATH=$(swift build "${SWIFTPM_BUILD_FLAGS[@]}" --show-bin-path 2>"${SWIFTPM_BUILD_LOG}"); then cat "${SWIFTPM_BUILD_LOG}" >&2 echo "Error: failed to locate package build directory" exit 1 diff --git a/GF/generate_swiftinterface.sh b/GF/generate_swiftinterface.sh index 77ead4a..ed2476d 100755 --- a/GF/generate_swiftinterface.sh +++ b/GF/generate_swiftinterface.sh @@ -53,14 +53,22 @@ fi # scratch path for this nested build so update-xcframeworks does not deadlock. SWIFTPM_BUILD_LOG=$(mktemp) mkdir -p "${SWIFTPM_CACHE_PATH}" -if ! swift build --disable-sandbox --package-path "${PACKAGE_DIR}" --cache-path "${SWIFTPM_CACHE_PATH}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --target _GesturesDeviceSwiftShims 2>"${SWIFTPM_BUILD_LOG}"; then +SWIFTPM_BUILD_FLAGS=( + --disable-sandbox + --package-path "${PACKAGE_DIR}" + --cache-path "${SWIFTPM_CACHE_PATH}" + --scratch-path "${SWIFTPM_SCRATCH_PATH}" + --skip-update + --disable-automatic-resolution +) +if ! swift build "${SWIFTPM_BUILD_FLAGS[@]}" --target _GesturesDeviceSwiftShims 2>"${SWIFTPM_BUILD_LOG}"; then cat "${SWIFTPM_BUILD_LOG}" >&2 echo "Error: failed to build package dependencies" exit 1 fi # Locate the SPM modules directory for import search paths -if ! BUILD_BIN_PATH=$(swift build --disable-sandbox --package-path "${PACKAGE_DIR}" --cache-path "${SWIFTPM_CACHE_PATH}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --show-bin-path 2>"${SWIFTPM_BUILD_LOG}"); then +if ! BUILD_BIN_PATH=$(swift build "${SWIFTPM_BUILD_FLAGS[@]}" --show-bin-path 2>"${SWIFTPM_BUILD_LOG}"); then cat "${SWIFTPM_BUILD_LOG}" >&2 echo "Error: failed to locate package build directory" exit 1