0

[ios] Update build instructions

The version of python3 shipped with macOS tends to be old (as of
macOS Sequoia 15.3.1 this is version 3.9.6 dating from June 2021).
Update the build instructions to recommend using the version of
python3 that is managed by depot_tools.

This should ensure that the build uses a version of python3 that
is recent enough (and close to the version used by the bots). It
should prevent unexpected failures when recent features are used
in build scripts.

See https://dawn-review.googlesource.com/c/dawn/+/230174 for an
example of build failure that could be caused by an old python3.

Bug: none
Change-Id: Icb806609ee5be7146cddc83d01a1c57ec2b3b762
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6343778
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1431059}
This commit is contained in:
Sylvain Defresne
2025-03-11 12:10:24 -07:00
committed by Chromium LUCI CQ
parent 4974536306
commit 2522b84355

@ -32,14 +32,27 @@ Clone the `depot_tools` repository:
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
```
Add `depot_tools` to the end of your PATH (you will probably want to put this
in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools` to
`/path/to/depot_tools`:
You need to add the directory where you checked out `depot_tools` to your
`PATH` to make the `gclient` commands available. It is also recommended to
add the `depot_tools/python-bin` directory to your `PATH` to get access to
a recent version of python3 (the version shipped by default on macOS tends
to be quite old which can lead to build failure).
To do that, edit your shell login script (e.g. `~/.bash_profile`, `~/.zprofile`)
and add the following line at the end (assuming you've checked out `depot_tools`
in your `HOME` directory):
```shell
$ export PATH="$PATH:/path/to/depot_tools"
export PATH="$HOME/depot_tools:$HOME/depot_tools/python-bin:$PATH"
```
You may need to run `gclient status` to force an update of `depot_tools`
before the `python3` command work once you've updated your `PATH`.
You can omit `$HOME/depot_tools/python-bin` if you already have a recent
version of python installed and you manually manage it (but this may lead
to unexpected build failures).
## Get the code
Create a `chromium` directory for the checkout and change to it (you can call