Commit Graph

794 Commits

Author SHA1 Message Date
Riccardo Cipolleschi d669ff7df8 [iOS][Privacy Manifest] Set up privacy manifest for React Native 0.71 (#44281)
* add privacy manifest to pod install

Summary:
Changelog: [iOS][Added]

this creates the RN privacy manifest in the ios build step if user has not created one yet. the reasons have been added for the following APIs:

NSPrivacyAccessedAPICategoryFileTimestamp
- C617.1: We use fstat and stat in a few places in the C++ layer. We use these to read information about the JavaScript files in RN.

NSPrivacyAccessedAPICategoryUserDefaults
- CA92.1: We access NSUserDefaults in a few places.
1) To store RTL preferences
2) As part of caching server URLs for developer mode
3) A generic native module that wraps NSUserDefaults

NSPrivacyAccessedAPICategorySystemBootTime
- 35F9.1: Best guess reason from RR API pulled in by boost

Reviewed By: cipolleschi

Differential Revision: D53687232

fbshipit-source-id: 6dffb1a6013f8f29438a49752e47ed75c13f4a5c

* add privacy manifest to hello world template

Summary:
Changelog: [iOS][Added]

this change will be included in the RN CLI. so all new apps running the RN CLI to get created will get this manifest. the reasons have been added for the following APIs:

NSPrivacyAccessedAPICategoryFileTimestamp
- C617.1: We use fstat and stat in a few places in the C++ layer. We use these to read information about the JavaScript files in RN.

NSPrivacyAccessedAPICategoryUserDefaults
- CA92.1: We access NSUserDefaults in a few places.
1) To store RTL preferences
2) As part of caching server URLs for developer mode
3) A generic native module that wraps NSUserDefaults

NSPrivacyAccessedAPICategorySystemBootTime
- 35F9.1: Best guess reason from RR API pulled in by boost

Reviewed By: cipolleschi

Differential Revision: D53682756

fbshipit-source-id: 0426fe0002a3bc8b45ef24053ac4228c9f61eb85

---------

