Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moved third-party deps to ReactNativeDependencies in podspecs #49812

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

chrfalch
Copy link
Contributor

@chrfalch chrfalch commented Mar 4, 2025

Summary:

  • Removed use of folly, boost, double-conversion, fmt, fast_float and glog from podspec files.
  • Removed references to folly, boost and double-conversion configuration from podspec files
  • Updated codegen podspec template
  • Moved resources -> podspec

There are two environment variables that is related to ReactNativeDependencies:

  • RCT_USE_DEP_PREBUILD : If set to 1, ReactNativeDependencies will be built from source.
  • RCT_DEPS_VERSION: If set to 1, it will override the version of ReactNativeDependencies to be used.

Changelog:

[INTERNAL] - Moved third-party dependencies to be consumed via ReactNativeDependencies podspec

Test Plan:

✅ Run Rn-Tester and verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

chrfalch added 5 commits March 4, 2025 08:28
- Removed use of folly, boost, double-conversion, fmt, fast_float and glog from podspec files.
- Removed references to folly, boost and double-conversion configuration from podspec files
- Updated codegen podspec template
To avoid having to sign our frameworks we cannot include resource bundles - they impose a signing requirement.

Therefore resources have been moved to the temporary (untill we move to SPM) podspec files.
Due to the way folly is set up, it needs configuration to be set when building it and also when you reference it through header files. This has led to the folly config having to be set in almost all our podspec files - and also in a lot of OSS libraries.

This configuration change makes use of the option in folly to configure using a header file - which will be used both when building and also when referencing it from other libraries - without having to pass folly compiler flags in all podspec files.

This is now solved by:

1. In prebuild's setup step (prepareScript) we create the folly-config.h file with the necessary configuration
2. This file is included in the distributed headers

Whenever anyone references folly they also include this file - and no extra config flags are needed.
Removed folly, double-conversion, glog, boost, fast_float, fmt from suby helper files
I wasn't able to get all of these tests to pass before my changes, so I'm a bit unsure how far we should go with this.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 4, 2025
chrfalch added 9 commits March 5, 2025 14:36
To be able to ingore comma operator misuse (-Wcomma) we need to add a pragma to ignore it. This is done in the prepare step when we create the folly-config.h file.
Added outputing the valid platforms or dependencies if any of them are invalid.
The utilities are set up to be able to switch between local build and prebuilds of the RN deps.

The podspec copies Headers from the framework's arc to be able to correctly install headers in the Pods project.

Also removed unused old third-party podspecs.
- rn-deps are now downloaded and installed from source param
- rn-deps switches from debug/release and back depending on build type
Updated all pod files and templates to use the new add_rn_dependencies method instead of ReactNativeDependencices directly.

This method updates both header search paths and dependency using the correct version (either prebuilt or from source for the deps).
…ct Native dependencies

- Switching between building from source/prebuild is implemented using the env-variable `REACT_NATIVE_DEPS_BUILD_FROM_SOURCE` which should be set to 1 to build from source - or if the release url tarballs are not available
@chrfalch chrfalch marked this pull request as ready for review March 11, 2025 12:40
Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work! I left a few suggestions

# I also needed to wrap the url in quotes to avoid escaping & and ?.
return (`curl -o /dev/null --silent -Iw '%{http_code}' -L "#{tarball_url}"` == "200")
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we haven't integrated nightlies in the flow. That's ok for now, but we should consider adding them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are also missing the flag to pass the dependencies from a prebuild previously downloaded on disk

Copy link
Contributor Author

@chrfalch chrfalch Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using RCT_DEPS_VERSION will check for downloaded artifacts (just like hermes does it) and use it if it exists. Would this be sufficient for now to be able to use a prebuild previously downloaded to disk?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be better to have a variable to point to a xcframework on the disk. This will make it easier to integrate this code in CI

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Mar 11, 2025
@chrfalch chrfalch requested a review from cipolleschi March 11, 2025 13:52
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ok#49812)

Summary:
There are two environment variables that is related to ReactNativeDependencies:
- `RCT_USE_DEP_PREBUILD `: If set to 1, ReactNativeDependencies will be built from source.
- `RCT_DEPS_VERSION`: If set to 1, it will override the version of ReactNativeDependencies to be used.

## Changelog:

[INTERNAL] - Introduced functions to configure ReactNativeDependencies in Cocoapods

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D70968672
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49812)

Summary:
Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032640
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ce (facebook#49812)

Summary:
Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032639

Pulled By: cipolleschi
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49812)

Summary:
Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032640

Pulled By: cipolleschi
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ce (facebook#49812)

Summary:
Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032639
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49969)

