From b3adfb3a5657f84251d14f7fbf6833113f432af4 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Mon, 20 Jul 2026 08:17:33 +0200 Subject: [PATCH] ci(release): pin Xcode DerivedData so it stops filling the mac runner's disk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v0.16.0's Apple leg failed at the xcframework build with "No space left on device (os error 28)": the runner's boot volume was at 100% with 152 MB free. None of the four `xcodebuild archive` calls passed -derivedDataPath, so each one used the default ~/Library/Developer/Xcode/DerivedData/- — and that hash is derived from the PROJECT'S ABSOLUTE PATH. act_runner rotates its workspace (~/.cache/act//hostexecutor), so every rotation looked like a new project to Xcode and minted a fresh ~760 MB tree. Nothing ever collects those: they live outside the workspace, so act's own cleanup never sees them. 31 had accumulated in three days (17 -> 20 July), which with the 12 GB shared ModuleCache came to 32 GB — on a 228 GB volume already 95% full. Pin all four archives to one path. The tree is now REUSED rather than multiplied, which also keeps the module cache warm instead of rebuilding it per run. The new step additionally prunes anything week-stale left in the default root, covering both the legacy per-path trees and any other job that lands there. Cleared by hand on home-mac-mini-1 to unblock the release (152 MB -> 31 GB free); this is the change that stops it coming back. Note the same class of problem bit the Windows runner the same night from the other direction — its disk-cleanup task purges C:\t and deleted files out from under ISCC mid-pack — which is worth its own look and is NOT addressed here. Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/release.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 5026c076..6dd40c6b 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -149,6 +149,26 @@ jobs: # inherits this from the env during the xcframework build). echo "CMAKE_POLICY_VERSION_MINIMUM=3.5" >> "$GITHUB_ENV" + - name: Pin + prune Xcode DerivedData + # Without -derivedDataPath, xcodebuild derives its DerivedData directory name from the + # PROJECT'S ABSOLUTE PATH — and act_runner rotates its workspace + # (~/.cache/act//hostexecutor), so each rotation minted a brand new ~760 MB tree + # under ~/Library that nothing ever collected. 31 of them piled up in three days + # (~32 GB with the shared ModuleCache), filled the runner's boot volume, and failed + # v0.16.0's xcframework build with "No space left on device". Pinning one path makes the + # tree REUSED instead of multiplied — it also keeps the module cache warm between runs. + run: | + DD="$HOME/ci/derived-data/release" + mkdir -p "$DD" + echo "DERIVED_DATA=$DD" >> "$GITHUB_ENV" + # Safety net for trees the pin does not own: the legacy per-path ones from before this + # change, and anything another job leaves in the default root. Untouched for a week ⇒ gone. + if [ -d "$HOME/Library/Developer/Xcode/DerivedData" ]; then + find "$HOME/Library/Developer/Xcode/DerivedData" -mindepth 1 -maxdepth 1 \ + -mtime +7 -exec rm -rf {} + 2>/dev/null || true + fi + echo "disk after prune:"; df -h /System/Volumes/Data | tail -1 + - name: Build PunktfunkCore.xcframework (mac + iOS + tvOS) # tvOS is a tier-3 target (nightly -Zbuild-std): slow on the first build, then cached on # the self-hosted runner. Built on canary too so the tvOS archive/upload below runs on the @@ -176,6 +196,7 @@ jobs: -project "$PROJECT" -scheme Punktfunk \ -destination 'generic/platform=macOS' \ -archivePath "$RUNNER_TEMP/Punktfunk-macos.xcarchive" \ + -derivedDataPath "$DERIVED_DATA" \ -skipMacroValidation -skipPackagePluginValidation \ MARKETING_VERSION="$VERSION" CURRENT_PROJECT_VERSION="$BUILD_NUM" \ CODE_SIGNING_ALLOWED=NO @@ -273,6 +294,7 @@ jobs: -project "$PROJECT" -scheme Punktfunk \ -destination 'generic/platform=macOS' \ -archivePath "$RUNNER_TEMP/Punktfunk-macos-appstore.xcarchive" \ + -derivedDataPath "$DERIVED_DATA" \ -skipMacroValidation -skipPackagePluginValidation \ -allowProvisioningUpdates \ -authenticationKeyPath "$RUNNER_TEMP/asc.p8" \ @@ -336,6 +358,7 @@ jobs: -project "$PROJECT" -scheme Punktfunk-iOS \ -destination 'generic/platform=iOS' \ -archivePath "$RUNNER_TEMP/Punktfunk-ios.xcarchive" \ + -derivedDataPath "$DERIVED_DATA" \ -skipMacroValidation -skipPackagePluginValidation \ -allowProvisioningUpdates \ -authenticationKeyPath "$RUNNER_TEMP/asc.p8" \ @@ -394,6 +417,7 @@ jobs: -project "$PROJECT" -scheme Punktfunk-tvOS \ -destination 'generic/platform=tvOS' \ -archivePath "$RUNNER_TEMP/Punktfunk-tvos.xcarchive" \ + -derivedDataPath "$DERIVED_DATA" \ -skipMacroValidation -skipPackagePluginValidation \ -allowProvisioningUpdates \ -authenticationKeyPath "$RUNNER_TEMP/asc.p8" \