Skip to content

Commit b049760

Browse files
XxdpavelxXclaude
andcommitted
fix(ci): remove ios/Pods from nscloud cache, clear before pod install
Root cause of repeated Namespace build failures: nscloud-cache-action mounts each cache path as a volume at /Volumes/cache/<path>. When ios/Pods is included, CocoaPods generates xcconfig and Hermes build scripts with relative paths like ../../node_modules/ from ios/Pods/. These paths resolve correctly only when ios/Pods and node_modules sit on the same filesystem. With ios/Pods at /Volumes/cache/ios/Pods/ and node_modules in the workspace, the Hermes script fails with: /Volumes/cache/ios/Pods/../../node_modules/.../with-environment.sh: No such file or directory Fix: - Drop ios/Pods from nscloud-cache-action paths (keep ~/.cocoapods only, which is filesystem-safe — pod install reads downloads from there and writes Pods into the workspace path). - Move the cleanup step before Setup project dependencies so pod install regenerates ios/Pods with workspace-relative paths. - Also clear ios/Pods alongside DerivedData and ios/build, since the Namespace profile's 70GB User Bundled Cache persists workspace state (including stale Pods generated when ios/Pods was on /Volumes/cache). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 43b2f1f commit b049760

1 file changed

Lines changed: 23 additions & 12 deletions

File tree

.github/workflows/build-ios-e2e.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,35 @@ jobs:
125125
ios/build
126126
key: ${{ runner.os }}-xcode-main-${{ env.XCODE_CACHE_VERSION }}-${{ hashFiles('ios/**/*.{h,m,mm,swift}', 'ios/**/Podfile.lock', 'yarn.lock') }}
127127

128+
# Cache only the CocoaPods download/spec cache (~/.cocoapods), NOT ios/Pods.
129+
# nscloud-cache-action mounts each path as a volume at /Volumes/cache/<path>, which would put
130+
# ios/Pods on a different filesystem than node_modules. CocoaPods generates xcconfig and build
131+
# scripts with relative paths like ../../node_modules/ from ios/Pods/, which break across
132+
# filesystems (resolves to /Volumes/node_modules/, which doesn't exist) and cause the
133+
# hermes-engine build script to fail with "No such file or directory".
128134
- name: Configure Namespace iOS cache
129135
if: ${{ inputs.runner_provider == 'namespace' }}
130136
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0 # v1
131137
with:
132138
path: |
133139
~/.cocoapods
134-
ios/Pods
140+
141+
# Namespace runner profiles persist DerivedData, ios/build, and ios/Pods at the infrastructure
142+
# level between runs (the 70GB User Bundled Cache reported in the runner setup logs). Without
143+
# clearing all three on Namespace:
144+
# - DerivedData: Xcode reports "nothing to rebuild" in ~22s and produces no output in ios/build
145+
# - ios/build: stale Intermediates.noindex/ scripts reference /Volumes/cache/ios/Pods/ (the
146+
# nscloud volume mount path from a prior run), causing "No such file or directory" failures
147+
# - ios/Pods: stale Pods generated when ios/Pods was mounted at /Volumes/cache/ios/Pods/ contain
148+
# xcconfig files with cross-filesystem relative paths to node_modules that break this build
149+
# Must run BEFORE Setup project dependencies (which runs pod install) so pod install regenerates
150+
# ios/Pods with correct workspace-relative paths.
151+
- name: Clear stale Xcode and CocoaPods artifacts for clean Namespace build
152+
if: ${{ inputs.runner_provider == 'namespace' }}
153+
run: |
154+
rm -rf ~/Library/Developer/Xcode/DerivedData
155+
rm -rf ios/build
156+
rm -rf ios/Pods
135157
136158
- name: Restore .metamask folder (Foundry download cache for install:foundryup)
137159
uses: actions/cache@v4
@@ -204,17 +226,6 @@ jobs:
204226
ios/build/Build/Products/Release-iphonesimulator/MetaMask.app
205227
key: ios-app-main-v${{ env.IOS_APP_CACHE_VERSION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}
206228

207-
# Namespace runner profiles persist ~/Library/Developer/Xcode/DerivedData and ios/build at the
208-
# infrastructure level between runs (independent of nscloud-cache-action). Without clearing:
209-
# - DerivedData: Xcode reports "nothing to rebuild" in ~22s and produces no output in ios/build
210-
# - ios/build: stale intermediate scripts reference /Volumes/cache/ios/Pods/ (the nscloud volume
211-
# mount path from a prior run), causing "No such file or directory" build failures
212-
- name: Clear Xcode build artifacts for clean Namespace build
213-
if: ${{ inputs.runner_provider == 'namespace' }}
214-
run: |
215-
rm -rf ~/Library/Developer/Xcode/DerivedData
216-
rm -rf ios/build
217-
218229
# Build the iOS E2E app for simulator
219230
- name: Build iOS E2E App
220231
if: ${{ steps.cache-restore.outputs.cache-hit != 'true' && steps.cache-restore-main.outputs.cache-hit != 'true' }}

0 commit comments

Comments
 (0)