Co-authored-by: Phillip Pan <phillippan@meta.com>
2024-04-26 14:27:37 +01:00
Riccardo Cipolleschi 2944ca6554 [RN][iOS][0.71] Fix flipper for Xcode 15.3 2024-03-06 19:31:18 +00:00
Riccardo Cipolleschi c38cdb60ca [RN][iOS] Fix flags 2024-01-10 13:26:12 +00:00
Ken Tominaga 16a605b6a3 Fix overriding EXCLUDED_ARCHS when installing Hermes on RN v0.71 (#39763) 2023-12-19 14:35:12 +00:00
Riccardo Cipolleschi 4b386c9e87 cipolleschi/fix CI (#40793) 2023-10-11 17:51:03 +01:00
Marek Fořt 287482e57f [Local] Xcode 15 patch (#39754)
* [Local] Xcode 15 patch

* Update rn-tester pods
2023-10-04 15:57:29 +02:00
Riccardo Cipolleschi 9c2efff20d [LOCAL] Copy hermes ruby files to hermes folder in local E2E test (#39577) 2023-09-22 14:35:03 +01:00
Thibault Malbranche 63bb3ba5a9 [Local]: fix min_ios_version after cherry picks 2023-09-19 13:35:38 +02:00
Riccardo Cipolleschi 5a671c130b Fix Xcode 15 RC issues (#39474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39474

When it comes to Xcode 15 RC, we are aware of two issues:
1. `unary_function` and `binary_function` not available in Cxx17
2. [Weak linking](https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking) is not supported anymore.

This change should fix both of the issues, adding the flags to allow for `unary_function`and `binary_function` to be called and adding the `-Wl -ld_classic` flag to `OTHER_LDFLAGS` in case Xcode 15 is detected.

[Internal] - add the `_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION` and the `-Wl -ld_classic` flags to projects when needed

Reviewed By: dmytrorykun

Differential Revision: D49319256

fbshipit-source-id: bb895f1e60db915db79684f71fa436ce80b42111
2023-09-19 13:32:33 +02:00
Riccardo Cipolleschi f6107b6c79 Bump IPHONEOS_DEPLOYMENT_TARGET to 13.4 for 3rd party pods (#39478)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39478

When testing Xcode 15, we realized that a few pods we do not control directly have the IPHONEOS_DEPLOYMENT_TARGET set to old versions of iOS.
We can update that setting to silence the warning with Cocoapods and this is what this script does.

Notice that bumping that setting generated other warning as some APIs have been deprecated.

[Internal] - Bump min IPHONEOS_DEPLOYMENT_TARGET for 3rd party pods

Reviewed By: dmytrorykun

Differential Revision: D49274837

fbshipit-source-id: 584d105c76d654daa2ecf5eb2f1b9381e70f567a
2023-09-19 13:28:12 +02:00
Lorenzo Sciandra e4ab2b2d58 [LOCAL] augment forEachPackage to accept optional excludes and add for the bump and trigger release script 2023-08-21 17:29:03 +01:00
Lorenzo Sciandra 4f82350679 Revert "[LOCAL] skip un-semver packages in 71 branch"
This reverts commit a90485a957.
2023-08-21 17:16:16 +01:00
Lorenzo Sciandra a90485a957 [LOCAL] skip un-semver packages in 71 branch 2023-08-21 16:22:47 +01:00
Riccardo Cipolleschi 22d1e89cbb Add scripts and pipeline to poll for maven (#38980) (#39039) 2023-08-16 16:26:50 +02:00
Lorenzo Sciandra 209e743dc9 chore(releases): improve bump oss script to allow less human errors (#38666) (#38890)
Summary:
One of the limitations of the existing flow for the release crew is that they need to manually remember to publish all the other packages in the monorepo ahead of a new patch release - this PR modifies the logic for the bump-oss-version script (and makes it available via yarn) so that it will not run if:
* there are git changes lying around
* if some of the packages need a new release

it required a bit of refactoring to extract some portions of the logic from the bump-all-package-versions script, but I think the end result is pretty decent.

## Changelog:

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

Pick one each for the category and type tags:

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

[INTERNAL] [CHANGED] - improve bump oss script to allow less human errors

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

Test Plan:
* checkout this branch
* comment L54 of bump-oss-version.js (to remove the check on the branch name)
* run `yarn bump-all-updated-packages`, verify that it works and that it detects that some packages have unreleased code
* run `yarn bump-oss-version -t asd -v asd` (the "fake" parameters are needed to pass the yargs check), verify that it will throw an error because it finds a package that has unreleased code

Reviewed By: mdvacca

Differential Revision: D48156963

Pulled By: cortinico

fbshipit-source-id: 2473ad5a84578c5236c905fd9aa9a88113fe8d22

# Conflicts:
#	scripts/publish-npm.js

re-add the file

nit

# Conflicts:
#	package.json
2023-08-16 13:26:04 +02:00
Riccardo Cipolleschi 7636e4c102 [LOCAL] Download artifacts from CI to speed up testing (#37971) (#38612)
Co-authored-by: Riccardo Cipolleschi <cipolleschi@fb.com>
resolved: https://github.com/facebook/react-native/pull/37971
2023-07-25 16:30:49 +01:00
Tommy Nguyen fc1abe1d69 fix(ios): fix pod install --project-directory=ios failing (#37993) 2023-06-23 13:44:17 +02:00
Lorenzo Sciandra 5bd1a4256e [LOCAL] Make 0.70 compatible with Xcode 15 (thanks to @AlexanderEggers for the commit in main) 2023-06-14 10:38:11 +01:00
Lorenzo Sciandra 509f8f261e [LOCAL] fix definition of local mock for ruby test 2023-04-03 15:32:34 +01:00
Lorenzo Sciandra 0010c3807d fix(xcode): backport Xcode 14.3 fix to 71 (#36769) 2023-04-03 14:49:34 +01:00
fortmarek 5162e0b903 Use packaged react-native in test-e2e-local script (#36703)
Summary:
The current `test-e2e-local` script had two bugs:
- On [this](https://github.com/facebook/react-native/blob/c1c22ebacc4097ce56f19385161ebb23ee1624b3/scripts/test-e2e-local.js#L219) line we were initializing a new RN project with the packed `react-native` created [here](https://github.com/facebook/react-native/blob/c1c22ebacc4097ce56f19385161ebb23ee1624b3/scripts/test-e2e-local.js#L211)
- We were updating the local RN version after running `npm pack` [here](https://github.com/facebook/react-native/blob/c1c22ebacc4097ce56f19385161ebb23ee1624b3/scripts/test-e2e-local.js#L214). This meant that the version inside the packaged `react-native-xyz.tgz` was not updated since we ran `pack` before updating it. This was fine since the `init` command was using the local `react-native` repository instead of the packed version.

## Changelog:

[INTERNAL] [FIXED] - Use packaged react-native in test-e2e-local script
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[INTERNAL] [FIXED] - Use packaged react-native in test-e2e-local script

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

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

Test Plan:
- Run `yarn test-e2e-local -t RNTestProject -p Android`. The command should succeed.

I am not completely sure how to double check that we are using the packed version. Locally, I have a `fsmonitor--daemon.ipc` in my `react-native/.git` that can't be copied. The `.git` folder would be copied only when `cli.js init` was called with the whole repository  – which is how I found out about the issue in the first place.

Reviewed By: hoxyq

Differential Revision: D44504599

Pulled By: cipolleschi

fbshipit-source-id: e57e2858bab46d4f978eed3cbaf3e504138594b8

# Conflicts:
#	scripts/test-e2e-local.js
2023-03-30 10:52:26 +01:00
Ruslan Lesiutin 7488e9a37a Add option to commit with generic message (#36421)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36421

Changelog: [Internal]

Adding an extra choice for commit question, user can now choose between three options:
1. Commit with generic message, no further actions needed
2. Commit with custom message, intercative VIM input will open
3. Not committing anything

Reviewed By: cortinico

Differential Revision: D43943526

fbshipit-source-id: 014215105d192961486b7d1c697f491697492812
2023-03-28 10:47:33 +01:00
Riccardo Cipolleschi 1d22e29146 chore: Remove ruby-version from 0.71 (#36423)
* chore: Remove ruby-version from 0.71

* Update Gemfile

* Update Gemfile

---------

Co-authored-by: Riccardo Cipolleschi <cipolleschi@fb.com>
2023-03-10 10:54:41 +00:00
Lorenzo Sciandra be199f8973 [LOCAL] enforce iPhone 14 simulator on run ios E2E script 2023-03-08 14:04:19 +00:00
Ruslan Lesiutin 9c4d0a8695 fix: update publishing packages tag message prefix (#36348)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36348

Changelog: [Internal]

Turns out that Phabricator strips `@` symbol from `@...` tags when exports commits to GitHub. Proposing to use `#` instead.

#publish-packages-to-npm

Reviewed By: cortinico

Differential Revision: D43712415

fbshipit-source-id: 86fc728eb0cb63afb6a9fe592a9ae998da2ce2e4
2023-03-02 12:14:47 +00:00
Ruslan Lesiutin ac635f96ee refactor(bump-all-updated-packages): use tag instead of custom commit name 2023-02-28 13:27:45 +00:00
Tommy Nguyen ad1ddc241a fix(ios): fix pod install --project-directory=... (#36096) 2023-02-13 11:04:53 +00:00
Lorenzo Sciandra 712efaf44a [LOCAL] remove too strict version controls 2023-02-01 13:15:42 +00:00
Lorenzo Sciandra 0b440d5475 [LOCAL] we have patch versions after the .0 2023-01-31 17:01:10 +00:00
Ruslan Lesiutin 77936fa640 fix(publishing-bumped-packages): look for status code instaead of stderr (#36004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36004

Changelog: [Internal]

This fixes CircleCI job, which is responsible for publishing bumped packages. We should not check for `stderr`, apparently `npm` uses it to store debug information:
- https://github.com/npm/npm/issues/118#issuecomment-325440

So we've tried to use this on 0.71-stable before and it succesfully published one package, but have exited right after it because `stderr` was not empty

Reviewed By: cortinico, cipolleschi

Differential Revision: D42836212

fbshipit-source-id: 6f2a9a512121683268fe6aae6a187fccb8d9dfbc
2023-01-30 16:02:37 +00:00
Ruslan Lesiutin 938257915f fix(setup-verdaccio): save auth token for verdaccio before bootstrapping it 2023-01-25 21:53:42 +00:00
Ruslan Lesiutin a7876989ca Cherry-picking monorepo CI scripts to 0.71-stable (#35946)
Co-authored-by: Ruslan Lesiutin <hoxy@fb.com>
2023-01-25 11:47:46 +00:00
Lorenzo Sciandra df7c92ff4c [LOCAL] fix(cli,metro,babel): bump cli and metro and babel to fix Windows+Metro issue (#35786) 2023-01-17 13:52:03 +00:00
Lorenzo Sciandra 5f3c1e1f6b fix(scripts): add logic for version scripts to account for local E2E test versioning (#35847)
Co-authored-by: Riccardo <cipolleschi@fb.com>
2023-01-17 11:21:25 +00:00
Riccardo Cipolleschi ce3eefe12c Fix cleanup not working on template app (#35679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35679

The Codegen cleanup step was not always working due to an issue with the codegen folder path. It was working for RNTester, but not for apps created from the Template.

## Changelog:
[iOS][Fixed] - Fix path issue to properly run the codegen cleanup step

Reviewed By: jacdebug

Differential Revision: D42137600

fbshipit-source-id: ba4cb03d4c6eb17fda70a4aff383908d2e468429
2022-12-19 14:33:39 +00:00
Riccardo Cipolleschi f7b35c0d43 Automatically detect when use frameworks is used (#35636)
Summary:
This PR introduce an automatic way to detect whether the user sets its podfile to use frameworks.
In this way, users don't have to install pods with a specific environment flag but they can rely on the standard Cocoapods usage

## Changelog

[IOS][ADDED] - Automatically detect whether use_frameworks! is used

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

Test Plan:
- CircleCI is Green
- Added unit tests
- Tested locally with an app

Reviewed By: dmytrorykun

Differential Revision: D42029355

Pulled By: cipolleschi

fbshipit-source-id: 76c92133deabbda59603b043a4d542737f10f044
2022-12-19 14:33:32 +00:00
Riccardo Cipolleschi 5b32348add Add compiler flag for the new Arch when enabled. (#35672)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35672

While working on some example, I discovered that the helper function `install_module_dependencies` was not adding the proper `-DRCT_NEW_ARCH_ENABLED=1` flag to the compiler flags.

## Changelog:
[iOS][Fixed] - Make sure to add the New Arch flag to libraries

Reviewed By: jacdebug

Differential Revision: D42131287

fbshipit-source-id: 68c492150ba4e4a2ec726b3e8b8a9c7842b543bc
2022-12-19 14:27:04 +00:00
Riccardo Cipolleschi aaa795bcae Improve Codegen Cleanup (#35642)
Summary:
This PR adds a safety check in case the Cocoapod build script is not able to clean the build folder.
We had evidences where this process failed, and in this way the user has a clear and actionable message to fix its situation.

## Changelog

[iOS][Added] - Add message with instructions about what to do if the cleanup of the build folder fails.

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

Test Plan:
I was not able to reproduce the issue locally.
The fix is not destructive, let's see if the amount of issues decreases.

Reviewed By: dmytrorykun

Differential Revision: D42067939

Pulled By: cipolleschi

fbshipit-source-id: 433dbfaec42a1bf460dc9a48051aa51ec6e12d16
2022-12-19 14:26:57 +00:00
Nick Gerleman ed08edd966 Fix Errors with TypeScript Tests
Summary:
This fixes some style errors found by dtslint, along with some test cases for StyleSheet.compose() where the recent change made it slightly too permissive when explicit return types are given. I also added runs of the TS tests to a script which runs in sandcastle so we can catch this at diff-submission time in the future.

Changelog:
[General][Fixed] - Fix Errors with TypeScript Tests

Reviewed By: lunaleaps

Differential Revision: D42085257

fbshipit-source-id: 7e6ca49d3c3aef822c61c97ecc07b55b0a949d51
2022-12-19 14:21:16 +00:00
Dmytro Rykun ed16fdbbb8 [LOCAL] fix: use REACT_NATIVE_CI instead of CI envvar (#35605)
* [LOCAL] fix: use META_CI instead of CI envvar

* META_CI -> REACT_NATIVE_CI

* Rename more occurences of CI to REACT_NATIVE_CI

* Use REACT_NATIVE_CI in rn-tester/Podfile

* Add REACT_NATIVE_CI to prepare_hermes_workspace

* revert: Use REACT_NATIVE_CI in rn-tester/Podfile

* Consume hermes-engine.podspec from sdks/hermes-engine

* Consume hermes-engine.podspec from sdks/hermes-engine. Update tests
2022-12-12 13:42:34 +00:00
Riccardo Cipolleschi c8ef8462dd Bring back JSIDynamic and JSI together
Summary:
In 0.71.0-RC.2, we had a regression in `use_frameworks!`.

This brings back JSIDynamic and JSI together because the current setup is not compatible with iOS frameworks

## Changelog
[iOS][Added] - Bring back JSIDynamic and JSI

Reviewed By: cortinico

Differential Revision: D41557823

fbshipit-source-id: 95eb2fe7df69992861396e41d11cd5182193e1a3

# Conflicts:
#	ReactCommon/jsi/React-jsidynamic.podspec
2022-11-30 11:49:41 +00:00
Steve Shreeve 0f6ec5a8b4 Allow react-native and expo to build when using GNU coreutils (#35382)
Summary:
See the issue at https://github.com/facebook/react-native/issues/32432#issuecomment-1242234121

This fixes a bizarre issue when using the GNU coreutils tools. There are very minor differences in the standard command-line tools on macOS and the GNU coreutils. The `cp` command has slightly different semantics across these operating systems, so this commit normalizes those differences and allows GNU coreutils to be used or the system native version of `cp`.

Fixes #32432

## Changelog

[General] [Fixed] - Allow GNU coreutils to be used to build projects

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

Test Plan: This change allows the use of the system or GNU coreutils verson of `cp`.

Reviewed By: cipolleschi

Differential Revision: D41532472

Pulled By: cortinico

fbshipit-source-id: f0fe5274d3828bf6099deceee797a82a6adfdcab
2022-11-30 11:47:46 +00:00
Cedric van Putten d7dd64194e Fix hardcoded path to codegen cli for monorepos (#35430)
Summary:
Fixes https://github.com/facebook/react-native/issues/35429

This fix is fairly straightforward. Instead of hardcoding two separate paths for this repo or a simple user's project, we ask Node to resolve `react-native-codegen`.

Because `react-native-codegen` is moved [into the `/packages/*` folder](https://github.com/facebook/react-native/blob/main/package.json#L104), it's part of a workspace in this repository. That means that this fix works not only for monorepos in general but also resolves the right path within the react native repository.

You can test this out yourself when running this command in either the root, or any other workspace in this repository:
```bash
node --print "require('path').dirname(require.resolve('react-native-codegen/package.json'))"
```

I've tested this on Node 16 and 18, and seems to work nicely. Note that you _**have to specify `react-native-codegen/package.json`**_. That's because the `react-native-codegen` package itself is technically invalid; it's missing an entry point within the package (no `main`). When running `node --print "require.resolve('react-native-codegen')"` Node can't resolve the main entry point, and will fail during this process.

## 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
-->

[iOS] [Fixed] - Fix incorrect codegen CLI paths in monorepo projects

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

Test Plan: See PR https://github.com/facebook/react-native/issues/35429

Reviewed By: cortinico

Differential Revision: D41475878

Pulled By: cipolleschi

fbshipit-source-id: f0c362b64cf9c3543a3a031d7eaf302c1314e3f0
2022-11-30 11:47:23 +00:00
Riccardo Cipolleschi f283877c21 Move JSCRuntime into its own folder (#35482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35482

This change moves the JSCRuntime.h/cpp into a `jsc` folder.

This change is required for several reasons:
1. on iOS, the new `jsi`, `jsidynamic` and `jsc` setup is breaking the `use_frameworks!` with  `:linkage => :static` option with the old architecture. So it is a regression.
2. JSCRuntime is required by some libraries and needs to be exposed as a prefab and the current setup makes it hard to achieve.

allow-large-files

[General][Changed] - Move JSCRuntime into a separate pod/prefab

Reviewed By: cortinico

Differential Revision: D41533778

fbshipit-source-id: 642240c93a6c124280430d4f196049cb67cb130b
2022-11-29 20:02:45 +00:00
Riccardo Cipolleschi 49c0267b66 [LOCAL] Use the right logic for build from source 2022-11-24 12:34:42 +00:00
Dmitry Rykun 0d90a44adf Remove hermesc build dir for non-Hermes build
Summary: Changelog: [iOS][Fixed] - Remove hermesc build dir for non-Hermes build.

Reviewed By: christophpurrer

Differential Revision: D41052884

fbshipit-source-id: c9e85ca06cef79fa35e81972181558d44ca93d90
2022-11-24 12:23:17 +00:00
Dmitry Rykun 1739139c7c Fix removing Copy Hermes Framework script phase
Summary: Changelog: [iOS][Fixed] - Remove `Copy Hermes Framework` script phase for non-Hermes build.

Reviewed By: hramos

Differential Revision: D41051076

fbshipit-source-id: b4b92330934e950ec3156f39f3807b90f803c1ba
2022-11-24 12:21:37 +00:00
Lorenzo Sciandra 9979e38c70 [LOCAL] remove the hermes engine cache in the clean script 2022-11-23 11:39:17 +00:00
Riccardo Cipolleschi 8f2c7ff9f2 Remove HERMES_BUILD_FROM_SOURCE flag (#35397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35397

This Diff removes the `HERMES_BUILD_FROM_SOURCE` that was not always propagated to the original script. This lead to some cases where hermesC was built during `pod install` and then removed by the `react_native_post_install`'s `else` branch.

Basically, when the Pods are installed the first time, everything run smoothly. Subsequent invocations of `pod install`, to install other dependencies, for example, will incur in this problem because:
1. Cocoapods will see that hermes-engine is already installed
2. the podspec is not executed, given that the pod has been fetched from the cache
3. The env var is not set (given that the podspec is not executed)
4. the main script sees the env var as not set, `ENV['HERMES_BUILD_FROM_SOURCE'] == "1"` return false
5. The `else` branch is executed, and it removes the `hermesc_build_dir` and the `copy Hermes framework` script phase.

[iOS][Changed] - Remove `HERMES_BUILD_FROM_SOURCE` flag

Reviewed By: cortinico, dmytrorykun

Differential Revision: D41373439

fbshipit-source-id: ea4aafd187c0ca3ff5c0d79f8aeaaa46ad50f499
2022-11-22 15:57:12 +00:00
Riccardo ba1a9defbb [LOCAL] bypass tag check in dry run (#35428) 2022-11-22 15:02:21 +00:00