blob: 4ef66206adce84f7530c5ad60430a81a3c669e5d [file] [log] [blame] [view]
sbc30e47282016-03-04 01:29:581# Linux sysroot images
2
3The chromium build system for Linux will (by default) use a sysroot image
4rather than building against the libraries installed on the host system.
5This serves several purposes. Firstly, it ensures that binaries will run on all
6supported linux systems independent of the packages installed on the build
7machine. Secondly, it makes the build more hermetic, preventing issues that
8arise for variations among developers' systems.
9
10The sysroot consists of a minimal installation of Debian/stable (or old-stable)
11to ensure maximum compatibility. Pre-built sysroot images are stored in
12Google Cloud Storage and downloaded during `gclient runhooks`
13
14## Installing the sysroot images
15
16Installation of the sysroot is performed by
17`build/linux/sysroot_scripts/install-sysroot.py`.
18
19This script can be run manually but is normally run as part of gclient
20hooks. When run from hooks this script in a no-op on non-linux platforms.
21
22## Rebuilding the sysroot image
23
24The pre-built sysroot images occasionally needs to be rebuilt. For example,
qyearsleyc0dc6f42016-12-02 22:13:3925when security updates to Debian are released, or when a new package is needed by
thomasanderson99d60d82016-12-15 23:35:1826the chromium build. If you just want to update the sysroots without adding any
27new packages, skip to `Using build_and_upload.py`.
28
29### Adding new packages
30
Tom Andersonad01fbd42023-11-17 18:52:3031To add a new package, edit the `sysroot_creator.py` script and modify the
Tom Anderson0cfed4762018-10-09 19:46:3632`DEBIAN_PACKAGES` list.
sbc30e47282016-03-04 01:29:5833
34### Rebuilding
35
Tom Andersona77c6be62023-05-18 01:58:5936To rebuild the images (without any changes) run the following command for
37each desired architecture:
sbc30e47282016-03-04 01:29:5838
Tom Andersonad01fbd42023-11-17 18:52:3039 $ build/linux/sysroot_scripts/sysroot_creator.py build <arch>
sbc30e47282016-03-04 01:29:5840
41This command on its own should be a no-op and produce an image identical to
42the one on Google Cloud Storage.
43
sbc30e47282016-03-04 01:29:5844### Uploading new images
45
Tom Andersona77c6be62023-05-18 01:58:5946To upload image to Google Cloud Storage run the following command:
sbc30e47282016-03-04 01:29:5847
Tom Andersonad01fbd42023-11-17 18:52:3048 $ build/linux/sysroot_scripts/sysroot_creator.py upload <arch>
sbc30e47282016-03-04 01:29:5849
50Here you should use the SHA1 of the git revision at which the images were
51created.
52
53Uploading new images to Google Clound Storage requires write permission on the
54`chrome-linux-sysroot` bucket.
55
56### Rolling the sysroot version used by chromium
57
thomasanderson99d60d82016-12-15 23:35:1858Once new images have been uploaded, the `sysroots.json` file needs to be updated
59to reference the new versions. This process is manual and involves updating the
60`Revision` and `Sha1Sum` values in the file.
61
62### Using `build-and-upload.py`
63
64The `build_and_upload.py` script automates the above four steps. It is
65recommended to use this just before you're ready to submit your CL, after you've
66already tested one of the updated sysroots on your local configuration. Build
67or upload failures will not produce detailed output, but will list the script
68and arguments that caused the failure. To debug this, you must run the failing
69command manually. This script requires Google Cloud Storage write permission on
70the `chrome-linux-sysroot` bucket.