Uh oh!
There was an error while loading. Please reload this page.
fix(platform-ios): fix sourceDir detection - #1444
Conversation
thymikee
commented
Jul 15, 2021
@grabbou wdyt? |
kelset
commented
Aug 3, 2021
thymikee
commented
Aug 3, 2021
grabbou
commented
Aug 4, 2021
Apologies for the waiting time. The reason I didn't act on this PR earlier was that I was thinking how to move forward with this one. Like @tido64 said, all the logic around That said, I am hesitant to add additional complexity to something that already works, as well as change the way we resolve a Podfile - at the risk of breaking this for our other users. Instead, I would work on adding a temporary configuration option to override what does not work. For example, we could allow overriding |
| // This is a temporary fix for #1435. In certain repos, the Xcode project can | ||
| // be generated by a tool. The only file that we can assume to exist on disk | ||
| // is `Podfile`. | ||
| const sourceDir = podfile ? path.dirname(podfile) : path.dirname(projectPath); |
There was a problem hiding this comment.
I would not change this one to be honest, sourceDir is not needed for autolinking, so there's no need to adjust it for cases when xcodeproj doesn't exist. It is needed for legacy link command and in the case of a missing xcodeproj, that would fail anyway.
There was a problem hiding this comment.
It looks like it is being used for autolinking:
Without this change, we hit errors similar to this when running pod install:
[!] No podspec found for `ReactTestApp-DevSupport` in `..`
tido64
commented
Aug 4, 2021
But it's not fundamentally changing how you're resolving a Podfile today. The logic is still the same for the success case. Only in the case of it failing, are we resorting to a glob search. I don't understand how that is a risk? If it was failing before, it wouldn't be any worse with the current change. |
grabbou
commented
Aug 5, 2021
Reopening as it looks like that’s our only way to go in this case for time being. |
grabbou
commented
Aug 5, 2021
After taking another pass and your explanations @tido64, it looks good 👍 |
thymikee
commented
Aug 5, 2021
@tido64 published |
Thanks for backporting it, @thymikee. |
joshchoo
commented
Oct 8, 2021
Hi @tido64, I'm facing a problem with podspec path resolution on one of the packages I'm using: react-native-emarsys-wrapper. This change causes sourceDir to resolve to I'm currently working around this by patching react-native-emarsys-wrapper to remove sample/ios/Podfile to avoid incorrect sourceDir resolution. Is there a better way to resolve sourceDir, such as editing Environment
|
tido64
commented
Oct 8, 2021
@joshchoo: You can explicitly disable it in your This way you don't have to patch the package. Is the |
joshchoo
commented
Oct 8, 2021
@tido64, thanks for your help! Disabling autolinking via react-native.config.js works for my case. |
Summary:
This is a minimal changes version of #1436. After speaking with @grabbou, I learned that most of the props in
configare going away, so we agreed to make as little changes as possible and instead focus onnext.Resolves#1435
Resolvesmicrosoft/react-native-test-app#375
Test Plan:
Curren tests should pass: