-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fix build_codegen!
not finding @react-native/codegen
in pnpm setups
#41399
Conversation
5c14018
to
51a1171
Compare
The changes are fine to me, but I'm a bit worried about its scalability in other setups. Also, we already have kind-of a node resolution in ruby here. |
I can reuse that approach for now. I'm really worried about adding |
Wow, they are just 3 or 4 functions of 3/4 lines each! |
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tido64 Could you please clarify the use case?
If I understand the purpose of this function correctly, it is only supposed to be used when we are working from within react-native monorepo, and consuming codegen package form source, form packages/react-native-codegen
.
And in that case it is sufficient to run the build only inside packages/react-native-codegen
, and then it will be symlinked to any location the package manager decides.
So I'd suggest to try to delete all the code, and only leave the part that runs the build inside packages/react-native-codegen
, and it should just work.
We have a repo with pnpm setup. If I run |
@tido64 I assume in that case codegen is downloaded from NPM, and we shouldn't be trying to build it. I think the proper fix for this issue should be not trying to build it anywhere but in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing, thank you!
Thanks for pointing out the fact that we don't need to build it. I thought it was a bit weird, but didn't give it a second thought. |
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @tido64 in 3dd6a83. When will my fix make it into a release? | Upcoming Releases |
…ps (#41399) Summary: `build_codegen!` currently assumes that `react-native/codegen` gets installed next to `react-native`. In a pnpm setup, it's found under `/~/react-native/node_modules/react-native/codegen` instead. However, as dmytrorykun pointed out, we don't actually need to build it outside of this repository. ## Changelog: [GENERAL] [FIXED] - `react-native/codegen` shouldn't be built unless it's in the repo — fixes `pod install` failures in pnpm setups Pull Request resolved: #41399 Test Plan: We have a patched version of `react-native` working in a pnpm setup here: microsoft/rnx-kit#2811 Reviewed By: dmytrorykun Differential Revision: D51201643 Pulled By: cipolleschi fbshipit-source-id: 53767ae08686a20f03b3b93abcbc7d5383083872
…ps (#41399) Summary: `build_codegen!` currently assumes that `react-native/codegen` gets installed next to `react-native`. In a pnpm setup, it's found under `/~/react-native/node_modules/react-native/codegen` instead. However, as dmytrorykun pointed out, we don't actually need to build it outside of this repository. ## Changelog: [GENERAL] [FIXED] - `react-native/codegen` shouldn't be built unless it's in the repo — fixes `pod install` failures in pnpm setups Pull Request resolved: #41399 Test Plan: We have a patched version of `react-native` working in a pnpm setup here: microsoft/rnx-kit#2811 Reviewed By: dmytrorykun Differential Revision: D51201643 Pulled By: cipolleschi fbshipit-source-id: 53767ae08686a20f03b3b93abcbc7d5383083872
…ps (facebook#41399) Summary: `build_codegen!` currently assumes that `react-native/codegen` gets installed next to `react-native`. In a pnpm setup, it's found under `/~/react-native/node_modules/react-native/codegen` instead. However, as dmytrorykun pointed out, we don't actually need to build it outside of this repository. ## Changelog: [GENERAL] [FIXED] - `react-native/codegen` shouldn't be built unless it's in the repo — fixes `pod install` failures in pnpm setups Pull Request resolved: facebook#41399 Test Plan: We have a patched version of `react-native` working in a pnpm setup here: microsoft/rnx-kit#2811 Reviewed By: dmytrorykun Differential Revision: D51201643 Pulled By: cipolleschi fbshipit-source-id: 53767ae08686a20f03b3b93abcbc7d5383083872
Summary:
build_codegen!
currently assumes that@react-native/codegen
gets installed next toreact-native
. In a pnpm setup, it's found under/~/react-native/node_modules/@react-native/codegen
instead.However, as @dmytrorykun pointed out, we don't actually need to build it outside of this repository.
Changelog:
[GENERAL] [FIXED] -
@react-native/codegen
shouldn't be built unless it's in the repo — fixespod install
failures in pnpm setupsTest Plan:
We have a patched version of
react-native
working in a pnpm setup here: microsoft/rnx-kit#2811