[ios] Assert that the version of Xcode is high enough
The new Widget requires Xcode 12.0 or higher to build, so assert
that the version of Xcode used for the build is recent enough.
Update the documentation to recommend the same version of Xcode
as enforced by the code, and add tips on steps recommended to
perform when updating Xcode.
Bug: none
Change-Id: I8b8fbf3d53ef2ab98c2407e28e46ce4321cd72f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527175
Commit-Queue: Sylvain Defresne <[email protected]>
Reviewed-by: Guillaume Jenkins <[email protected]>
Cr-Commit-Position: refs/heads/master@{#827785}
diff --git a/docs/ios/build_instructions.md b/docs/ios/build_instructions.md
index 188fd0bd..b381794 100644
--- a/docs/ios/build_instructions.md
+++ b/docs/ios/build_instructions.md
@@ -13,7 +13,7 @@
## System requirements
* A 64-bit Mac running 10.12.6 or later.
-* [Xcode](https://developer.apple.com/xcode) 11.4+.
+* [Xcode](https://developer.apple.com/xcode) 12.0 or higher.
* The current version of the JDK (required for the Closure compiler).
## Install `depot_tools`
@@ -328,6 +328,42 @@
[waterfall](https://build.chromium.org/buildbot/waterfall/) is green and the tree
is open before checking out. This will increase your chances of success.
+### Changing the version of Xcode
+
+To change the version of Xcode used to build Chromium on iOS, please follow
+the steps below:
+
+1. Launch the new version of Xcode.app.
+
+ This is required as Xcode may need to install some components into
+ the system before the new version can be used from the command-line.
+
+1. Reboot your computer.
+
+ This is required as some of Xcode components are daemons that are not
+ automatically stopped when updating Xcode, and command-line tools will
+ fail if the daemon version is incompatible (usually `actool` fails).
+
+1. Run `gn gen`.
+
+ This is required as the `ninja` files generated by `gn` encodes some
+ information about Xcode (notably the path to the SDK, ...) that will
+ change with each version. It is not possible to have `ninja` re-run
+ `gn gen` automatically when those changes unfortunately.
+
+ If you have a downstream chekout, run `gclient runhooks` instead of
+ `gn gen` as it will ensure that `gn gen` will be run automatically
+ for all possible combination of target and configuration from within
+ Xcode.
+
+If you skip some of those steps, the build may occasionally succeed, but
+it has been observed in the past that those steps are required in the
+vast majority of the situation. Please save yourself some painful build
+debugging and follow them.
+
+If you use `xcode-select` to switch between multiple version of Xcode,
+you will have to follow the same steps.
+
### Improving performance of `git status`
#### Increase the vnode cache size