Skip to content

Commit b546b07

Browse files
chrisbobbegnprice
authored andcommitted
deps: Use patch-package to fix Xcode build failure in react-native
This gets the effect of facebook/react-native@52d8a797e but without having to upgrade to RN v0.69. I believe this is the first time we've used patch-package. It's a band-aid, but at least I think an effective one, while we focus our time on the Flutter project.
1 parent 36a262d commit b546b07

File tree

4 files changed

+68
-3
lines changed

4 files changed

+68
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
"metro-babel-register": "^0.67.0",
126126
"metro-minify-terser": "^0.67.0",
127127
"metro-react-native-babel-preset": "^0.67.0",
128+
"patch-package": "^6.5.1",
128129
"prettier": "^2.6.2",
129130
"prettier-eslint": "^15.0.0",
130131
"prettier-eslint-cli": "^6.0.1",

patches/react-native+0.68.5.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp b/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp
2+
index 9986279..20389d4 100644
3+
--- a/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp
4+
+++ b/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp
5+
@@ -2229,7 +2229,7 @@ static float YGDistributeFreeSpaceSecondPass(
6+
depth,
7+
generationCount);
8+
node->setLayoutHadOverflow(
9+
- node->getLayout().hadOverflow() |
10+
+ node->getLayout().hadOverflow() ||
11+
currentRelativeChild->getLayout().hadOverflow());
12+
}
13+
return deltaFreeSpace;

tools/postinstall

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ set -eu
33

44
ROOT_DIR=$(git rev-parse --show-toplevel)
55

6+
patch_package() {
7+
node_modules/.bin/patch-package
8+
}
9+
610
pod_install() {
711
[[ "$OSTYPE" == "darwin"* ]] \
812
|| return 0
@@ -25,6 +29,8 @@ jetify() {
2529
node_modules/.bin/jetify
2630
}
2731

32+
patch_package
33+
2834
pod_install
2935

3036
jetify

yarn.lock

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5792,7 +5792,7 @@ find-up@^5.0.0, find-up@~5.0.0:
57925792
locate-path "^6.0.0"
57935793
path-exists "^4.0.0"
57945794

5795-
find-yarn-workspace-root@~2.0.0:
5795+
find-yarn-workspace-root@^2.0.0, find-yarn-workspace-root@~2.0.0:
57965796
version "2.0.0"
57975797
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd"
57985798
integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==
@@ -7176,7 +7176,7 @@ is-wsl@^1.1.0:
71767176
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
71777177
integrity sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==
71787178

7179-
is-wsl@^2.2.0:
7179+
is-wsl@^2.1.1, is-wsl@^2.2.0:
71807180
version "2.2.0"
71817181
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271"
71827182
integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==
@@ -8077,6 +8077,13 @@ kind-of@^6.0.0, kind-of@^6.0.2:
80778077
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
80788078
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
80798079

8080+
klaw-sync@^6.0.0:
8081+
version "6.0.0"
8082+
resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c"
8083+
integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==
8084+
dependencies:
8085+
graceful-fs "^4.1.11"
8086+
80808087
klaw@^1.0.0:
80818088
version "1.3.1"
80828089
resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
@@ -9584,6 +9591,14 @@ open@^6.2.0:
95849591
dependencies:
95859592
is-wsl "^1.1.0"
95869593

9594+
open@^7.4.2:
9595+
version "7.4.2"
9596+
resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321"
9597+
integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==
9598+
dependencies:
9599+
is-docker "^2.0.0"
9600+
is-wsl "^2.1.1"
9601+
95879602
open@^8.0.4, open@^8.3.0:
95889603
version "8.4.0"
95899604
resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8"
@@ -9791,6 +9806,26 @@ password-prompt@^1.0.4:
97919806
ansi-escapes "^3.1.0"
97929807
cross-spawn "^6.0.5"
97939808

9809+
patch-package@^6.5.1:
9810+
version "6.5.1"
9811+
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.5.1.tgz#3e5d00c16997e6160291fee06a521c42ac99b621"
9812+
integrity sha512-I/4Zsalfhc6bphmJTlrLoOcAF87jcxko4q0qsv4bGcurbr8IskEOtdnt9iCmsQVGL1B+iUhSQqweyTLJfCF9rA==
9813+
dependencies:
9814+
"@yarnpkg/lockfile" "^1.1.0"
9815+
chalk "^4.1.2"
9816+
cross-spawn "^6.0.5"
9817+
find-yarn-workspace-root "^2.0.0"
9818+
fs-extra "^9.0.0"
9819+
is-ci "^2.0.0"
9820+
klaw-sync "^6.0.0"
9821+
minimist "^1.2.6"
9822+
open "^7.4.2"
9823+
rimraf "^2.6.3"
9824+
semver "^5.6.0"
9825+
slash "^2.0.0"
9826+
tmp "^0.0.33"
9827+
yaml "^1.10.2"
9828+
97949829
path-browserify@^1.0.0:
97959830
version "1.0.1"
97969831
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd"
@@ -10849,7 +10884,7 @@ [email protected], rimraf@~2.6.2:
1084910884
dependencies:
1085010885
glob "^7.1.3"
1085110886

10852-
[email protected], rimraf@^2.5.4, rimraf@^2.6.2:
10887+
[email protected], rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3:
1085310888
version "2.7.1"
1085410889
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
1085510890
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
@@ -11166,6 +11201,11 @@ sisteransi@^1.0.5:
1116611201
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
1116711202
integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==
1116811203

11204+
slash@^2.0.0:
11205+
version "2.0.0"
11206+
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
11207+
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==
11208+
1116911209
slash@^3.0.0:
1117011210
version "3.0.0"
1117111211
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
@@ -12754,6 +12794,11 @@ yallist@^4.0.0:
1275412794
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
1275512795
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
1275612796

12797+
yaml@^1.10.2:
12798+
version "1.10.2"
12799+
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
12800+
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
12801+
1275712802
yargs-parser@^13.1.2:
1275812803
version "13.1.2"
1275912804
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38"

0 commit comments

Comments
 (0)