-
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 Xcode 10 errors relating to third-party #21458
Conversation
Hey thanks a lot for this PR, I'm going to test it asap! |
👋 @mmccartney - just tested your PR locally and I think it's a step in the right direction but I still got this error while trying to run EDIT: to provide more context, my local test was basically running |
I think the root of the problem is that Xcode 10 is trying to optimize build by parallelizing build steps, and it doesn't understand that the third-party install script is what creates files in the third-party. So it tries to go ahead with compile steps and fails. I think the output files settings need to be used to fix this, but I haven't researched this fully yet ;) |
btw @mmccartney @kelset, I just did this: and I'm 90% sure it works. I fully cleaned build artifacts, and ran a build from CLI, not Xcode (steps that would trigger the issue every time), and it builds successfully. Unless there's some weird non-determinism going on, this should be a good fix EDIT: Not so fast, Xcode seems not to be OK with just a folder. Working on a proper fix… |
Yeah, I thought there was some parallelization happening but wasn't sure. I know it works if you run the script after |
Go for it, if it's a viable solution we'll merge it 👍 |
If you go this route (and it makes sense — I think — to put a dependency management script in… dependency management :P), I'd recommend removing the "Install Third Party" build phase from the Xcode project, as it doesn't do anything anymore |
For CocoaPods users that is not needed, so I'm not for the |
@ikesyo Are you saying that CocoaPods users are able to build react-native without the |
Because those dependencies are handled with https://github.com/facebook/react-native/tree/master/third-party-podspecs, # Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' |
@radex it seems to me the Install Third Party step needs to be moved up to the |
I didn't end up moving the Install Third Party build step up. Instead I found that the build system wants a list of all outputs from the step in order to do dependency analysis. So, for each third-party source file that is referenced within the Xcode project, I listed it in a new |
@@ -3,7 +3,7 @@ | |||
archiveVersion = 1; | |||
classes = { | |||
}; | |||
objectVersion = 46; | |||
objectVersion = 51; |
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.
are you sure about this? isn't that Xcode 10-only-compatible mode?
I tried doing that, but it doesn't work correctly. Try deleting the third-party folder. Xcode will, at the beginning of the build, create each folder in the xcfilelist, and the install-third-party script will skip the download, because it thinks that it's already downloaded. We'd have to modify it to check if there are any files in the folder tree. Also: I think |
@radko93 I remember you having multiple Xcode instances, would you mind testing this PR to verify that it would be (or not) a BC for 9.x versions of Xcode? 🤔 |
I will test this soon. If anyone else wants to do it than me please do. |
@radex if Unfortunately I don't have an Xcode 9 laptop setup right now. I could probably get my hands on one next week. Sorry I didn't think about supporting older Xcode.
I'm not seeing this behavior. @radko93 It may be good to hold off on testing for now. I haven't found any documentation on exactly how to test this sort of thing and just discovered that
(of course, the same command fails on the master branch due to missing |
You can do that, but it will be more difficult to automate when third-party libraries get updated. You could very easily make a script that writes an |
Yeah but honestly there are already so many file references inside the Xcode project that I don't think it matters. Remember, I simply used all the references already in I'll go ahead and move them into Can someone comment on whether |
I couldn't get this script to work on my machine, but a sure way to test whether Xcode 10 builds correctly when third-party is missing for me was:
|
I saw some CI failures that seem unrelated to my changes so I just rebased from |
@mmccartney I cannot test it on this branch since I can't do a complete |
Yeah we are importing the Detox commit, expect it to land in the next 24hrs more or less. |
@mmccartney please rebase and let me know after it gets fixed and let me know afterwards |
…e existing file references from <group> to <project> relative so build system makes connection with outputFiles
@radko93 I rebased |
@radko93 I removed the |
@kelset Do you know if the detox commit has landed? I see a lot of new commits on Let me know if there is anything more for me to do to get this integrated. |
Not yet, @TheSavior is actively working on it atm.
Yeah you can ignore AppVeyor. Aside from that, at the moment I don't have much time to review the final version of this PR, I'll ask a couple people to take a look asap. |
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.
hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@mmccartney merged commit b44c5ae into |
Summary: Fixes facebook#20774 The new Xcode build system uses parallel execution to run build steps that don't have an obvious dependency. Our Xcode project was written with the assumption that the **Install Third Party** build step is run _before_ compiling the `third-party` libraries. To address this issue, this PR adds dependency information to the project to teach Xcode that `ios-install-third-party.sh` is generating the files under `third-party`. With this additional information, Xcode correctly waits for `ios-install-third-party.sh` to finish before advancing to the compile step. In addition to the Xcode project changes, I had to make some changes to the script `ios-install-third-party.sh` so that 1. it would always execute the `ios-configure-glog.sh` script regardless of how it was invoked 2. it would always install the libraries even if Xcode had partially created the tree or if a previous install was interrupted Pull Request resolved: facebook#21458 Differential Revision: D10365495 Pulled By: hramos fbshipit-source-id: c88042583f21d2447a16f6ae2b6abb929c659a26
Fixes #20774
The new Xcode build system uses parallel execution to run build steps that don't have an obvious dependency. Our Xcode project was written with the assumption that the Install Third Party build step is run before compiling the
third-party
libraries. To address this issue, this PR adds dependency information to the project to teach Xcode thatios-install-third-party.sh
is generating the files underthird-party
. With this additional information, Xcode correctly waits forios-install-third-party.sh
to finish before advancing to the compile step.In addition to the Xcode project changes, I had to make some changes to the script
ios-install-third-party.sh
so thatios-configure-glog.sh
script regardless of how it was invokedTest Plan:
third-party
tree and build theReact
projectthird-party
tree and build theRNTester
projectreact-native init AwesomeProject && cd AwesomeProject && react-native run-ios
)Release Notes:
[IOS] [BUGFIX] [third-party] - Fix build issue using new Xcode 10.0 build system