Граф коммитов

403 Коммитов

Автор SHA1 Сообщение Дата
Riccardo Cipolleschi b0864fd9df Add tests in CI not to break Hermes-Xcode integration (#37616)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37616

Add tests in CircleCI to avoid that changes in Hermes can break the Xcode integration.

## Changelog:
[Internal] - Add CI tests to avoid to break the Hermes-Xcode integration

Reviewed By: cortinico

Differential Revision: D46265656

fbshipit-source-id: 176f1a33fe6944a68fb14b62e5c626fe30d296cc
2023-05-30 07:15:02 -07:00
Riccardo Cipolleschi 323b7f8536 Backporting a fix for hermesc on linux (#37596)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37596

This commit is a backport of this [commit](32327cc177) so that we build the right version of hermes in CI.

This also bumps the hermes keys to make sure that we are building it properly from now on.

## Changelog:
[Internal] - Fix Hermes versioning and bump hermes workspace keys

Reviewed By: cortinico

Differential Revision: D46225179

fbshipit-source-id: f00c9d20d37f3bd5689e0742063f98e3bfe373c2
2023-05-30 04:10:17 -07:00
Riccardo Cipolleschi 20e66db0be Revert D46225044: Add tests in CI not to break Hermes-Xcode integration
Differential Revision:
D46225044

Original commit changeset: 265364a0b4c1

Original Phabricator Diff: D46225044

fbshipit-source-id: bd3e903f973ad8989a4b05f3bf787cc1c01f0573
2023-05-26 09:26:51 -07:00
Riccardo Cipolleschi 37d582dccd Add tests in CI not to break Hermes-Xcode integration (#37594)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37594

This change add a test in circleCI to make sure that we don't break the integration between RNTester Hermes and Xcode

## Changelog:
[Internal] - Add circleci test to track the integration between Xcode and Hermes

Reviewed By: dmytrorykun

Differential Revision: D46225044

fbshipit-source-id: 265364a0b4c187ba20b5591b83c63896935a5184
2023-05-26 08:29:43 -07:00
Neil Dhar 84e35fb80f Avoid install target in Apple build (#37498)
Summary:
Avoid using the install target in Hermes when building frameworks for Apple platforms. Instead, explicitly build the targets we need for each platform, and copy over the files we need. This has a few advantages:

1. It gives RN fine control over the organisation of files in the destroot directory.
2. The current install target seems to copy JSI headers from Hermes instead of the supplied `JSI_DIR`. In practice, this should never be a problem but it is good to be consistent.
3. Building the install target needlessly builds unrelated targets. This slows down the build, and in some cases, we may not technically support those targets for the platform we are building for.

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

Test Plan:
CI is able to build and use Hermes

## Changelog:
[Internal]

Reviewed By: dmytrorykun

Differential Revision: D46097200

Pulled By: neildhar

fbshipit-source-id: 9630b0058f770b6a03aea51622cc6e5b2f8e217e
2023-05-24 10:15:59 -07:00
Riccardo Cipolleschi c56968c5ef Make CircleCI caches for hermesc be version dependent (#37452)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37452

Fixes #37428

We do have cache poisoning for hermesc on Windows and Linux due to reusing the same cache key among different
React Native version. This fixes it by specifying a cache key which is version dependent + it invalidates the
caches by defining a new key.

Changelog:
[Internal] [Fixed] - Make CircleCI caches for hermesc be version dependent

Reviewed By: cortinico

Differential Revision: D45909178

fbshipit-source-id: 830c87ae45739c7053342a68dac2ee7581945c1d
2023-05-23 03:34:20 -07:00
Riccardo Cipolleschi 81e2974037 Introduce CI tests to test dynamic frameworks in check (#37272)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37272

This change enables some tests on RNTester and on the Template to verify that we won't be breaking `use_frameworks!` again in the future.

## Changelog:
[iOS][Added] - Add tests to check use frameworks with dynamic linking.

Reviewed By: cortinico

Differential Revision: D45605977

fbshipit-source-id: 06f05aba427e78a7bb1d8dc835fa83d8550586db
2023-05-15 08:14:59 -07:00
Nicola Corti 758b74094b Store test artifacts for Android (#37269)
Summary:
We should store XML datas from the test we execute so when they fail it's easier to immediately see which test caused the failure.

## Changelog:

[INTERNAL] - Store test artifacts for Android

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

Test Plan: Wait for CI results

Reviewed By: cipolleschi

Differential Revision: D45603973

Pulled By: cortinico

fbshipit-source-id: e818b353816e10b3e4ed16bdb66dd4c8918a9c51
2023-05-05 07:01:00 -07:00
Nicola Corti 6f94cd272f Remove instructions from `Dockerfile.android` that are BUCK related. (#36958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36958

As we don't invoke `buck` anymore inside `Dockerfile.android` anymore,
those instructions can be removed.

Changelog:
[Internal] [Changed] - Remove instructions from `Dockerfile.android` that are BUCK related

Reviewed By: sammy-SC, arushikesarwani94

Differential Revision: D45086054

fbshipit-source-id: 5ed5e353f43b11784a4dcb930148ab264d4dd063
2023-04-18 11:54:36 -07:00
Nicola Corti 749588313e Bump react-native-android docker container to 8.0 (#36954)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36954

This bumps the docker container we use to the latest major.

Changelog:
[Internal] [Changed] - Bump react-native-android docker container to 8.0

Reviewed By: cipolleschi

Differential Revision: D45083111

fbshipit-source-id: 44285e3e9af9be352c23bb1066fed3c35f51fb29
2023-04-18 06:58:00 -07:00
Pranav Yadav ee271c84c2 chore: cleanup - rm unused files (Movies App) (#36913)
Summary:
The example **Movies App** *no longer exists*, no wonder; why no one noticed these files ;).
It makes sense to remove all files specifically related to it.
This diff removes such dir and files.

## Changelog:

[GENERAL][REMOVED] - Cleanup - remove  unused files (Movies App)

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

Test Plan: - `yarn test-ci` --> should be green.

Reviewed By: christophpurrer

Differential Revision: D45056787

Pulled By: cortinico

fbshipit-source-id: 56b8d39772c70d31f2ba65ad986477710fa9fa9d
2023-04-17 16:09:35 -07:00
Nicola Corti 7d7f48da41 Remove Buck OSS 1 setup. (#36900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36900

This commit effectively removes all the Buck 1 OSS infra code we do have inside
React Native as we'll need to rework most of it once we move to Buck 2

Changelog:
[Internal] [Changed] - Remove Buck OSS 1 setup

Reviewed By: mdvacca, cipolleschi

Differential Revision: D44956134

fbshipit-source-id: c0ad1914286c428480248658c4282df5477bba2b
2023-04-13 13:19:24 -07:00
Riccardo Cipolleschi cb88e75cf1 Fix Cocoapods for Xcode 14.3.0 (#36759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36759

On Thursday the 30th, Apple Released Xcode 14.3.0.
This Version of Xcode enforce some version checks for which React-Codegen, which supported iOS 11 as minimum supported version, could not be build anymore.

This change ensue that React-Codegen is always aligned to the min version supported by React Native.
Plus, it moves CircleCI's Xcode to 14.3.0, to keep this problem in Check.

While working on this, I figured that, with the monorepo, Ruby tests stopped working because they were in the wrong folder: I moved them in the right one.

## Changelog:
[iOS][Fixed] - Make React Native build with Xcode 14.3.0 and fix tests

Reviewed By: blakef

Differential Revision: D44605617

fbshipit-source-id: 3ec1f5b36858ef07d9f713d74eb411a1edcccd45
2023-04-02 03:32:15 -07:00
Riccardo Cipolleschi 0443c2aa71 Fix: Remove installation of Python 3 in CI for Windows (#36596)
Summary:
We used to have to install python 3 on windows. Starting from yesterday (22/03/2023) the `build_hermesc_window` job started failing because Python3 is already installed on the default machine.

## Changelog:

[INTERNAL] [FIXED] - Skip installing python 3 on Windows as it's already there.

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

Test Plan: CircleCI must be green

Reviewed By: hoxyq

Differential Revision: D44330936

Pulled By: cipolleschi

fbshipit-source-id: b58190f707be309d919aceb80af717046c9476b4
2023-03-23 04:45:27 -07:00
Dmitry Rykun 7b86e3aaef Remove unused js_coverage job from CircleCI (#36513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36513

We don't use JS test coverage badge on GitHub. Collecting this information is performed by `coveralls` package that is unmaintained for at least 2 years. Also it depends on `request` package that has security vulnerabilities, and became deprecated in 2020.

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D44168060

fbshipit-source-id: f76ae28f42b65e320a71dc227b2d07274a96f24e
2023-03-21 11:06:24 -07:00
Ruslan Lesiutin 4b6b706680 Update paths in a new setup to fix nightlies (#36535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36535

Changelog: [Internal]

- We should be copying `/packages/react-native/package.json`, not root `package.json`
- Updating CircleCI config's target directory where hermes artifacts should be copied

Reviewed By: cortinico

Differential Revision: D44214309

fbshipit-source-id: af84897df3931c6a2d6a902b33c71b665c3fcefc
2023-03-20 07:05:52 -07:00
Nicola Corti 5cbabe30d3 Use the default `build` task rather than `buildAll`
Summary:
We can now use the `build` lifecycle task rather than a custom buildAll.
This task will also run linters and other checks on our builds.

Speficially I realized we were missing some permission in the manifest of RN-Tester
which were missed once we bumped to SDK 33.

Changelog:
[Internal] [Changed] - Use the default `build` task rather than `buildAll`

Reviewed By: cipolleschi

Differential Revision: D44055845

fbshipit-source-id: c9adbbeaaaf7ab8a8000fc1dce84ec39427fb26e
2023-03-17 10:26:34 -07:00
Ruslan Lesiutin 714b502b0c | RN Monorepo | Migrate to package (#36434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36434

Changelog: [Internal]

This is a squashed stack of 18 commits, starting from D43202126

allow-large-files

Reviewed By: cortinico

Differential Revision: D43977381

fbshipit-source-id: 0da552ddb85f2f61a0be0ef071915b35f3f8555c
2023-03-17 05:03:25 -07:00
Dmitry Rykun b07cf33279 Use RN Build Utils for Building Hermes Artifacts
Summary:
We moved Hermes some build utils from [Hermes repo](https://github.com/facebook/hermes/tree/main/utils) to [React Navtie repo](https://github.com/facebook/react-native/tree/main/sdks/hermes-engine/utils) a while ago to have more control over them. However some paths on the CI were not updated. We continued to use old build scripts for Hermes prebuilds. Some unfortunate side effects are:
- `HERMES_ENABLE_DEBUGGER` is [hardcoded to true](https://github.com/facebook/hermes/blob/main/utils/build-apple-framework.sh#L65). That makes Hermes much slower in Release configuration.
- BUILD_TYPE is [set to Release](https://github.com/facebook/hermes/blob/main/utils/build-apple-framework.sh#L10) instead of `MinSizeRel` which inreases Hermes binary size.

This diff copies these build utils from RN to Hermes source directory before we perform Hermes build.

Changelog
[Internal]

Reviewed By: cipolleschi

Differential Revision: D44066721

fbshipit-source-id: f45ad6a31fb01c10199f69cc7bbcbbc83b793d34
2023-03-15 11:13:17 -07:00
Riccardo Cipolleschi 50068d0070 Improve robustness of iOS CircleCI Pipelines (#36419)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36419

After migrating to Xcode 14.2.0, some contributors were receiving CircleCI Machines that were not able to install Ruby 3.2.0.

This change should improve the robustness of the pipelines, ensuring that `ruby-build` can always find the version of Ruby it needs

## Changelog:
[internal] - Make sure CircleCI always find the right version of Ruby

Reviewed By: cortinico

Differential Revision: D43944878

fbshipit-source-id: 89d9fcc6ae346003e96c2a8f4103a83a7d2f3204
2023-03-09 08:40:05 -08:00
Riccardo Cipolleschi f264fe12df Bump Xcode to 14.2.0 in circleCI (#36388)
Summary:
In CricleCI we are still using Xcode 14.0.1.
This version will be removed from CircleCI this Thursday, so we have to update it.

## Changelog
[Internal] - Bump xcode in CircleCI to 14.2.0

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

Test Plan: CircleCI should be Green

Reviewed By: dmytrorykun

Differential Revision: D43873750

Pulled By: cipolleschi

fbshipit-source-id: 8b796c0961647fce103d2659036bf5f9037fe90a
2023-03-07 08:45:22 -08:00
Riccardo Cipolleschi aac71507fa Add tests with more recent Rubies (#36376)
Summary:
This change add more tests for iOS, using different versions of Ruby

## Changelog
[iOS][Added] - Added smoke tests for iOS with Ruby 2.7.7 and 3.2.0

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

Test Plan: CircleCI must be green.

Reviewed By: blakef

Differential Revision: D43825344

Pulled By: cipolleschi

fbshipit-source-id: 8d3f5a2d9688f4d58f0ad5573d7b21e059cab523
2023-03-06 02:56:26 -08:00
Riccardo Cipolleschi b6f8210811 Use Ruby 2.6.10 in CI (#36361)
Summary:
Starting from RN 0.72, we would like to be more permissive in which version of Ruby our users can use. This means that we have to make sure that our pipeline works with various
versions of Ruby, especially the lowest one, which is 2.6.10.

This change make sure that we run all the CI jobs with version 2.6.10

## Changelog

[IOS] [CHANGED] - Use Ruby 2.6.10 in CI

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

Test Plan: CircleCI must be green

Reviewed By: blakef

Differential Revision: D43824143

Pulled By: cipolleschi

fbshipit-source-id: ecbeb66667a29d9ed07b86c099ad424380a934a7
2023-03-06 02:56:26 -08:00
Riccardo Cipolleschi 0f56cee8e1 Update Gemfile to require Cocoapods 1.12.0 (#36321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36321

This change bumps Cocoapods to 1.12.0. This last release fixes a bug for which cocoapods was not working with Ruby 3.2.0

## Changelog
[iOS][Changed] - Bumbed version of Cocoapods to support Ruby 3.2.0

Reviewed By: blakef

Differential Revision: D43655787

fbshipit-source-id: 6954ac8271daa7894e57f6d6104ed4d549490695
2023-02-28 07:14:02 -08:00
Nicola Corti 81dd3afe0b Bump Gradle to 8.x (#36269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36269

This bumps our project to build on Gradle 8.x
All the necessary issues have already been resolved so everything should be green.
Gradle version has been bumped also inside the template and RNGP.

Changelog:
[Android] [Changed] - Bump Gradle to 8.x

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D43534184

fbshipit-source-id: ca1fd6799ff6d776743de2b2d809fc54bc533440
2023-02-27 13:47:09 -08:00
Riccardo Cipolleschi 23eb380f65 Enable CircleCI tests for Use_Frameworks with the New Arch (#36148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36148

This change enables 4 noew tests to make sure that `use_frameworks!` with the New Architecture don't break

Note: We may have to publish the codegen to make this work on CircleCI properly

## Changelog:
[iOS][Added] - Added tests for use_frameworks! with the new architecture

Reviewed By: cortinico, dmytrorykun

Differential Revision: D43271625

fbshipit-source-id: fe1fa4be660f933e0113f44a0467eaa1fa3669ca
2023-02-20 11:50:10 -08:00
Blake Friedman ed8a3e08e2 brew should overwrite existing python links (#36192)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36192

Builds are failing on CI because brew bails out when it tries installing Python 3.1. The image already has an existing version of Python 3, which we should overwrite.

{F876436464}

This seems to be a known issue [1] with Brew. In this case it seems safe to overwrite.

Changelog:
[General][Changed] - Brew overwrites system Python 3.

[1] https://github.com/actions/setup-python/issues/577#issuecomment-1431468702

Reviewed By: cipolleschi

Differential Revision: D43391941

fbshipit-source-id: 9b0cb234eeb0b7473b17b5ebfa6ed12c6448760f
2023-02-17 08:08:39 -08:00
Blake Friedman 2cfb34f6bb log out brew install messages (#36191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36191

Brew commands used to be piped to /dev/null. We weren't able to investigate brew install failures because of this.

# Changelog:

[General][Changed] - log out brew stdout messages in CircleCI

Reviewed By: robhogan, cortinico

Differential Revision: D43389785

fbshipit-source-id: 4dc56125ef5fb87b181ad0b8f9069995ad896812
2023-02-17 05:43:22 -08:00
Saad Najmi 7208cd6384 Switch to xcbeautify (#36131)
Summary:
`xcpretty` is no longer maintained. Let's switch to `xcbeautify`, which is faster and is maintained. I'm also biased because `xcpretty` hid an error from me that `xcbeautify` did not.

## Changelog

[INTERNAL] [CHANGED] - Move CI from `xcpretty` to `xcbeautify`

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

Test Plan:
Locally yarn `yarn test-ios` and got output that looks like this:

<img width="1245" alt="Screenshot 2023-02-11 at 9 34 07 PM" src="https://user-images.githubusercontent.com/6722175/218291538-07760f94-7e52-4919-b603-8a35a623fc9a.png">

I also confirmed a junit report that looks like this was generated:
```xml
<testsuites name="Selected tests" tests="193" failures="0">
    <testsuite name="RCTLoggingTests" tests="1" failures="0">
        <testcase classname="RCTLoggingTests" name="testLogging" time="0.175" />
    </testsuite>
    <testsuite name="RCTUIManagerScenarioTests" tests="3" failures="0">
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToAddRemoveAndMove" time="0.001" />
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToAddViews" time="0.000" />
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToRemoveViews" time="0.001" />
    </testsuite>
    ...
```

Reviewed By: cortinico

Differential Revision: D43232774

Pulled By: cipolleschi

fbshipit-source-id: fda4e217d4df55b5088026d6911d3dc6c8c9e824
2023-02-15 04:20:20 -08:00
Ruslan Lesiutin 28d8f25c76 fix: update executor for packages publishing workflow (#36146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36146

Changelog: [Internal]

- While working on 0.71.3, it was discovered that `react-native-codegen` package is being published almost empty (without `lib` folder)
- The reason for it is that `prepare` script is not being executed
- The main reason for it is npm v6, which requires adding `unsafe-perm` flag for it: https://www.vinayraghu.com/blog/npm-unsafe-perm
- Instead of using this flag, changing executor to `nodelts`, which has node v18 and npm v8
- Also adding `run_yarn` before running the script, because `react-native/codegen` uses external dependencies (such as rimraf) for its build scripts

Reviewed By: cipolleschi

Differential Revision: D43248175

fbshipit-source-id: d12b93decbf408713e309fe8be75d8d5ec994868
2023-02-14 07:06:53 -08:00
Nicola Corti 9eaf6f5bdb Move test-docker-android from GH Actions to CircleCI (#36093)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36093

The Test Docker Android job is flaky as sometimes fetching artifacts from remote
returns different hashes.
I'm moving the job to CircleCI (so it's faster) + I'm using the `buck_fetch.sh`
script we already have which has a retry logic.

Changelog:
[Internal] [Changed] - Move test-docker-android from GH Actions to CircleCI

Reviewed By: javache

Differential Revision: D43121477

fbshipit-source-id: 1df114fd3ad9445a4a5dc7834bf811c3476322cd
2023-02-08 12:51:09 -08:00
Nicola Corti 2607602b8a Reduce flakyness by not downloading extra packages (#36077)
Summary:
Yesterday CircleCI was extremely flaky due to us trying to `apt install` extra packages. This mitigates one scenario where we try to redownload `jq` and `shellcheck`.

I've moved to use a container which contains those packages already

## Changelog

[INTERNAL] - Reduce flakyness by not downloading extra packages

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

Test Plan: Will wait for a green CI

Reviewed By: cipolleschi

Differential Revision: D43080349

Pulled By: cortinico

fbshipit-source-id: 6527c5ad129f47d8b5f02bf207e1af67a095afa1
2023-02-07 07:22:30 -08:00
Nicola Corti 9e4b4ef2d5 Remove the `react-native-bot` context from CircleCI
Summary:
While working on T143721371 I've noticed that we still have an exposed context
for `react-native-bot` which gives access to `PAT_TOKEN` and `PAT_USERNAME`.
As those two variables are unused, we can fully clean this us.

Changelog:
[Internal] [Changed] - Remove the `react-native-bot` context from CircleCI

Reviewed By: cipolleschi

Differential Revision: D42886196

fbshipit-source-id: 4eba7a53557fe7af7d87650052630eea2d2d3934
2023-01-31 08:00:08 -08:00
Riccardo Cipolleschi 8056cd7f05 Add Tests in CircleCI to check dynamic frameworks with the old arch (#36003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36003

This diff adds 4 tests in CircleCI to make sure we don't regress in the support of Dynamic Frameworks for the old architecture.

## Changelog
[iOS][Fixed] - Add CircleCI tests for dynamic frameworks with the Old Architecture.

Reviewed By: cortinico

Differential Revision: D42829895

fbshipit-source-id: 5669be45d4f55161a11a6ece161b2a2aa384a644
2023-01-30 04:25:26 -08:00
Nicola Corti d30bd1bb21 Migrate nightly from scheduled workflow to scheduled pipeline (#35977)
Summary:
I'm moving nightlies from scheduled workflow to scheduled pipeline.
We're not able to manually retrigger nightlies as they're a scheduled workflow and don't expose a parameter. Here I'm cleaning it up.

Plus I'm:
1. Removing the `main_only` reference which is unused
2. Setting up the `run_release_workflow` and `run_nightly_workflow` parameters.

## Changelog

[INTERNAL] - Migrate nightly from scheduled workflow to scheduled pipeline

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

Test Plan: Will wait for CI results.

Reviewed By: cipolleschi

Differential Revision: D42776969

Pulled By: cortinico

fbshipit-source-id: d4ef9654d23cb91f85ce2b38e75e27dc0c575e95
2023-01-27 01:33:21 -08:00
Nicola Corti 477f546d1b Bump CMake to 3.22.1 to properly honor CMAKE_BUILD_TYPE (#35857)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35857

It seems like there is an incompatibility between NDK 23 (shipped in 0.71)
and the usage of custom `CMAKE_BUILD_TYPE` we do for Hermes.

Specifically the `-DCMAKE_BUILD_TYPE=Release` we specify for the debug
variant of Hermes is partially ignored by the new Android native build toolchain.
See https://github.com/android/ndk/issues/463 for mentions on how the
toolchains requires CMake 3.20+

As AGP 7.3 defaults to use CMake 3.18 unless specified, and NDK 23 unless specified.
AGP 7.4 defaults to use CMake 3.22 unless specified, and NDK 23 unless specified.
See: https://developer.android.com/studio/releases/gradle-plugin#7-4-0

Here I'm:
1. Bumping the docker image to an image that contains the CMake 3.22
2. Updating the logic for building `react-native` & `hermes-engine` to use 3.22
3. Provide fallbacks if the user specified `CMAKE_VERSION`

Template tests will run on AGP 7.3 and will still use CMake 3.18, but I forecast
no problem there as the user is not supposed to specify custom `CMAKE_BUILD_TYPE`.
This is only a problem as we build `hermes-engine` with custom build types.

Changelog:
[Android] [Fixed] - Bump CMake to 3.22.1 to properly honor CMAKE_BUILD_TYPE

Reviewed By: cipolleschi

Differential Revision: D42544864

fbshipit-source-id: efd0f51120370fb808337c201df31d71f4ddfdbc
2023-01-18 09:49:27 -08:00
Riccardo Cipolleschi 4c5fa6e372 fix: use properly exclude parameter of matrix (#35794)
Summary:
Update the CircleCI configuration to use the proper `exclude` parameter of matrix rather then bootstrap a machine and then kill it.

## Changelog

<!-- 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
-->
## Changelog
[Internal] - Use the `exclude` parameter of matrices to avoid spinning up unnecessary machines

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

Test Plan: The number of jobs on CircleCI should decrease.

Reviewed By: dmytrorykun

Differential Revision: D42475445

Pulled By: cipolleschi

fbshipit-source-id: 3d733ac459a3bc9747440a62cb2caecb7a235fec
2023-01-12 07:36:45 -08:00
Nicola Corti 573734f4e6 Remove PAT_TOKEN and PAT_USERNAME from CircleCI (#35808)
Summary:
This is a cleanup change needed after the CircleCI security incident.
We should be using the `Authorization: Bearer` header to trigger `rn-diff-purge` instead of using username & password authentication.

Source: https://docs.github.com/rest/reference/repos#create-a-repository-dispatch-event

## Changelog

[INTERNAL] - Remove PAT_TOKEN and PAT_USERNAME from CircleCI

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

Test Plan:
I've tested this locally with:

```
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
                    -H "Accept: application/vnd.github.v3+json" \
                    -H "Authorization: Bearer [...]" \
                    -d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"test.test.test\" }}"
```

and the run was succesfully fired by react-native-bot:
https://github.com/react-native-community/rn-diff-purge/actions/runs/3894079133

Reviewed By: lunaleaps

Differential Revision: D42456065

Pulled By: cortinico

fbshipit-source-id: 475e9ca80760522cc08bad37d85c5af6727922d3
2023-01-11 10:58:25 -08:00
Ruslan Lesiutin ec28c5bbaa feat(react-native-github): a script to automate patch version bumping of packages (#35767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35767

Changelog: [Internal]

Introducing a script, which can be used to identify all packages inside `/packages`, which contain any changes after the last time its version was changed

How it works step by step:

```
check that no git changes are present

for each package:
    if package is private -> skip

    grep id of the last commit that changed package
    grep id of the last commit that changed version of the package

    if these ids are different:
        bump package patch version

commit changes if required
```

Can be executed only in git environment and by running: `node ./scripts/bump-all-updated-packages`

 ---

Also adding a separate script `align-package-versions.js`, which can be used to update versions of packages inside consumer packages

```
check that no git changes are present

for each package x:
   for each package y:
       if y has x as dependency:
           validate that y uses the latest version of x

if some changes were made:
   run yarn
```

 ---

Q: Why `run_yarn` step was removed from CircleCI flow?
A: For *-stable branches, there are no yarn workspaces and all packages are specified as direct dependencies, so if we update `react-native/assets-registry` to the next version, we won't be able to run `yarn` for react-native root package, because updated version is not yet published to npm

To avoid this, we first need publish new versions and then update them in consumer packages

 ---
The final flow:
1. Developer uses `node ./scripts/bump-all-updated-packages` to bump versions of all updated packages.
2. Commit created from step 1 being merged or directly pushed to `main` or `*-stable` branches
3. A workflow from CircleCI publishes all updated versions to npm
4. Developer can use `align-package-versions.js` script to create required changes to align all packages versions

Reviewed By: cortinico

Differential Revision: D42295344

fbshipit-source-id: 54b667adb3ee5f28d19ee9c7991570451549aac2
2023-01-10 13:23:06 -08:00
Nicola Corti 97e844fad0 Update fingerprint for SSH deploy key (#35791)
Summary:
Rotating a private SSH key we had left to rotate.

## Changelog

[INTERNAL] - Update fingerprint for SSH deploy key

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

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D42413025

Pulled By: cortinico

fbshipit-source-id: 571f304e8cc2dad19c41e5413ed3c7d4c078ba60
2023-01-09 04:34:41 -08:00
Nicola Corti 44cb07b40a Remove unused .netrc file from CircleCI (#35785)
Summary:
Removing a stale configuration that was configuring username/password before publishing to NPM. This is effectively unused + the Github Token there is invalid therefore can be removed.

## Changelog

[INTERNAL] - Remove unused .netrc file from CircleCI

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

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D42385163

Pulled By: cortinico

fbshipit-source-id: 0dbbf44459d59f792da4221d6100800a2f4efda2
2023-01-06 07:19:02 -08:00
Riccardo Cipolleschi cb9eaa6db0 Refactor hermes logic to make it branch agnostic (#35709)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35709

This change refactors the logic to choose which version of hermes we have to pick

## Changelog:
[iOS][Changed] - Refactor hermes choosing logic

Reviewed By: cortinico, dmytrorykun

Differential Revision: D42211405

fbshipit-source-id: d19c0f2c523c5596d18a1f904e3b26d96ea1a77a
2023-01-05 06:58:38 -08:00
Ruslan Lesiutin 7f29357c7c refactor(scripts): use forEachPackage instead of `yarn workspaces info` (#35633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35633

Changelog: [Internal]

These changes add usage of `forEachPackage` as a replacement for `yarn --json workspaces info`.

This is because at some point in release cycle there is a script which removed `workspaces` block from react-native's `package.json`, so `yarn --info workspaces info` produces an error

Reviewed By: cortinico

Differential Revision: D41996732

fbshipit-source-id: 2c62c1a5eb41d711c563f9f7b0de3d67fc11823d
2022-12-14 03:04:06 -08:00
Ruslan Lesiutin 83afdafae4 feat(react-native-github): automate publishing bumped packages via circleci (#35621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35621

Changelog: [Internal]

1. Added `for-each-package.js` script. This can be used to iterate through all of the packages inside `/packages` with the access to package manifest. This soon can be used as a replacement for `yarn workspaces --info`
2. Added `find-and-publish-all-bumped-packages.js` script. This script iterates through all the packages and detects if the version was changed via `git log -p` (same as `git diff`). If so, it tries to publish it to npm.
3. Added corresponding job and workflow to CircleCI config, which will use this script

Reviewed By: cortinico

Differential Revision: D41972733

fbshipit-source-id: c5d0ed5b852b744a699ecb88861ea3e82200e1f3
2022-12-14 02:17:16 -08:00
Dmitry Rykun 65e0f79f69 Backport fix: update CircleCI config to use the RN version in Hermes workspace caching (#35617)
Summary:
This is a backport of 0edcbc30c8. It fixes inconsistencies in caching strategies of Hermes tarball and Hermes workspace on CircleCI.

## Changelog

[INTERNAL] [FIXED] - Update CircleCI config to use the RN version in Hermes workspace caching.

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

Test Plan:
1. Create and push a new branch.
2. Change version in. react-native/package.json
3. Push those changes.

Before:
CircleCI restores cached Hermes workspace for the old version.

After:
CircleCI creates new workspace for the new version.

Reviewed By: cipolleschi

Differential Revision: D41970943

Pulled By: dmytrorykun

fbshipit-source-id: 7e343b7a8d4b1c5a63016ec53538abe4ad7808cc
2022-12-13 04:19:43 -08:00
Blake Friedman d9666962f7 Fix test_windows by caching choco deps (#35399)
Summary:
A flakey CDN is 404'ing the Java dep.  Caching the Choco dependencies should stop this.

## Changelog

[Internal] [Fixed] - Cache Choco dependencies to stop erratic 404s on Java 8 install.

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

Test Plan: Bump the PR to see if it's caching.

Reviewed By: huntie

Differential Revision: D41684462

Pulled By: blakef

fbshipit-source-id: f3eac9e8a00be33f7c3f0996f35abb63146cb3c4
2022-12-02 07:32:30 -08:00
Thibault Malbranche dc3355920d chore: rename normalize-color to normalize-colors (umbrella 480) (#34571)
Summary:
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - Rename normalize-color to normalize-colors as part of https://github.com/react-native-community/discussions-and-proposals/pull/480

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

Reviewed By: cortinico

Differential Revision: D39235696

Pulled By: hoxyq

fbshipit-source-id: b6d5fcae9fb5c953c2f7b48f73a95cd883ff8f63
2022-12-01 08:46:57 -08:00
Riccardo Cipolleschi 4e8526c829 Add CircleCI tests for use frameworks (#35497)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35497

In 0.71.0-RC.2, we had a regression in `use_frameworks!`.

This adds some CircleCI jobs to make sure we do not regress on those. It also updates the template to support these tests.

## Changelog
[iOS][Added] - CircleCI jobs to keep the use_framework! setup in check for the Old Arch

Reviewed By: cortinico

Differential Revision: D41551288

fbshipit-source-id: 531fabb1a7b6aceab2926bb83cf2887129df1776
2022-11-29 08:53:50 -08:00
shivenmian b7a85b59b5 chore: renamed react-native-codegen to @react-native/codegen (#34804)
Summary:
Renamed react-native-codegen package to react-native/codegen and updated references, without changing the folder name; part of RFC480 (https://github.com/facebook/react-native/issues/34692). Follow-up from https://github.com/facebook/react-native/pull/34578

## Changelog

[General] [Changed] - Renamed react-native-codegen package to react-native/codegen and updated references

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

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

Reviewed By: cortinico

Differential Revision: D39883584

Pulled By: hoxyq

fbshipit-source-id: 0ef384b75c6edd248b31e37b8f05f64b4d39ca6f
2022-11-28 08:28:51 -08:00
Ruslan Lesiutin 6f11b10a88 refactor(react-native-gradle-plugin): rename react-native-gradle-plugin to @react-native/gradle-plugin (#35480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35480

Changelog:
[General][Changed] - rename react-native-gradle-plugin to react-native/gradle-plugin

Reviewed By: cipolleschi

Differential Revision: D41532746

fbshipit-source-id: 67b936a211ec8b91a2a96ca22145cbea94ba3e8c
2022-11-25 10:29:36 -08:00