Commit Graph

32362 Commits

Author SHA1 Message Date
Blake Friedman
17cbe7d974 GHA: create a reaper job to keep the cache < 10GB (#45500)
Summary:
This would run every 2hrs during weekdays.  It aims for 9GB (a.k.a 90%
of threshold). It'll order caches by most accessed and start trimming
removing as soon as the cumulative cache is greater than the threshold.

I've given it generous logging to help debugging and investigation about
cache hogs.

Pull Request resolved: https://github.com/facebook/react-native/pull/45500

Test Plan:
Ran this locally using a `--dry` run:
```
  scripts git:(main) ✗ node ../clean-gha-cache.js --dry
skip 1 365.71MB 0.7hrs
skip 2 43.62MB 0.7hrs
skip 3 0.10MB 0.7hrs
skip 4 0.93MB 0.7hrs
skip 5 188.07MB 0.7hrs
skip 6 0.16MB 0.7hrs
skip 7 316.66MB 0.7hrs
skip 8 80.96MB 0.7hrs
skip 9 317.72MB 0.7hrs
skip 10 317.73MB 0.8hrs
skip 11 80.98MB 0.8hrs
skip 12 34.60MB 0.9hrs
skip 13 0.01MB 0.9hrs
skip 14 34.67MB 0.9hrs
skip 15 0.01MB 0.9hrs
skip 16 2.90MB 0.9hrs
skip 17 0.01MB 0.9hrs
skip 18 304.92MB 1.0hrs
skip 19 212.21MB 1.0hrs
skip 20 301.33MB 1.0hrs
skip 21 0.00MB 1.0hrs
skip 22 389.38MB 1.0hrs
skip 23 195.11MB 1.0hrs
skip 24 388.83MB 1.0hrs
skip 25 154.47MB 1.0hrs
skip 26 300.72MB 1.0hrs
skip 27 1.53MB 1.0hrs
skip 28 154.90MB 1.0hrs
skip 29 405.21MB 1.0hrs
skip 30 196.79MB 1.0hrs
skip 31 197.23MB 1.0hrs
skip 32 315.94MB 1.0hrs
skip 33 154.16MB 1.0hrs
skip 34 12.50MB 1.0hrs
skip 35 72.59MB 1.0hrs
skip 36 32.95MB 1.0hrs
skip 37 0.00MB 1.0hrs
skip 38 317.72MB 1.4hrs
skip 39 80.97MB 1.4hrs
skip 40 304.69MB 2.4hrs
skip 41 317.18MB 2.5hrs
skip 42 0.01MB 2.5hrs
skip 43 2.91MB 2.6hrs
skip 44 0.01MB 2.6hrs
skip 45 34.60MB 2.6hrs
skip 46 34.60MB 2.6hrs
skip 47 0.01MB 2.6hrs
skip 48 0.01MB 2.6hrs
skip 49 2.90MB 2.7hrs
skip 50 34.60MB 2.7hrs
skip 51 2.91MB 2.7hrs
skip 52 34.60MB 2.7hrs
skip 53 34.60MB 2.7hrs
skip 54 34.67MB 2.7hrs
skip 55 2.91MB 2.7hrs
skip 56 34.60MB 2.7hrs
skip 57 0.01MB 2.7hrs
skip 58 34.60MB 2.7hrs
skip 59 0.01MB 2.7hrs
skip 60 0.01MB 2.7hrs
skip 61 2.80MB 2.7hrs
skip 62 1.53MB 2.7hrs
skip 63 0.00MB 2.7hrs
skip 64 306.97MB 2.8hrs
skip 65 0.00MB 2.8hrs
skip 66 12.50MB 2.8hrs
skip 67 296.04MB 2.9hrs
skip 68 12.50MB 2.9hrs
skip 69 0.01MB 2.9hrs
skip 70 2.80MB 2.9hrs
skip 71 0.01MB 2.9hrs
skip 72 34.60MB 2.9hrs
skip 73 0.01MB 2.9hrs
skip 74 34.60MB 2.9hrs
skip 75 0.01MB 2.9hrs
skip 76 1.53MB 2.9hrs
skip 77 34.60MB 3.0hrs
skip 78 34.60MB 3.0hrs
skip 79 0.00MB 3.0hrs
skip 80 295.49MB 3.1hrs
skip 81 306.94MB 3.2hrs
skip 82 1.53MB 3.2hrs
skip 83 317.70MB 3.5hrs
skip 84 80.97MB 3.5hrs
skip 85 34.60MB 5.0hrs
skip 86 34.60MB 5.1hrs
skip 87 317.72MB 5.3hrs
skip 88 80.98MB 5.3hrs
skip 89 34.60MB 5.3hrs
skip 90 34.60MB 5.4hrs
[ 5.5hrs] 317.70MB -> gradle-transforms-v1-03ddabb4b1809dff6c857700b53007a6
[ 5.5hrs] 80.96MB -> gradle-home-v1|Linux|build_android[84f755636760a07462d15a851519289b]-ec140aa68d9ab872dc43719cdc53fb2bc0b19cd0
[ 5.6hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.6hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs] 34.67MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-18e21417bb83369992b1f3346f5aeeb7250bd9311d5f7f9427a743031daf7d00-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs]  2.80MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b09255761a2bb17e0014cb67004cc46eff539ef428ce97265644d6e75217fd5b-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.8hrs]  2.80MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.9hrs]  2.90MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 5.9hrs] 291.40MB -> gradle-dependencies-v1-49635ba64c7470c5975fa812320e8669
[ 5.9hrs] 241.71MB -> gradle-transforms-v1-4903a32cb8d567063ace38e1c8e4e922
[ 5.9hrs] 54.70MB -> gradle-home-v1|Linux|build_android[24b50bfc3f2953187ad7df78a20c6c6a]-a6f5e5adebed3d9da411f99548e2d8ce96636e16
[ 5.9hrs] 317.73MB -> gradle-transforms-v1-7c27a147cb9da63a071780069b610f20
[ 5.9hrs] 80.98MB -> gradle-home-v1|Linux|build_android[84f755636760a07462d15a851519289b]-a6f5e5adebed3d9da411f99548e2d8ce96636e16
[ 6.0hrs]  2.91MB -> v12-cocoapods-test_ios_rntester-b7217839f41b15a756f47bf4cb76a7e5770bc0986e8a5d852b9763fde7142bfd-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.0hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.0hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.0hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.0hrs]  2.91MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.1hrs] 34.67MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs]  2.80MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.4hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.9hrs]  2.80MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-1a00237c91b102b608d8562f91982c1adc1e44ee3b168f6dc0d7d60c5ca975d5-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 6.9hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-83993878f618c0a819bc05aa4b1fb7ec286dd41316ae29630808bf64a99f660b-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 7.0hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-31697fb37bd3e3292c233068c68666694ad04eb8eb75c71e0232d4aab0abd08f-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 7.3hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 7.3hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 7.3hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 8.1hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 8.1hrs] 34.67MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[ 8.2hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[10.4hrs]  0.00MB -> _state
[10.8hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[10.8hrs] 34.67MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[10.9hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[10.9hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[11.0hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--f74fef4230d89aac583dea74a08ece8c4ce36b22
[11.0hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[12.1hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[12.2hrs]  2.80MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[12.2hrs]  2.91MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-f74fef4230d89aac583dea74a08ece8c4ce36b22
[13.8hrs] 72.59MB -> v2-hermesc-apple--
[16.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.1hrs] 34.60MB -> v12-cocoapods-test_ios_rntester-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_dynamic_frameworks-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.1hrs] 34.67MB -> v12-cocoapods-test_ios_rntester_dynamic_frameworks-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.1hrs]  0.01MB -> v10-podfilelock-test_ios_rntester_ruby_3_2_0-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69--3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.1hrs] 34.60MB -> v12-cocoapods-test_ios_rntester_ruby_3_2_0-b14fc5cf3b5600afde3d3e7b7903096473f66a29e532cb885dfbc75dd42f2110-4c34080e10081d48f7ef152bdff463fce251ab906cd044dab48f32b051f9bf69-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3
[16.5hrs] 304.91MB -> v3-hermes-artifacts-Debug-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0
[16.5hrs] 80.98MB -> gradle-home-v1|Linux|build_android[84f755636760a07462d15a851519289b]-50f7892a1f803520f2b4dc25b99568ad0ce30ae9
[16.5hrs] 317.56MB -> gradle-transforms-v1-c63bdf2b438bb9e6966fa203418e433d
[16.5hrs] 212.20MB -> v3-hermes-artifacts-Release-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0
[16.5hrs] 80.94MB -> gradle-home-v1|Linux|build_android[84f755636760a07462d15a851519289b]-db16a7895ee2642ec5f7f517c008973a0be3b8a1
[16.5hrs] 154.47MB -> v4-hermes-apple-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0-7168ddaa4b22d226798554ca83fec4fb2830f638613a93ddef357a3855c6c6fa-xrsimulator-Release
[16.5hrs] 317.71MB -> gradle-transforms-v1-e95e7d153c065969cb69e27e056a1539
[16.5hrs] 405.21MB -> v4-hermes-apple-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0-7168ddaa4b22d226798554ca83fec4fb2830f638613a93ddef357a3855c6c6fa-macosx-Debug
[16.5hrs] 301.33MB -> v4-hermes-apple-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0-7168ddaa4b22d226798554ca83fec4fb2830f638613a93ddef357a3855c6c6fa-iphonesimulator-Release
[16.5hrs] 154.18MB -> v4-hermes-apple-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0-7168ddaa4b22d226798554ca83fec4fb2830f638613a93ddef357a3855c6c6fa-iphoneos-Release
[16.5hrs] 389.38MB -> v4-hermes-apple-3d32796a1e32f7e0e424eb41bad5a2fb8ccf58c3-1000.0.0-7168ddaa4b22d226798554ca83fec4fb2830f638613a93ddef357a3855c6c6fa-iphonesimulator-Debug
Identifed 71 cache keys for removal, reducing cache from 14128.82MB -> 9199.51MB
DRY: gh cache delete 55205 --repo facebook/react-native
DRY: gh cache delete 55206 --repo facebook/react-native
DRY: gh cache delete 55254 --repo facebook/react-native
DRY: gh cache delete 55253 --repo facebook/react-native
DRY: gh cache delete 55223 --repo facebook/react-native
DRY: gh cache delete 55220 --repo facebook/react-native
DRY: gh cache delete 55219 --repo facebook/react-native
DRY: gh cache delete 55216 --repo facebook/react-native
DRY: gh cache delete 55215 --repo facebook/react-native
DRY: gh cache delete 55213 --repo facebook/react-native
DRY: gh cache delete 55209 --repo facebook/react-native
DRY: gh cache delete 55207 --repo facebook/react-native
DRY: gh cache delete 55196 --repo facebook/react-native
DRY: gh cache delete 55083 --repo facebook/react-native
DRY: gh cache delete 55084 --repo facebook/react-native
DRY: gh cache delete 55085 --repo facebook/react-native
DRY: gh cache delete 55030 --repo facebook/react-native
DRY: gh cache delete 55031 --repo facebook/react-native
DRY: gh cache delete 55191 --repo facebook/react-native
DRY: gh cache delete 55190 --repo facebook/react-native
DRY: gh cache delete 55189 --repo facebook/react-native
DRY: gh cache delete 55182 --repo facebook/react-native
DRY: gh cache delete 55181 --repo facebook/react-native
DRY: gh cache delete 55123 --repo facebook/react-native
DRY: gh cache delete 55117 --repo facebook/react-native
DRY: gh cache delete 55121 --repo facebook/react-native
DRY: gh cache delete 55167 --repo facebook/react-native
DRY: gh cache delete 55166 --repo facebook/react-native
DRY: gh cache delete 55158 --repo facebook/react-native
DRY: gh cache delete 55157 --repo facebook/react-native
DRY: gh cache delete 55156 --repo facebook/react-native
DRY: gh cache delete 55155 --repo facebook/react-native
DRY: gh cache delete 55152 --repo facebook/react-native
DRY: gh cache delete 55151 --repo facebook/react-native
DRY: gh cache delete 55148 --repo facebook/react-native
DRY: gh cache delete 55147 --repo facebook/react-native
DRY: gh cache delete 55144 --repo facebook/react-native
DRY: gh cache delete 55095 --repo facebook/react-native
DRY: gh cache delete 55091 --repo facebook/react-native
DRY: gh cache delete 55087 --repo facebook/react-native
DRY: gh cache delete 55122 --repo facebook/react-native
DRY: gh cache delete 55120 --repo facebook/react-native
DRY: gh cache delete 55116 --repo facebook/react-native
DRY: gh cache delete 55100 --repo facebook/react-native
DRY: gh cache delete 55113 --repo facebook/react-native
DRY: gh cache delete 55112 --repo facebook/react-native
DRY: gh cache delete 55109 --repo facebook/react-native
DRY: gh cache delete 55108 --repo facebook/react-native
DRY: gh cache delete 55103 --repo facebook/react-native
DRY: gh cache delete 55102 --repo facebook/react-native
DRY: gh cache delete 55094 --repo facebook/react-native
DRY: gh cache delete 55090 --repo facebook/react-native
DRY: gh cache delete 55086 --repo facebook/react-native
DRY: gh cache delete 52262 --repo facebook/react-native
DRY: gh cache delete 55037 --repo facebook/react-native
DRY: gh cache delete 55036 --repo facebook/react-native
DRY: gh cache delete 55035 --repo facebook/react-native
DRY: gh cache delete 55034 --repo facebook/react-native
DRY: gh cache delete 55033 --repo facebook/react-native
DRY: gh cache delete 55032 --repo facebook/react-native
DRY: gh cache delete 55021 --repo facebook/react-native
DRY: gh cache delete 55008 --repo facebook/react-native
DRY: gh cache delete 54980 --repo facebook/react-native
DRY: gh cache delete 55007 --repo facebook/react-native
DRY: gh cache delete 54981 --repo facebook/react-native
DRY: gh cache delete 54991 --repo facebook/react-native
DRY: gh cache delete 55006 --repo facebook/react-native
DRY: gh cache delete 54996 --repo facebook/react-native
DRY: gh cache delete 54992 --repo facebook/react-native
DRY: gh cache delete 54987 --repo facebook/react-native
DRY: gh cache delete 54994 --repo facebook/react-native
```

Reviewed By: cipolleschi

Differential Revision: D59865637

Pulled By: blakef

fbshipit-source-id: 7d7a447a3fbcd1a3a15da7a43493c8544d93c263
2024-07-17 14:57:23 -07:00
Peter Abbondanzo
0ad437390c Support loading XML assets (#45334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45334

Adds support for the `xml` file extension as a loadable asset, and lets Flow treat the type signature as an image

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D58261501

fbshipit-source-id: b29cffee81d0438827529711e86267edd5d2a0f7
2024-07-17 12:37:01 -07:00
Riccardo Cipolleschi
f0f9ac67f4 Update testing scripts to work with any version of React native (#45498)
Summary:
I'm picking 1630b5c743 in main as it's currently missing (available only on `0.75-stable`).

## Changelog:

[INTERNAL] - Update testing scripts to work with any version of React native

Pull Request resolved: https://github.com/facebook/react-native/pull/45498

Test Plan: Nothing to test as this is a backport

Reviewed By: cipolleschi

Differential Revision: D59861440

Pulled By: cortinico

fbshipit-source-id: 57f642c66c7a6976f5a5cd53debaeb2e461a1f30
2024-07-17 12:18:11 -07:00
Blake Friedman
188a09ef69 fix linting noise (#45465)
Summary:
## Summary:
Fix linting warnings

Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/45465

Test Plan:
```
$ eslint .
Done in 46.11s.
$ arc f
ok No lint issues.
```

Reviewed By: cipolleschi

Differential Revision: D59805820

Pulled By: blakef

fbshipit-source-id: f33d99a6a06607c3c3762881cc7c182804b981e1
2024-07-17 10:07:00 -07:00
Riccardo Cipolleschi
394aae1c1c Make the ScrollView connect with the TurboAnimatedModule to fix pressable and animated (#45457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45457

With this change, we are implementing in Android a similar logic that we implemented in iOS.
1. When the user stops dragging a scroll view, it tells native animated modle that a scroll has finished
2. NativeAnimated module asks to the NativeAnimatedNodesModule if there are native node listening to the scroll
3. In case they are, it emits an event to JS
4. JS listen to the events and resync the Shadow Tree and the Native Tree (this implemented in a previous change)

## Changelog
[Android][Fixed] - Sync the Shadow Tree and the Native Tree with Native animation when scroll is driving the animation

Reviewed By: sammy-SC

Differential Revision: D59756577

fbshipit-source-id: e558557b477f4da9da1f89fb31ba86d0ea1390a3
2024-07-17 09:22:39 -07:00
Riccardo Cipolleschi
fd748ae84c Receive the onUserDrivenAnimationEnded event in JS (#45383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45383

This is the second step required to fix the onTouchMove event in the new architecture.

In this change, we are retrieving the list of nodes that are connected by the animation, and we are sending an event to the nodes so that we can trigger the commit.

## Changelog
[iOS][Added] - retrieve the tags of the nodes connected by the animation and send them to JS

Reviewed By: sammy-SC

Differential Revision: D59524617

fbshipit-source-id: 584317afa8e4cf0ad9f98f38e4e5d436c5fe3ac5
2024-07-17 09:22:39 -07:00
Riccardo Cipolleschi
7af743236f Send onScrollEnded Event to native driver (#45382)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45382

This change is the first step to tr and solve the pressability's `onTouchMove` issue with animation driven natively in the New Architecture.

 The idea is to trigger a special event from native to let JS know that a scroll event has ended (`scrollViewDidEndDragging` or `scrollViewdidEndDecelerating`).

When this happens, we need to send an event to JS to let him know that it has to sync the Native Tree with the Shadow Tree.

Step 2 is to connect Native with JS

## Changelog:
[iOS][Added] - Send onScrollEnded event to NativeTurboAnimatedModule

Reviewed By: sammy-SC

Differential Revision: D59459989

fbshipit-source-id: cb425cddcdaa9d700ec40accaf4ab3ce1f3c5038
2024-07-17 09:22:39 -07:00
Riccardo Cipolleschi
dbbb4069b9 Fix prepare hermes workspace warnings in GHA (#45494)
Summary:
Some of the previous commits changed the names of the parameters on one side and not in another, and GHA is emitting some warnings. This change should fix them

## Changelog:
[Internal] - Fix GHA CI warnings

Pull Request resolved: https://github.com/facebook/react-native/pull/45494

Test Plan:
| BEFORE | AFTER |
| --- | --- |
| <img width="1507" alt="Screenshot 2024-07-17 at 14 20 54" src="https://github.com/user-attachments/assets/6703e554-ad74-4fd6-96ba-18baf5e71a52"> | <img width="1718" alt="Screenshot 2024-07-17 at 14 23 31" src="https://github.com/user-attachments/assets/8bb7bd4a-5bd4-417f-9c8a-e7e8db4ba412"> |

Reviewed By: robhogan

Differential Revision: D59857004

Pulled By: cipolleschi

fbshipit-source-id: e8c5050682aba4952e3a2b0c7a660155813d19f1
2024-07-17 08:08:11 -07:00
Blake Friedman
0731f373c1 flow semver 6.2 -> 7 type defintions (#45495)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45495

Unify type definitions to semver@7, to fix a [type-sync](https://www.internalfb.com/intern/test/281475050813096/) test that was broken by D59378011.  The test is very simple and doesn't actually understand the typing.

I don't believe there is a significant difference in the typing, esp. with how we're using it.  Flow will tell us if this is the case though (🏖️ 🏰).

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D59855434

fbshipit-source-id: ae3c6b7aa81b3cde25468d72a7922bcb2b6f652f
2024-07-17 07:32:29 -07:00
Pieter De Baets
00d4d9c632 Limit sampling to 50 frames (#45478)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45478

Some code is far too recursive. This consumes buffer space and causes problems for the Perfetto frontend. Let's limit it to 50 frames.

Changelog: [Internal]

Reviewed By: rubennorte, sammy-SC

Differential Revision: D59813638

fbshipit-source-id: 69068f9c2193d706ec0cc00ffc0d5950ae094e05
2024-07-17 05:30:21 -07:00
Nicola Corti
c1b4133a58 Composite actions inputs should be kebab-case (#45474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45474

Our actions inputs are now a mixture of different casing.
I'm moving everything to be kebab-case

Changelog:
[Internal] [Changed] -  Composite actions inputs should be kebab-case

Reviewed By: cipolleschi

Differential Revision: D59809181

fbshipit-source-id: af6d541c2b4f5fa162dcde412fb8808bae1ef2d3
2024-07-17 03:48:36 -07:00
Nicola Corti
624f8f1919 Remove unused parameter for prepare-hermes-workspace/action.yml (#45472)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45472

BUILD_FROM_SOURCE is unused here, I'm removing it.

Changelog:
[Internal] [Changed] - Remove unused parameter for prepare-hermes-workspace/action.yml

Reviewed By: cipolleschi

Differential Revision: D59808781

fbshipit-source-id: 0d6b5a877389bda0923cf6cc18e6330f82c78f57
2024-07-17 03:48:36 -07:00
Nicola Corti
37d1e8e7a0 Act as @react-native-bot on all the actions (#45480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45480

We currently use the default GITHUB_ACTION which makes a lot of interaction
appear as user "GitHub Actions". Instead we could use the `REACT_NATIVE_BOT_GITHUB_TOKEN`
which we have as secret so the bot will actually perform the actions.

Changelog:
[Internal] [Changed] - Act as react-native-bot on all the actions

Reviewed By: cipolleschi

Differential Revision: D59815201

fbshipit-source-id: 702b121ec07d0db10abf25e23f7ddf5658dd5d62
2024-07-17 03:27:12 -07:00
Nicola Corti
ec140aa68d Unbreak nightlies by fixing secrets (#45491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45491

The build_android job was missing the sonatype credentials so could not
publish a -SNAPSHOT version. This fixes it.

Changelog:
[Internal] [Changed] - Unbreak nightlies by fixing secrets

Reviewed By: cipolleschi

Differential Revision: D59848810

fbshipit-source-id: 2cc1d03b090d0aeb3886590ec0696f9c3a6556b9
2024-07-17 03:00:33 -07:00
Zeya Peng
a6f5e5adeb Fix react/renderer ColorTest (#45485)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45485

## Changelog:

the new functions I introduced in https://github.com/facebook/react-native/pull/45365 to read color channel value, like `alphaFromColor`, will return float between 0~255 on iOS and 8bit unsigned ints on other platforms, because of different platform implementation. However that way we cannot assume consistent return value across platforms, which kind of contradicts with RN's cross platform design.

so here I make `alphaFromColor` in Color.h (the cross platform method) to always return uint8_t, while still allow `alphaFromHostPlatformColor` to return different result

[Internal] [Fixed] -

Reviewed By: christophpurrer

Differential Revision: D59826142

fbshipit-source-id: 4401918be29980474bdc8601443ae33155710f22
2024-07-16 16:35:13 -07:00
Deepanshu.shukla
50f7892a1f fix: add headers in fabric image component (#45415)
Summary:
FIXES [45404](https://github.com/facebook/react-native/issues/45404)

 sending headers from Image  component  not working in new arch , implementation was missing
```
<Image
        source={{
          uri: "http://localhost:3000/image",
          headers: {
            "test-header": 'test',
              "hello":"tested"
          }
        }}
        style={{
          width: 300,
          height: 300,
        }}
      />
```

## Changelog:
[IOS] [ADDED]- sending missing **headers** field with **Image** component in fabric

Pull Request resolved: https://github.com/facebook/react-native/pull/45415

Test Plan:
# Tested
Attaching the below video to show how headers are getting received on server from Image component running in new arch

https://github.com/user-attachments/assets/c816265d-0bb5-4670-bde0-cfec72d7618f

Reviewed By: javache, cipolleschi

Differential Revision: D59807462

Pulled By: blakef

fbshipit-source-id: dffa4d80db58de6a81947ac876aa76ec7e62dd48
2024-07-16 16:20:11 -07:00
Rob Hogan
db16a7895e jsinspector: Vendor base64 encoding, remove folly::base64 dependency (#45445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45445

Roll our own base64 encoding and revert D59685218, which fixed the missing Folly dependency implied by D54309633.

I assumed Folly base64 was already elsewhere in RN but given it isn't, and we only need simple, non-perf-sensitive encoding for the debugger (not the SIMD or delegated implementations, or decoding), it might be best to just include our own encoder.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D58323859

fbshipit-source-id: 5ce98561e9ced82765e8e7c18e5d2ebfa8148c8c
2024-07-16 14:34:14 -07:00
Nicola Corti
8d0cbbf0e6 Make build_android publish to the staging repositories (#45468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45468

This should greatly reduce the time spent on build_npm_package
because we're moving all the publishing logic to build_android.

I need to do a bit more testing with nightlies to make sure that everything is published correctly.

Changelog:
[Internal] [Changed] - Make build_android publish to the stating repositories

Reviewed By: cipolleschi

Differential Revision: D59804015

fbshipit-source-id: be3f0b6e16f5fdbf760ec7a5e16c8e258e06dd28
2024-07-16 13:58:43 -07:00
Andrew Coates
892c8352ca Use more accurate type in LinkingManager spec file (#45450)
Summary:
The `LinkingModule.getInitialURL` method is declared as returning a `Proimise<string>` but looking at the implementation it can also return null:

a96272e27e/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm (L166)
which is returned by
a96272e27e/packages/react-native/Libraries/Linking/Linking.js (L96)
which happens to expand the type to the correct type for most external users.

React-native-window's turbomodule codegen is more type strict, and so cannot return null with the current spec.

## Changelog:

[INTERNAL] [FIXED] - Use more accurate type in LinkingManager spec file

Pull Request resolved: https://github.com/facebook/react-native/pull/45450

Test Plan:
Type change only, so should only affect build time change which will be caught by CI.
Have verified that this type change allows react-native-windows to return null.

Reviewed By: robhogan

Differential Revision: D59816089

Pulled By: zeyap

fbshipit-source-id: 9810f150ce84b503883e72b1f29518d2e62258b6
2024-07-16 13:41:48 -07:00
Rob Hogan
c085180264 jsinspector: Support UTF-8 responses to CDP's IO.read (#45426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45426

The initial implementation of `Network.loadNetworkResource` and the accompanying `IO.read` (D54202854) base64-encodes all data as if it is binary. This is the more general case, and we'll continue to base64-encode non-text resources.

In the common case of text resources (particularly JS and JSON), it'd be preferable to do as Chrome does and send UTF-8 over the wire directly. This has a few performance benefits:
 - Less CPU and RAM footprint on device (UTF-8 truncation is constant-time, fast, and in-place), similarly less decoding for the frontend.
 - 25% less data per chunk (base64 encodes 3 bytes as 4 characters), implies up to 25% fewer network round trips for large resources.

It also has the benefit of being human-readable in the CDP protocol inspector.

## Determining whether data is text
We use exactly Chromium's heuristic for this (code pointers in comments), which is based only on the `Content-Type` header, and assuming any text mime type is UTF-8.

## UTF-8 truncation
The slight implementation complexity here is that `IO.read` requests may specify a maximum number of bytes, and so we must slice a raw buffer up into valid UTF-8 sequences. This turns out to be fairly simple and cheap:
 1. Naively truncate the buffer, inspect the last byte
 2. If the last byte has topmost bit =0, it's ASCII (single byte) and we're done.
 3. Otherwise, look back at most 3 bytes to find the first byte of the code point (topmost bits 11), counting the number of "continuationBytes" at the end of our buffer. If we don't find one within 3 bytes then the string isn't UTF-8 - throw.
 4. Read the code point length, which is encoded into the first byte.
 5. Resize to remove the last code point fragment, unless it terminates correctly exactly at the end of our buffer.

## Edge cases + divergence from Chrome
Chrome's behaviour here in at least one case is questionable and we intentionally differ:
 - If a response has header "content-type: text/plain" but content eg`0x80` (not valid UTF-8), Chrome will respond to an `IO.read` with `{ "data": "", "base64Encoded": false, "eof": false }`, ie an empty string, but will move its internal pointer such that the next or some subsequent `IO.read` will have `"eof": true`. To the client, this is indistinguishable from a successfully received resource, when in fact it is effectively corrupted.
 - Instead, we respond with a CDP error to the `IO.read`. We do not immediately cancel the request or discard data, since not all `IO.read` errors are necessarily fatal. I've verified that CDT sends `IO.close` after an error, so we'll clean up that way (this isn't strictly guaranteed by any spec, but nor is `IO.close` after a resource is successfully consumed).

Changelog:
[General][Added] Debugger: Support text responses to CDP `IO.read` requests

Reviewed By: hoxyq

Differential Revision: D58323790

fbshipit-source-id: def8bf8426266f16bb305d836a6efe8927a9dfc4
2024-07-16 12:31:41 -07:00
Håkon Knutzen
0f051f6034 Add missing lock around assignment of cancellation handler in RCTImageLoader (#45454)
Summary:
When running the entire unit test suite of `RNTesterPods` with `TSan`, I saw that occasionally a data race was detected on line 843 of `RCTImageLoader`. It seems the completion handler that does contain the lock around `cancelLoad` is called concurrently with the value being assigned on line 843. Here there is no lock in place.

Here is the output of `TSan` when I comment out my fix:
```
WARNING: ThreadSanitizer: data race (pid=72490)
  Write of size 8 at 0x000144151ce8 by main thread:
    #0 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16e8030)
    https://github.com/facebook/react-native/issues/1 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df8dc)
    https://github.com/facebook/react-native/issues/2 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df534)
    https://github.com/facebook/react-native/issues/3 -[RCTImageLoaderTests testImageLoaderUsesImageURLLoaderWithHighestPriority] <null> (RNTesterUnitTests:arm64+0x7cb8)
    https://github.com/facebook/react-native/issues/4 __invoking___ <null> (CoreFoundation:arm64+0x13371c)

  Previous write of size 8 at 0x000144151ce8 by thread T4 (mutexes: write M0):
    #0 __140-[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke_2 <null> (RNTesterUnitTests:arm64+0x16e8894)
    https://github.com/facebook/react-native/issues/1 __139-[RCTImageLoader _loadImageOrDataWithURLRequest:size:scale:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke <null> (RNTesterUnitTests:arm64+0x16e3430)
    https://github.com/facebook/react-native/issues/2 __139-[RCTImageLoader _loadImageOrDataWithURLRequest:size:scale:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke_3 <null> (RNTesterUnitTests:arm64+0x16e52a8)
    https://github.com/facebook/react-native/issues/3 __75-[RCTImageLoaderTests testImageLoaderUsesImageURLLoaderWithHighestPriority]_block_invoke_2 <null> (RNTesterUnitTests:arm64+0x7f24)
    https://github.com/facebook/react-native/issues/4 -[RCTConcreteImageURLLoader loadImageForURL:size:scale:resizeMode:progressHandler:partialLoadHandler:completionHandler:] <null> (RNTesterUnitTests:arm64+0x6c470)
    https://github.com/facebook/react-native/issues/5 __139-[RCTImageLoader _loadImageOrDataWithURLRequest:size:scale:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke.172 <null> (RNTesterUnitTests:arm64+0x16e4964)
    https://github.com/facebook/react-native/issues/6 __tsan::invoke_and_release_block(void*) <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x77ee0)
    https://github.com/facebook/react-native/issues/7 _dispatch_client_callout <null> (libdispatch.dylib:arm64+0x3974)

  Location is heap block of size 48 at 0x000144151cc0 allocated by main thread:
    #0 malloc <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x4fa48)
    https://github.com/facebook/react-native/issues/1 _malloc_type_malloc_outlined <null> (libsystem_malloc.dylib:arm64+0xf3ec)
    https://github.com/facebook/react-native/issues/2 _call_copy_helpers_excp <null> (libsystem_blocks.dylib:arm64+0x10b4)
    https://github.com/facebook/react-native/issues/3 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df8dc)
    https://github.com/facebook/react-native/issues/4 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df534)
    https://github.com/facebook/react-native/issues/5 -[RCTImageLoaderTests testImageLoaderUsesImageURLLoaderWithHighestPriority] <null> (RNTesterUnitTests:arm64+0x7cb8)
    https://github.com/facebook/react-native/issues/6 __invoking___ <null> (CoreFoundation:arm64+0x13371c)

  Mutex M0 (0x000108f316e8) created at:
    #0 pthread_mutex_init <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x2cc98)
    https://github.com/facebook/react-native/issues/1 -[NSLock init] <null> (Foundation:arm64+0x5ca14c)
    https://github.com/facebook/react-native/issues/2 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df8dc)
    https://github.com/facebook/react-native/issues/3 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:partialLoadBlock:completionBlock:] <null> (RNTesterUnitTests:arm64+0x16df534)
    https://github.com/facebook/react-native/issues/4 -[RCTImageLoaderTests testImageLoaderUsesImageURLLoaderWithHighestPriority] <null> (RNTesterUnitTests:arm64+0x7cb8)
    https://github.com/facebook/react-native/issues/5 __invoking___ <null> (CoreFoundation:arm64+0x13371c)

  Thread T4 (tid=10935088, running) is a GCD worker thread
```

## Changelog:

[iOS][Fixed] Data race in `RCTImageLoader` related to assignment of cancellation block.

Pull Request resolved: https://github.com/facebook/react-native/pull/45454

Test Plan: There are already tests in place for `RCTImageLoader`. I hope these will cover the fix.

Reviewed By: realsoelynn

Differential Revision: D59816000

Pulled By: zeyap

fbshipit-source-id: f959d472eb60f83f39ced6711ee395949ab37e7c
2024-07-16 12:30:43 -07:00
Nicola Corti
fb9ce762f7 Enable add-job-summary-as-pr-comment for failed jobs (#45479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45479

This just prints a summary on PRs if the Gradle task fails so it's easier to jump directly
to the failure.

Changelog:
[Internal] [Changed] - Enable add-job-summary-as-pr-comment for failed jobs

Reviewed By: cipolleschi

Differential Revision: D59812845

fbshipit-source-id: 2069a1c8db7d264ca1af3c1182fa443cb0a69646
2024-07-16 10:43:03 -07:00
Alex Hunt
c47b04b07e Enable Fusebox by default (#45469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45469

Enables React Native DevTools by default on `main`, ahead of the 0.76 release. We've observed no new bug reports internally over the last two weeks, and are moving forward with our rollout plan.

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D59804882

fbshipit-source-id: 0cb6302f4d940718786db2e5d8fb652fae6a8c54
2024-07-16 10:16:25 -07:00
Nicola Corti
12f58a6452 Split the rntester APK artifacts in 4 (#45475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45475

Instead of zipping all the RNTester's APK together, let's
upload them per buildVariant so it's easier to retrieve them later.

Changelog:
[Internal] [Changed] - Split the rntester APK artifacts in 4

Reviewed By: cipolleschi

Differential Revision: D59809721

fbshipit-source-id: 2d375475d5cee71c212f4d1f3a4a9edf3442358f
2024-07-16 10:01:21 -07:00
Nicola Corti
16b9b55cf1 actions/upload-artifact to v4.x
Summary:
We don't need to specify a minor/patch for actions/upload-artifact.
We also have all sorts of different versions scattered around the codebase.
This aligns them to the latest sable in the 4.x series.

Changelog:
[Internal] [Changed] - actions/upload-artifact to v4.x

Reviewed By: cipolleschi

Differential Revision: D59811525

fbshipit-source-id: 7264db097bcb2ff34b3ace467996e8308c0f2034
2024-07-16 10:01:21 -07:00
Nick Lefever
c0b288ca3f Use weak ptr for runtime shadow node reference (#45463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45463

Changelog: [Internal]

State updates will clone shadow nodes for an shadow tree revision that is outdated.

This can lead to accessing deallocated shadow node references because the JS renderer committed a newer revision and deallocated the one used by the pending state update.

By using a weak pointer to hold a reference to the runtime shadow node reference, we can only update references for wrappers that are still valid.

Reviewed By: javache

Differential Revision: D59804999

fbshipit-source-id: 89c9967d139d3cac7d7252994beae419bc591e79
2024-07-16 09:23:42 -07:00
Nicola Corti
2098806c22 Unbreak RNTester instacrashing on main (#45467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45467

This unbreaks RNTester instacrashing on main.

Changelog:
[Internal] [Changed] - Unbreak RNTester instacrashing on main

Reviewed By: javache

Differential Revision: D59806826

fbshipit-source-id: 6d5246cd02e2c364068d047b973b2954b459df1e
2024-07-16 07:42:43 -07:00
Riccardo Cipolleschi
050006a7a7 Add example for Pressability with Native Driver in RNTester (#45413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45413

## Changes
Add an example in RNTester to test that pressability with NativeDrivers works properly.

## Context
The pressability handling is a bit peculiar.
We have to handle 3 main behaviors:
* `PressIn` -> `PressOut` => triggers the `onPress`
* `PressIn` -> move inside the rectangle -> `PressOut` => triggers the `onPress`
* `PressIn` -> move outside the rectangle -> `PressOut` => cancel `onPress`.

For the first case, we detect whether the press happens inside a component in the Native layer only. And everything works.

When a move is involved, we:
1. Detect the initial press in the Native layer
2. We move the coursor and we delegate the detection of whether we are inside of a rect or not to the JS layer
3. The JS layer asks the C++ layer about the layout and decide whether we are in case 2 (move but still inside the rect) or in case 3 (move but outside the rect).

The problem is that with `nativeDriver` and animations, the C++ layer doesn't know about where the receiver view actually is.
This results in issues like the one shown by [#36504](https://github.com/facebook/react-native/issues/36504), where the onMove is not handled correctly.

## Solution
The solution is to keep detecting whether we are in the receiver view or not in the Native layer and pass the receiver view position and size back to JS so that the JS layer don't have to jump to C++ to make this decision.

We decided to pass the frame information because the JS layer is adding some padding and configurations to the final rectangle and we don't want to lose those configurations.

## Changelog
[General][Added] - Add example in RNTester to show that pressability works properly with NativeDrivers

Reviewed By: sammy-SC

Differential Revision: D58182480

fbshipit-source-id: 9ca4fb9a3ca1a8af52ccbe208cbfe8434175f87d
2024-07-16 07:20:51 -07:00
Riccardo Cipolleschi
7fd6c2c45e Fix CCI cache issues (#45460)
Summary:
CCI on main is broken. We suspect that's due to cache issues which restore a wrong layout for the Folly pod.
This PR is an attempt to fix it

## Changelog:
[Internal] - Fix missing folly base 64

Pull Request resolved: https://github.com/facebook/react-native/pull/45460

Test Plan: CCI and GHA are green

Reviewed By: sammy-SC, huntie

Differential Revision: D59804748

Pulled By: cipolleschi

fbshipit-source-id: 44d6b169cf3319f4d7ee9e0a5833f07bc6ba4bb3
2024-07-16 06:26:07 -07:00
Pieter De Baets
5bb57eb2b3 Ignore PackagerStatusCallback on invalidated ReactInstanceManager (#45458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45458

Checking for packager is an async operation, which may return when we've already destroyed the ReactInstanceManager. Prevent the CatalystInstance from being created if the ReactInstanceManager has been invalidated.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59753247

fbshipit-source-id: e3ac2b6dd142330e2d4051519b9863584b33f8a6
2024-07-16 05:19:33 -07:00
shubhamguptadream11
b243d343fa fix: background color fix when border is dotted and dashed (#45430)
Summary:
This PR fixes these issues: https://github.com/facebook/react-native/issues/42289, https://github.com/facebook/react-native/issues/45368

## Changelog:

[IOS] [FIXED] - Message

In iOS for old/new architecture when we are trying to pass borderStyle other than 'solid' then in this
**Old Arch file**
2eb7bcb8d9/packages/react-native/React/Views/RCTView.m (L807)
**New Arch file**
2eb7bcb8d9/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm (L652)
 file useCoreAnimationBorderRendering is coming as nil since borderStyle passed is not **solid**. Due to which else case block executes and there we are applying backgroundColor as nil.

I just removed that hardcoded check for sold style and make sured that it is now working now with all three borderStyle 'dotted' | 'solid' | 'dashed' for Text and View both

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/45430

Test Plan:
Tested with possible borderStyle values.

Providing the fixed screenshot here.

![simulator_screenshot_5E7DDDE7-71F2-4A35-93B3-BFD9F980EA18](https://github.com/user-attachments/assets/3949085e-946f-4669-aaf5-fe366f7e6fc4)

Reviewed By: cortinico

Differential Revision: D59755124

Pulled By: cipolleschi

fbshipit-source-id: 091bb9ba731ac93973230970b526396fd6ea2989
2024-07-16 04:39:21 -07:00
Pieter De Baets
e02ca334b1 Skip getProperty calls for unreferenced props in RawPropsParser (#45456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45456

Small perf improvement when using enableCppPropsIteratorSetter

Changelog: [Internal]

Reviewed By: sammy-SC, mdvacca

Differential Revision: D59699469

fbshipit-source-id: d65a5e26faf218d0b79c9ac691007310b6db4182
2024-07-16 04:38:45 -07:00
Blake Friedman
b443e37a02 disable gradle home cleanup (#45459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45459

Seeing failures on main with GHA for gradle builds, in the Post Setup gradle step:

```
Could not get unknown property 'cleanupTime' for object of type org.gradle.api.internal.cache.DefaultCacheConfigurations.
```

This is a speculative change to get CI back to stable.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59802517

fbshipit-source-id: c7b5259397fddef9420570043263e92f21718934
2024-07-16 04:20:37 -07:00
Riccardo Cipolleschi
3d5daa12d4 Factor out build-android (#45455)
Summary:
This change factors out build-android job so we can reuse it

## Changelog:
[Internal] - Factor out the build-android job for code reuse

Pull Request resolved: https://github.com/facebook/react-native/pull/45455

Test Plan: GHA are green

Reviewed By: blakef

Differential Revision: D59802116

Pulled By: cipolleschi

fbshipit-source-id: 12ece8004da3bfd1f275b4af8e9822d4b0ccc0f0
2024-07-16 03:34:34 -07:00
Samuel Susla
334b5c9fdb Execute insert mount instructions after layout update and state update (#45448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45448

changelog: [internal]

I would like to experiment with executing insert mount instructions after layout and state update. It has shown small improvement in local testing

Reviewed By: mdvacca

Differential Revision: D59582123

fbshipit-source-id: 3ee6ec12a533a287ed32f7373863175f3a107548
2024-07-16 02:13:12 -07:00
Samuel Susla
4d88b20847 create hook to setup animations in passive effects (#45410)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45410

changelog: [internal]

For better performance, let's test setting up the animation graph from passive effects. This will delay the work, not blocking the paint.

Reviewed By: rubennorte

Differential Revision: D59644374

fbshipit-source-id: ff951ee7c1a1d47e13c55fc7c7f6c0690aa465f7
2024-07-16 02:13:12 -07:00
Ruslan Shestopalyuk
e443c1f0cf Make sure that ScrollView.scrollIndicatorInsets prop finds its way from JS into C++/Fabric (#45444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45444

## Changelog:

[Internal] -

Even though `ScrollView.scrollIndicatorInsets` isn't supported on the vanilla Android platform, it still may be used on some other variations of it, which means that the changes may not potentially find the way into C++/Fabric, opening a door of all kinds of weird corner case issues.

Reviewed By: christophpurrer

Differential Revision: D59761458

fbshipit-source-id: 4dae5c96791ca924d589a3d803d8fa60fdca1b67
2024-07-16 01:33:43 -07:00
Joe Vilches
944d40f204 Add mix-blend-mode effects to iOS (#45304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45304

Add support for most keyword values of mix-blend-mode on iOS and added RNTester Example
Missing compositing operators and global values

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59402969

fbshipit-source-id: b7e1aaed01fbf8f80e04ad0fa73d2ef63b5ad933
2024-07-15 18:10:17 -07:00
Joe Vilches
a96272e27e Add drop-shadow test (#45306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45306

Adding missing drop-shadow test to rn-tester.
Added with alpha-hotdog image to show we are creating the shadow with the alpha channel of the view.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D59410148

fbshipit-source-id: 5a03ee84313979f99585b8ca7e07abf9cdbe2396
2024-07-15 16:09:43 -07:00
generatedunixname89002005232357
85dd14c912 Revert D59170923 (#45447)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45447

This diff reverts D59170923
Breaking OSS build

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D59759991

fbshipit-source-id: 39aa0b447a90801d1da5a39461b33b4c4cc4197b
2024-07-15 13:44:09 -07:00
Nick Gerleman
2d67b723d3 Gate off "mixBlendMode" and "filter" on Paper (#45443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45443

We are only building these out for Fabric. This means only one natural iOS impl, but that other Android bits will not work fully correctly on Paper (like setting containing block for filter element). This also means we can remove view configs once we're on Fabric CSS parser. We will do the same for boxShadow once that is ready.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D59762282

fbshipit-source-id: 14ce07f04b822c6aee908894c9081419594fc484
2024-07-15 13:05:40 -07:00
Peter Abbondanzo
018d0621c1 Declare public resources from images that are loaded by name (#45421)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45421

RNTester contains Android resources that are loaded by name and not resolved by Metro. As a result, these assets are not automatically linked when RNTester JS code is embedded in other projects. This is considered "legacy" loading and is generally discouraged, but is still showcased as an alernative way of loading resources.

I also modified the Image test to ensure that flag status is printed so it's obvious why the vector drawable hasn't loaded.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59585555

fbshipit-source-id: d42fb44d8846d8e7c7aa01dca4cec89ae85a9195
2024-07-15 12:39:06 -07:00
Nicola Corti
52237838dc Deprecate DeveloperSettings.isStartSamplingProfilerOnInit (#45442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45442

This deprecates also `DeveloperSettings.isStartSamplingProfilerOnInit`
so we can remove it in a future version of React Native.

This field is unused so you should not be using it at all.

Changelog:
[Android] [Changed] - Deprecate DeveloperSettings.isStartSamplingProfilerOnInit

Reviewed By: blakef

Differential Revision: D59757500

fbshipit-source-id: dc879ba46f2f937e5f259a4101646c2f060db548
2024-07-15 12:16:33 -07:00
rozele (Meta Employee)
8f27188037 Updates ViewConfig types to delegate isInAParentText context (#29872)
Summary:
## Summary

Now that HostContext determination for Fabric is a DEV-only behavior, we
can move the HostContext determination to resolve from the ViewConfig
for a given type. Doing this will allow arbitrary types to register
themselves as potential parents of raw text string children. This is the
first of two diffs for react as we'll:

1. Add the new property to the ViewConfig types
2. Update React Native to include the `supportsRawText` property for
`RCTText`, `RCTVirtualText`, `AndroidTextInput`, etc.
3. Switch the behavior of react to read from the ViewConfig rather than
a static list of types.

Changelog: [Internal]

## Test Plan

- yarn test
- yarn test --prod
- Pulled change into react-native, added `supportsRawText` props to
RCTText, RCTVirtualText, etc. ViewConfigs and confirmed everything type
checks.

DiffTrain build for commit a5cc797b88.

bypass-github-export-checks

Reviewed By: poteto

Differential Revision: D59641180

Pulled By: rozele

fbshipit-source-id: a3ddb1bc810a70d5f782e708cb845e3eae136d78
2024-07-15 10:58:38 -07:00
zhongwuzw
9e2f8859c4 Reland: [iOS] Fixes ellipsis carries background from trimmed text (#45412)
Summary:
Reland https://github.com/facebook/react-native/issues/39408 . Try to fix the crash https://github.com/facebook/react-native/issues/37926#issuecomment-2225113557. cc. javache I changed the range from glyph to character because all attributes related APIs are character range.

## Changelog:

[IOS] [FIXED] - Fixes ellipsis carries background from trimmed text

Pull Request resolved: https://github.com/facebook/react-native/pull/45412

Test Plan: https://github.com/facebook/react-native/issues/37926 .

Reviewed By: cipolleschi

Differential Revision: D59681679

Pulled By: javache

fbshipit-source-id: de4cb73e0304b8c0b0a40f4f6838b2c679747009
2024-07-15 10:53:35 -07:00
Blake Friedman
24997dc5ae allow use without @react-native-community/cli-server-api (#45311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45311

Allows Gradle and Xcode builds to continue without the rnc dependency.

Reviewed By: cipolleschi

Differential Revision: D59377223

fbshipit-source-id: b0daddae7377b8a0d2ee2a25b2ff10124e5db549
2024-07-15 09:28:58 -07:00
Zeya Peng
97882a16b8 Create Color<->rgba utils on all platforms (#45365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45365

## Changelog

As a followup to https://github.com/facebook/react-native/pull/45139

There I only implemented `hostPlatformColorFromRGBA` and `alpha/red/green/blueFromHostPlatformColor` on cxx platform, then used cxx platform specific method at some places. but really I should implement and use methods in `Color.h` that are platform agnostic

* cxx/android: platform color format is int32_t, RGBA are 8bit unsigned int ([0,255])
* windows: platform color format is `winrt::Windows::UI::Color` where RGBA props are 8bit unsigned ints ([0,255])
* apple: platform color format is `UIColor` where RGBA props are floats in [0,1]

[Internal]

previous change D58872165

Reviewed By: christophpurrer

Differential Revision: D59593659

fbshipit-source-id: 5d18419039817510e607d4e3f632c207d25c30a3
2024-07-15 09:23:21 -07:00
Samuel Susla
ccc234986d delete remainings of DELETE_TREE instruction (#45436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45436

changelog: [internal]

In D58355433, delete tree experiment was cleaned up. These are the remainings of the experiment that are no longer used. Let's delete them to clean up dead code

Reviewed By: javache

Differential Revision: D59732137

fbshipit-source-id: a22c0b14eda70e62817e80224f367ccb9006acc9
2024-07-15 08:56:46 -07:00
Peter Abbondanzo
aad9240fd4 Support loading vector drawables in ImageView (#45354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45354

Fresco has indicated that they have no plans to support loading vector assets and similar drawable types in Drawee-backed views ([issue](https://github.com/facebook/fresco/issues/329), [issue](https://github.com/facebook/fresco/issues/1463), [issue](https://github.com/facebook/fresco/issues/2463)). Guidance has been to instead load the vector drawable onto the backing image view ourselves. On the React Native side, having the ability to load vector drawables has been requested many times ([issue](https://github.com/facebook/react-native/issues/16651), [issue](https://github.com/facebook/react-native/issues/27502)).

I went this route over using a custom Fresco decoder for XML assets because vector drawables are compiled down into binary XML and I couldn't find a trivial, performant way to parse those files in a context-aware manner. This change only accounts for vector drawables, not any of the other XML-based drawable types (layer lists, level lists, state lists, 9-patch, etc.). Support could be added easily in the future by expanding the `getDrawableIfUnsupported` function.

## Changelog

[Android] [Added] - Added support for rendering XML assets provided to `Image`

Reviewed By: javache

Differential Revision: D59530172

fbshipit-source-id: 3d427c06238287e0a3b7f9570ac20e43d76126c7
2024-07-15 08:54:48 -07:00
Nicola Corti
cbcdb38433 Remove extra dot from close-pr.yml (#45441)
Summary:
This is just a minor nit to make it easier to copy-n-paste

## Changelog:

[INTERNAL] - Remove extra dot from close-pr.yml

Pull Request resolved: https://github.com/facebook/react-native/pull/45441

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D59752879

Pulled By: cortinico

fbshipit-source-id: caa398010b64024e2a0259d177762fd76082507f
2024-07-15 08:36:26 -07:00