Summary:
Pull Request resolved: facebook#49969

Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Reviewed By: javache

Differential Revision: D71032640

Pulled By: cipolleschi
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49812)

Summary:
Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032640
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ce (facebook#49968)

Summary:
Pull Request resolved: facebook#49968

Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032639

Pulled By: cipolleschi
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ce (facebook#49812)

Summary:
Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032639
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ce (facebook#49968)

Summary:
Pull Request resolved: facebook#49968

Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032639

Pulled By: cipolleschi
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49969)

Summary:
Pull Request resolved: facebook#49969

Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Reviewed By: javache

Differential Revision: D71032640

Pulled By: cipolleschi
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49969)

Summary:
Pull Request resolved: facebook#49969

Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032640

Reviewed By: javache

Pulled By: javache
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ok#49812)

Summary:
There are two environment variables that is related to ReactNativeDependencies:
- `RCT_USE_DEP_PREBUILD `: If set to 1, ReactNativeDependencies will be built from source.
- `RCT_DEPS_VERSION`: If set to 1, it will override the version of ReactNativeDependencies to be used.

## Changelog:

[INTERNAL] - Introduced functions to configure ReactNativeDependencies in Cocoapods

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D70968672
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ce (facebook#49812)

Summary:
Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032639
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49969)

Summary:
Pull Request resolved: facebook#49969

Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032640

Reviewed By: javache

Pulled By: javache
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ok#49812)

Summary:
There are two environment variables that is related to ReactNativeDependencies:
- `RCT_USE_DEP_PREBUILD `: If set to 1, ReactNativeDependencies will be built from source.
- `RCT_DEPS_VERSION`: If set to 1, it will override the version of ReactNativeDependencies to be used.

## Changelog:

[INTERNAL] - Introduced functions to configure ReactNativeDependencies in Cocoapods

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D70968672
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ce (facebook#49812)

Summary:
Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032639
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49969)

Summary:
Pull Request resolved: facebook#49969

Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032640

Reviewed By: javache

Pulled By: javache
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ok#49812)

Summary:
There are two environment variables that is related to ReactNativeDependencies:
- `RCT_USE_DEP_PREBUILD `: If set to 1, ReactNativeDependencies will be built from source.
- `RCT_DEPS_VERSION`: If set to 1, it will override the version of ReactNativeDependencies to be used.

## Changelog:

[INTERNAL] - Introduced functions to configure ReactNativeDependencies in Cocoapods

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D70968672
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ce (facebook#49812)

Summary:
Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032639
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49969)

Summary:
Pull Request resolved: facebook#49969

Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032640

Reviewed By: javache

Pulled By: javache
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ok#49812)

Summary:
There are two environment variables that is related to ReactNativeDependencies:
- `RCT_USE_DEP_PREBUILD `: If set to 1, ReactNativeDependencies will be built from source.
- `RCT_DEPS_VERSION`: If set to 1, it will override the version of ReactNativeDependencies to be used.

## Changelog:

[INTERNAL] - Introduced functions to configure ReactNativeDependencies in Cocoapods

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D70968672
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ce (facebook#49812)

Summary:
Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032639
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49969)

Summary:
Pull Request resolved: facebook#49969

Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032640

Reviewed By: javache

Pulled By: javache
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ok#49812)

Summary:
There are two environment variables that is related to ReactNativeDependencies:
- `RCT_USE_DEP_PREBUILD `: If set to 1, ReactNativeDependencies will be built from source.
- `RCT_DEPS_VERSION`: If set to 1, it will override the version of ReactNativeDependencies to be used.
bypass-github-export-checks
## Changelog:

[INTERNAL] - Introduced functions to configure ReactNativeDependencies in Cocoapods

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D70968672

Reviewed By: javache

Pulled By: javache
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…e folly flags (facebook#49969)

Summary:
Pull Request resolved: facebook#49969

Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D71032640

Reviewed By: javache

Pulled By: javache
cipolleschi pushed a commit to cipolleschi/react-native that referenced this pull request Mar 12, 2025
…ok#49812)

Summary:
There are two environment variables that is related to ReactNativeDependencies:
- `RCT_USE_DEP_PREBUILD `: If set to 1, ReactNativeDependencies will be built from source.
- `RCT_DEPS_VERSION`: If set to 1, it will override the version of ReactNativeDependencies to be used.
bypass-github-export-checks
## Changelog:

[INTERNAL] - Introduced functions to configure ReactNativeDependencies in Cocoapods

Pull Request resolved: facebook#49812

Test Plan:
✅ Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Differential Revision: D70968672

Reviewed By: javache

Pulled By: javache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants