Support a local Fuchsia platform tree as SDK source

if an env variable named "LOCAL_FUCHSIA_PLATFORM_BUILD" is defined and
points to Fuchsia Platform build output directory, the SDK (including
the experimental SDK, if use_experimental is true) will be directly
copied from the Fuchsia Platform build output dir.

The Fuchsia tree needs to be built with 'fx build sdk'
or 'fx build sdk sdk:ddk' if the experimental SDK is needed.

A developer using this workflow will need to issue the following command
in order to refresh the SDK:

  bazel sync --configure

For example,

  export LOCAL_FUCHSIA_PLATFORM_BUILD=$HOME/fuchsia/out/core.x64

  # in OOT repository
  bazel sync --configure
  bazel build --config=fuchsia_x64 src:samples_repository

  # in Fuchsia platform source:
  # change something
  fx build sdk sdk:ddk

  # in OOT repository
  bazel sync --configure
  bazel build --config=fuchsia_x64 src:samples_repository

Note that a few things will look different, with possible side effects:
- the SDK version (ffx sdk version) will be an empty string
- the product bundles (ie emulator images) will require an explict gs://
  URL, since SDK version is used by default and it is empty for a local
- anything else that depends on the SDK version may not work as

Change-Id: I1f806c59cd23c1fe7addb9036ab0775d10b41166
Fuchsia-Auto-Submit: Renato Mangini Dias <>
Reviewed-by: Chase Latta <>
Commit-Queue: Renato Mangini Dias <>
1 file changed
tree: 37d3811bd4690d20424a4d906a689ab158686998
  1. bazel_rules_fuchsia/
  2. rules/
  3. scripts/
  4. src/
  5. tools/
  6. vendor/
  7. .bazelversion
  8. .gitignore
  9. .gitmodules
  11. BUILD.bazel
  16. WORKSPACE.bazel

Fuchsia SDK Integration Repository

This repository provides environment-specific (e.g. Bazel, GN) tools for the SDK and associated integration tests in a public repo.