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

Re-apply: Consider relative to pwd installation root when looking for files in rn module via cocoapods #33427

Closed
wants to merge 0 commits into from

Conversation

cortinico
Copy link
Contributor

This re-applies Consider relative to pwd installation root when looking for files in rn module via cocoapods by @danilobuerger

Summary

The :reactNativePath provided by use_native_modules! is the rn module path relative to the installation root (usually ./ios). However, when executing cocoapods from a dir thats not the installation root, packages that use the relative :reactNativePath variable in their path must also consider the relative to pwd installation root.

This fixes usage of cocoapods with the --project-directory flag like

bundle exec pod install --project-directory=ios

Changelog

[iOS] [Fixed] - Fix usage of cocoapods with --project-directory flag and new arch

Test Plan

  1. Enable the new arch
  2. Execute from the projects root dir
bundle exec pod install --project-directory=ios
  1. It will fail with
[!] Invalid `Podfile` file: [codegen] Couldn't not find react-native-codegen..
  1. Apply the patch
  2. Execute from the projects root dir
bundle exec pod install --project-directory=ios
  1. It will succeed

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Mar 15, 2022
@facebook-github-bot
Copy link
Contributor

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

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 5d560ca
Branch: main

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,067,266 +0
android hermes armeabi-v7a 7,561,950 +0
android hermes x86 8,426,910 +0
android hermes x86_64 8,397,556 +0
android jsc arm64-v8a 9,736,220 +0
android jsc armeabi-v7a 8,615,304 +0
android jsc x86 9,691,955 +0
android jsc x86_64 10,306,731 +0

Base commit: 5d560ca
Branch: main

@cortinico
Copy link
Contributor Author

Not sure why this got closed 🤔 but we're still ontrack for merging it

facebook-github-bot pushed a commit that referenced this pull request Mar 16, 2022
… files in rn module via cocoapods (#33427)

Summary:
This re-applies Consider relative to pwd installation root when looking for files in rn module via cocoapods by danilobuerger

The `:reactNativePath` provided by `use_native_modules!` is the rn module path relative to the installation root (usually `./ios`). However, when executing cocoapods from a dir thats not the installation root, packages that use the relative `:reactNativePath` variable in their path must also consider the relative to pwd installation root.

This fixes usage of cocoapods with the `--project-directory` flag like

```bash
bundle exec pod install --project-directory=ios
```
## Changelog

[iOS] [Fixed] - Fix usage of cocoapods with --project-directory flag and new arch

Pull Request resolved: #33427

Test Plan:
1) Enable the new arch
2) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

3) It will fail with

```
[!] Invalid `Podfile` file: [codegen] Couldn't not find react-native-codegen..
```

4) Apply the patch
5) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

6) It will succeed

Reviewed By: cortinico

Differential Revision: D34890926

Pulled By: dmitryrykun

fbshipit-source-id: f7adc6196874822d5ff38f275414f529d385f2ea
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @danilobuerger in 9e7d91f.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Mar 16, 2022
@kelset kelset deleted the nc/reapply-#33399 branch March 16, 2022 12:49
ShikaSD pushed a commit that referenced this pull request Mar 16, 2022
… files in rn module via cocoapods (#33427)

Summary:
This re-applies Consider relative to pwd installation root when looking for files in rn module via cocoapods by danilobuerger

The `:reactNativePath` provided by `use_native_modules!` is the rn module path relative to the installation root (usually `./ios`). However, when executing cocoapods from a dir thats not the installation root, packages that use the relative `:reactNativePath` variable in their path must also consider the relative to pwd installation root.

This fixes usage of cocoapods with the `--project-directory` flag like

```bash
bundle exec pod install --project-directory=ios
```
## Changelog

[iOS] [Fixed] - Fix usage of cocoapods with --project-directory flag and new arch

Pull Request resolved: #33427

Test Plan:
1) Enable the new arch
2) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

3) It will fail with

```
[!] Invalid `Podfile` file: [codegen] Couldn't not find react-native-codegen..
```

4) Apply the patch
5) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

6) It will succeed

Reviewed By: cortinico

Differential Revision: D34890926

Pulled By: dmitryrykun

fbshipit-source-id: f7adc6196874822d5ff38f275414f529d385f2ea
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2023
… files in rn module via cocoapods (facebook#33427)

Summary:
This re-applies Consider relative to pwd installation root when looking for files in rn module via cocoapods by danilobuerger

The `:reactNativePath` provided by `use_native_modules!` is the rn module path relative to the installation root (usually `./ios`). However, when executing cocoapods from a dir thats not the installation root, packages that use the relative `:reactNativePath` variable in their path must also consider the relative to pwd installation root.

This fixes usage of cocoapods with the `--project-directory` flag like

```bash
bundle exec pod install --project-directory=ios
```
## Changelog

[iOS] [Fixed] - Fix usage of cocoapods with --project-directory flag and new arch

Pull Request resolved: facebook#33427

Test Plan:
1) Enable the new arch
2) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

3) It will fail with

```
[!] Invalid `Podfile` file: [codegen] Couldn't not find react-native-codegen..
```

4) Apply the patch
5) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

6) It will succeed

Reviewed By: cortinico

Differential Revision: D34890926

Pulled By: dmitryrykun

fbshipit-source-id: f7adc6196874822d5ff38f275414f529d385f2ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Facebook Partner: Facebook Partner Platform: iOS iOS applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants