commit | 831365d37359d6bde4a5e426f0c158abbe8b4560 | [log] [tgz] |
---|---|---|
author | David 'Digit' Turner <digit@google.com> | Fri Jan 27 16:59:58 2023 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Jan 27 16:59:58 2023 +0000 |
tree | 79b0be19e955b282626604de7f7d2e7f94bd96d7 | |
parent | f7b12e55187700ea510e1ada141f23c27e1b58be [diff] |
Make fuchsia_product_image() slightly more hermetic. The `ffx assembly` plugin invoked by the action generated by the fuchsia_product_image() rule needs to call the host `cmc` tool at runtime. To ensure this works when the action is run inside a Bazel sandbox, expose both the `cmc` host tool, as well as the `cmc-meta.json` file that is used to point to it. The latter is required because ffx looks for SDK host tools by parsing the top-level metadata file, which will point to `tools/x64/cmc-meta.json`, which will point to `tools/x64/cmc`. To fix this, the CL does the following: - Add a `cmc_manifest` entry to the FuchsiaToolchainInfo provider, and populate it with an label attribute in the fuchsia_toolchain_info() rule definition. This ensures that the value is a File object, as required by Bazel. - Modify repository_template.BUILD to expose the `cmc-meta.json` file from @fuchsia_sdk through the provider. - Modify _fuchsia_product_image_impl to use the toolchain instance to access the host tool and its manifest, and add them as inputs to the shell action generated by the function. To verify this, apply [1] to your local fuchsia.git tree, then try to build an assembly command with bazel (see examples in the second bug below). Before this CL, this would fail with an error message that looks like: ``` Product Assembly Failed 1. Building Image Assembly config 2. Getting host tool from the SDK: cmc 3. Tool 'cmc' not found in SDK dir ``` After the CL, this fails later, because expanded prebuilt package content are not available in the sandbox, which will be addressed by future changes. [1] htps://fuchsia-review.git.corp.google.com/c/fuchsia/+/793965 Bug: 115151 Bug: 120613 Change-Id: I4e83100a0f3fd8c434862c71f2ba43b47b214f69 Reviewed-on: https://fuchsia-review.googlesource.com/c/sdk-integration/+/791985 Reviewed-by: Jiaming Li <lijiaming@google.com> Commit-Queue: David Turner <digit@google.com>
This repository provides environment-specific (e.g. Bazel, GN) tools for the SDK and associated integration tests in a public repo.
Visit Contributing to Fuchsia to learn how to contribute to this repository.