-
Notifications
You must be signed in to change notification settings - Fork 24.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear cache to resolve iOS, tvOS workflow
Summary: tvOS and iOS workflows were flaky, apparently due to a stale cache that contained a problematic version of the Metro dependency. Thanks to motiz88 for identifying the potential cause of flakiness in react-native-community/releases#2 (comment). https://circleci.com/workflow-run/440180a2-e888-4f27-bec9-b8e5d9be6708 [GENERAL] [MINOR] [CI] - Resolve iOS, tvOS failures in Circle Closes #18304 Differential Revision: D7220150 Pulled By: hramos fbshipit-source-id: 0f5e68c779dfce44e6deb8b813a3ac9e25a2ab97
- Loading branch information
1 parent
3e9a371
commit c9d7562
Showing
2 changed files
with
53 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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 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,26 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Make sure we don't accidentally restore a cache that contains the Metro | ||
# filename issue that was fixed in Metro 0.25, originally introduced in | ||
# D6752278. Once fixed, this was causing sporadic failures in the iOS | ||
# and tvOS workflows as the issue persisted in the cached node_modules | ||
# | ||
# The filename issue can be summarized as follows: | ||
# A version of Metro was published to npm with HmrClient.js and | ||
# HmrClient.js.flow files, while the repo contains HMRClient.js and | ||
# HMRClient.js.flow. This was due to a case issue in the publisher's | ||
# host machine. | ||
# The issue this is checking for is manifested by the presence of all | ||
# of the following files: HmrClient.js, HMRClient.js, HmrClient.js.flow, | ||
# HMRClient.js.flow. | ||
|
||
EXPECTED='1' | ||
ACTUAL=$(ls node_modules/metro/src/lib/bundle-modules/*.js | xargs | awk '{print tolower($0)}' | tr ' ' '\n' | grep hmrclient.js | wc -l | tr -d '[:space:]') | ||
|
||
if [ "$EXPECTED" != "$ACTUAL" ]; then | ||
echo "HmrClient.js crept into the cache?" | ||
echo $(ls node_modules/metro/src/lib/bundle-modules/H*lient.js) | ||
exit 1 | ||
fi |