-
Notifications
You must be signed in to change notification settings - Fork 4k
[No QA] Fix stale artifacts cache on iOS #99185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
roryabraham
merged 4 commits into
Expensify:main
from
software-mansion-labs:fix-stale-artifacts-cache-on-ios
Sep 4, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a358b3e
Fix stale artifacts cache on iOS
mateuuszzzzz 4501cda
Update comments
mateuuszzzzz 6dbcbe6
Align sync-prebuilt-rncore.sh with our shell script conventions
mateuuszzzzz a3cb639
Stop the prebuilt React Core sync from failing silently
mateuuszzzzz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #!/bin/bash | ||
| # Prelude of react-native's '[RNCore] Replace ...' build phase (prepended by | ||
| # PatchedIOSArtifacts.add_sync_prebuilt_script_phase). When the extracted prebuilt React Core | ||
| # is a different patched artifact version than the tarballs in Pods, invalidates the | ||
| # .last_build_configuration marker so replace-rncore-version.js, running right after this, | ||
| # re-extracts from the tarballs. Needed because our tarball path carries no patches version, | ||
| # so a version change is invisible to CocoaPods and it can keep a stale extraction. | ||
| # | ||
| # Expected Xcode environment variables: | ||
| # PODS_ROOT | ||
| set -euo pipefail | ||
|
|
||
| TARBALLS_STAMP="$PODS_ROOT/ReactNativeCore-artifacts/.artifacts-version" | ||
| PREBUILT_DIR="$PODS_ROOT/React-Core-prebuilt" | ||
| readonly TARBALLS_STAMP PREBUILT_DIR | ||
|
|
||
| # No stamp: the last install built react-native from source — nothing to sync. | ||
| [ -f "$TARBALLS_STAMP" ] || exit 0 | ||
|
|
||
| TARBALLS=$(cat "$TARBALLS_STAMP") | ||
| EXTRACTED=$(cat "$PREBUILT_DIR/.patched-version" 2>/dev/null || true) | ||
| # Fast path, taken on every build: what is extracted matches the tarballs. | ||
| [ "$TARBALLS" = "$EXTRACTED" ] && exit 0 | ||
|
|
||
| echo "[PatchedArtifacts] Extracted prebuilt React Core is '${EXTRACTED:-<none>}', tarballs are '$TARBALLS' — marking for re-extraction." | ||
| mkdir -p "$PREBUILT_DIR" | ||
| # 'stale' matches no configuration, so replace-rncore-version.js re-extracts; it stays until | ||
| # an extraction succeeds and writes a real configuration back, so a failed build retries. | ||
| # No trailing newlines: replace-rncore-version.js compares its marker verbatim. | ||
| printf 'stale' > "$PREBUILT_DIR/.last_build_configuration" | ||
| printf '%s' "$TARBALLS" > "$PREBUILT_DIR/.patched-version" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.