From 9eaf5b529d4a9f4ffe27883e9d0347dc773c854c Mon Sep 17 00:00:00 2001 From: Jaeheon Yi Date: Fri, 1 Oct 2021 23:17:56 +0000 Subject: [PATCH] fuchsia: Build documentation update This patch clarifies the existing state of the world. Bug: fuchsia:85552 Change-Id: I27364dc92e321109489e541264b62b09c8db01dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198801 Commit-Queue: Jaeheon Yi Reviewed-by: Chong Gu Cr-Commit-Position: refs/heads/main@{#927436} --- DEPS | 10 ++-- docs/fuchsia/build_instructions.md | 80 ++++++++++++++---------------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/DEPS b/DEPS index cdf49bd9bbbaa8..95409da3575dd2 100644 --- a/DEPS +++ b/DEPS @@ -160,11 +160,15 @@ vars = { # entries in a comma-separated list. # Wildcards are supported (e.g. "qemu.*"). # - # Example of images include: + # Available images: # Emulation: - # qemu.x64, qemu.arm64, workstation.qemu-x64-release + # - qemu.x64 (pulls terminal.qemu-x64-release) + # - qemu.arm64 (pulls terminal.qemu-arm64-release) + # - workstation.qemu-x64-release # Hardware: - # generic.x64, generic.arm64 + # - generic.x64 (pulls terminal.x64-debug) + # - generic.arm64 (pulls terminal.arm64-debug) + # - chromebook.x64 (pulls terminal.chromebook-x64-debug) # # Since the images are hundreds of MB, default to only downloading the image # most commonly useful for developers. Bots and developers that need to use diff --git a/docs/fuchsia/build_instructions.md b/docs/fuchsia/build_instructions.md index 8376ece586afed..07cf465571be5b 100644 --- a/docs/fuchsia/build_instructions.md +++ b/docs/fuchsia/build_instructions.md @@ -27,8 +27,8 @@ 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 +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`: ```shell @@ -52,12 +52,12 @@ dependencies. $ fetch --nohooks chromium ``` -Expect the command to take 30 minutes on even a fast connection, and many -hours on slower ones. +Expect the command to take 30 minutes on even a fast connection, and many hours +on slower ones. If you've already installed the build dependencies on the machine (from another -checkout, for example), you can omit the `--nohooks` flag and `fetch` -will automatically execute `gclient runhooks` at the end. +checkout, for example), you can omit the `--nohooks` flag and `fetch` will +automatically execute `gclient runhooks` at the end. When `fetch` completes, it will have created a hidden `.gclient` file and a directory called `src` in the working directory. @@ -88,15 +88,17 @@ solutions = [ target_os = ['fuchsia'] ``` -The Fuchsia boot images that are checked out is controlled by the -`checkout_fuchsia_boot_images` variable. For instance, adding -``` -"checkout_fuchsia_boot_images": "qemu.x64,workstation.qemu-x64-release", -``` -to the `custom_vars` section of your `.gclient` file would allow you to check -out both images. +The Fuchsia boot images (also called "SDK companion images") to check out are +specified by the `checkout_fuchsia_boot_images` variable. For instance, adding +`"checkout_fuchsia_boot_images": "qemu.x64,workstation.qemu-x64-release",` to +the `custom_vars` section of your `.gclient` file would allow you to check out +both images. The set of available images is listed in the +[DEPS file](https://source.chromium.org/chromium/chromium/src/+/main:DEPS). -``` +Note: fxbug.dev/85552 tracks migration away from the legacy image names, like +`qemu.x64`, which is mapped to `terminal.qemu-x64-release` by the +[`update_images.py`](https://source.chromium.org/chromium/chromium/src/+/main:build/fuchsia/update_images.py) +helper script. You will then need to run: @@ -115,8 +117,8 @@ $ cd src ### (Linux-only) Install any required host packages -Chromium relies on some platform packages to be present in order to build. -You can install the current set of required packages with: +Chromium relies on some platform packages to be present in order to build. You +can install the current set of required packages with: ```shell $ build/install-build-deps.sh @@ -134,10 +136,10 @@ $ git rebase-update $ gclient sync ``` -The first command updates the primary Chromium source repository and rebases -any of your local branches on top of tip-of-tree (aka the Git branch -`origin/main`). If you don't want to use this script, you can also just use -`git pull` or other common Git commands to update the repo. +The first command updates the primary Chromium source repository and rebases any +of your local branches on top of tip-of-tree (aka the Git branch `origin/main`). +If you don't want to use this script, you can also just use `git pull` or other +common Git commands to update the repo. The second command syncs dependencies to the appropriate versions and re-runs hooks as needed. `gclient sync` updates dependencies to the versions specified @@ -146,9 +148,10 @@ in `DEPS`, so any time that file is modified (pulling, changing branches, etc.) ## (Mac-only) Download additional required Clang binaries -Go to [this page](https://chrome-infra-packages.appspot.com/p/fuchsia/clang/mac-amd64/+/) -and download the most recent build. Extract `bin/llvm-ar` to the clang folder -in Chromium: +Go to +[this page](https://chrome-infra-packages.appspot.com/p/fuchsia/clang/mac-amd64/+/) +and download the most recent build. Extract `bin/llvm-ar` to the clang folder in +Chromium: ```shell $ unzip /path/to/clang.zip bin/llvm-ar -d ${CHROMIUM_SRC}/third_party/llvm-build/Release+Asserts @@ -157,9 +160,9 @@ $ unzip /path/to/clang.zip bin/llvm-ar -d ${CHROMIUM_SRC}/third_party/llvm-build ## Setting up the build Chromium uses [Ninja](https://ninja-build.org) as its main build tool along with -a tool called [GN](https://gn.googlesource.com/gn/+/main/docs/quick_start.md) -to generate `.ninja` files. You can create any number of *build directories* -with different configurations. To create a build directory, run: +a tool called [GN](https://gn.googlesource.com/gn/+/main/docs/quick_start.md) to +generate `.ninja` files. You can create any number of *build directories* with +different configurations. To create a build directory, run: ```shell $ gn gen out/fuchsia --args="is_debug=false dcheck_always_on=true is_component_build=false target_os=\"fuchsia\"" @@ -195,26 +198,19 @@ Under Linux, if your host and target CPU architectures are the same (e.g. you're building for Fuchsia/x64 on a Linux/x64 host) then you can benefit from QEMU's support for the KVM hypervisor: -1. Install the KVM module for your kernel, to get a /dev/kvm device. -2. Ensure that your system has a "kvm" group, and it owns /dev/kvm. -You can do that by installing the QEMU system common package: -```shell -$ sudo apt-get install qemu-system-common -``` -3. Add users to the "kvm" group, and have them login again, to pick-up the new -group. -```shell -$ sudo adduser kvm -$ exit -[log in again] -``` +1. Install the KVM module for your kernel, to get a /dev/kvm device. +2. Ensure that your system has a "kvm" group, and it owns /dev/kvm. You can do + that by installing the QEMU system common package: `shell $ sudo apt-get + install qemu-system-common` +3. Add users to the "kvm" group, and have them login again, to pick-up the new + group. `shell $ sudo adduser kvm $ exit [log in again]` ### Running test suites There are three types of tests available to run on Fuchsia: -1. [Gtests](gtests.md) -2. [GPU integration tests](gpu_testing.md) -3. [Blink tests](web_tests.md) +1. [Gtests](gtests.md) +2. [GPU integration tests](gpu_testing.md) +3. [Blink tests](web_tests.md) Check the documentations to learn more about how to run these tests.