tree: d5e7a78fba6f081d57b3ff10a5a4cb6de3239039
  1. manifests/
  2. package/
  3. sdk/
  4. sysroot_extra/
  5. toolchain/
  6. tools/
  7. build.sh
  8. README.md
fuchsia-build/README.md

Reference

This build structure is mirrored from:

https://fuchsia.googlesource.com/sdk-samples/drivers

To incorporate updates:

  • check out the reference repo
  • in WORKSPACE.bazel, check instances of ‘local_repository’ match (NOTE, our version includes fuchsia-build in the path)
  • for each local_repository, build.sh clones each repo into fuchsia-build (with SETUP_BAZEL=true)
  • run git submodule in the reference reop to see the hashes to be used in build.sh
  • for cipd based dependencies (bazel_sdk, rules_fuchsia, clang), sync manifests/* to fuchsia-build/manifests
  • update fuchsia_api_level in fuchsia-build/sdk/package_utils.bzl

Build

Run the following command:

./fuchsia-build/build.sh

Upload

Run the following command:

./fuchsia-build/build.sh --upload

Manual Setup

Fetch submodule:

NOTE: git submodule not used because AOSP doesn't allow it.

git clone https://fuchsia.googlesource.com/fuchsia-infra-bazel-rules fuchsia-build/third_party/fuchsia-infra-bazel-rules

Bootstrap:

fuchsia-build/third_party/fuchsia-infra-bazel-rules/scripts/bootstrap.sh

Fetch the toolchain (separately from the SDK):

./.cipd_client ensure -root fuchsia-build/toolchain/clang -ensure-file fuchsia-build/manifests/clang.ensure

Building with a local SDK

If you are iterating on changes within fuchsia you can include the local SDK with the following steps.

Add the sdk to your fuchsia build rules:

fx add-test //sdk:final_fuchsia_sdk_head_only

Build the fuchsia sdk:

fx build //sdk:final_fuchsia_sdk

Build this repository with -override:

./fuchsia-build/build.sh --override