Wez | fd67b9a0 | 2017-07-20 00:04:31 | [diff] [blame^] | 1 | # Publishing a new Fuchsia SDK, and updating Chrome to use it |
| 2 | |
| 3 | Updating the Fuchsia SDK in Chromium currently involves: |
| 4 | 1. Building and testing the latest Fuchsia version. |
| 5 | 0. Packaging the SDK from that and uploading to cloud storage. |
| 6 | 0. Updating Chromium with DEPS and any other changes to build with the new SDK. |
| 7 | |
| 8 | ## Build and test Fuchsia |
| 9 | |
| 10 | For current documentation on Fuchsia setup, visit the [Fuchsia Getting Started Guide](https://fuchsia.googlesource.com/docs/+/HEAD/getting_started.md). |
| 11 | |
| 12 | Perform these steps on your Linux workstation: |
| 13 | 1. Check if fuchsia-dashboard.appspot.com looks green. |
| 14 | 0. Fetch the latest Fuchsia source. |
| 15 | |
| 16 | $ jiri update |
| 17 | |
| 18 | 0. Build Magenta, the sysroot, and Fuchsia. |
| 19 | |
| 20 | $ fbuild |
| 21 | |
| 22 | Now verify that the build is stable: |
| 23 | |
| 24 | 1. Either: Boot the build in QEMU - you will probably want to use -k to enable KVM acceleration (see the guide for details of other options to enable networking, graphics, etc). |
| 25 | |
| 26 | $ frun -k |
| 27 | |
| 28 | 0. Or (preferably): Boot the build on hardware (see the guide for details of first-time setup). |
| 29 | |
| 30 | $ fboot |
| 31 | |
| 32 | 0. Run tests to verify the build. All the tests should pass! If they don't then find out which of the test fixtures is failing and ping #cr-fuchsia on IRC to determine if it's a known issue. |
| 33 | |
| 34 | $ runtests |
| 35 | |
| 36 | ## Build and upload the SDK |
| 37 | 1. Configure and build a release mode build with sdk config: |
| 38 | |
| 39 | $ ./packages/gn/gen.py --release --goma -m runtime |
| 40 | $ ./packages/gn/build.py --release -j1000 |
| 41 | |
| 42 | 0. Package the sysroot and tools. |
| 43 | |
| 44 | $ ./scripts/makesdk.go . |
| 45 | |
| 46 | 0. Compute the SHA-1 hash of the tarball, to use as its filename. |
| 47 | |
| 48 | $ sha1sum fuchsia-sdk.tgz |
| 49 | f79f55be4e69ebd90ea84f79d7322525853256c3 |
| 50 | |
| 51 | 0. Note that it's possible to un-tar the SDK into place in your Chromium checkout at this point, for testing, and skip to the Build & Test steps below, before doing the actual upload. |
| 52 | |
| 53 | 0. (Googlers only) Upload the tarball to the fuchsia-build build, under the SDK path. This will require "create" access to the bucket, which is restricted to Googlers, and you'll need to have authenticated to the gcloud tools with OAuth. |
| 54 | |
| 55 | $ gsutil.py cp fuchsia-sdk.tgz gs://fuchsia-build/fuchsia/sdk/linux64/f79f55be4e69ebd90ea84f79d7322525853256c |
| 56 | |
| 57 | ## Update & test Chromium |
| 58 | |
| 59 | 1. Update the fuchsia SDK line in top-level DEPS with the new hash. |
| 60 | |
| 61 | 0. Fetch the new SDK. |
| 62 | |
| 63 | $ gclient sync |
| 64 | |
| 65 | 0. Build & test. |
| 66 | |
| 67 | $ ninja -C out/gnRelease ... <check build-bots for current targets> ... |
| 68 | |
| 69 | 0. Make necessary changes to fix build, to include in the roll CL. You may find problems in dependencies of Chromium, in which case you'll need to fix those, get the dependency rolled, and then try again. |
| 70 | |
| 71 | 0. Upload the roll CL for review! Remember to run the Fuchsia try-bots over the patch-set before landing it. |