The default SDK for developing applications of Fuchsia has build rules written in Bazel. To take advantage of that, we have a wrapper Bazel build that invokes cmake using rules_foreign_cc.
The upstream rules_foreign_cc deletes the temporary build directory (containing all the CMake output) after every build, which turns incremental rebuilds into full builds and makes them take just as long. This repo has a patch to rules_foreign_cc to prevent deletion so all the old object files can be reused.
The main bazel repository is in scripts/fuchsia
, not at the root of the git repo. The root of the git repo is then included as an external repository under the path external/src
. This prevents a conflict between the external
directory bazel uses to hold external repositories and the external
directory this project uses to hold external dependencies (which then appears under external/src/external
).
All bazel commands must be run under scripts/fuchsia.
Detailed instructions for downloading and starting the fuchsia emulator are at fuchsia.dev.
Some differences:
bazel-fuchsia/external/fuchsia_sdk/tools/x64/ffx
instead of tools/ffx
.Once you've downloaded and started the fuchsia emulator, use this command to run all the tests:
bazel run --config=fuchsia_x64 //:vulkan-cts-split
To run a single test, use the command (notice the two --
s):
bazel run --config=fuchsia_x64 //:vulkan-cts.component -- -- --deqp-archive-dir=/pkg/data --deqp-log-filename=/artifacts/TestResults.qpa --deqp-case=<casename>
Install the tests into the fuchsia build using:
bazel build --config=fuchsia_x64 --package_repo=$FUCHSIA_OUT_DIR/amber-files //:vulkan-cts-split_fuchsia_package
Run using:
ffx test run fuchsia-pkg://fuchsia.com/vulkan-cts-split#meta/vulkan-cts-split-${SPLIT_INDEX}.cm