commit | 84101311cedce7c78923566df53a7812c95dc6e2 | [log] [tgz] |
---|---|---|
author | David 'Digit' Turner <digit@google.com> | Thu Sep 15 09:03:16 2022 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Sep 15 09:03:16 2022 +0000 |
tree | 90949a4dcc06a82a192eff693b305da4eb76ee4d | |
parent | 527639d62cc17310796c4331cad2d88e5e815cbd [diff] |
[build][bazel] Improve @legacy_ninja_build_outputs generation. This CL changes how the repository that exposes Ninja outputs as Bazel input files is generated: - The repository is now populated by a repository rule (see //build/bazel/repository_rules.bzl) which reads the same inputs manifest file generated at `gn gen` time with metadata collection. This allows populating the repository *before* building anything with Ninja (except the minimal setup performed by 'fx build bazel_workspace'), which in turns allows performing Bazel queries before building anything with Ninja! This also allows breaking the 'testonly' blocking boundary! I.e. in the previous implementation, having a single testonly bazel_input_xxx() target forced the bazel workspace-generating action to be testonly, preventing any use of a non-testonly bazel_build_action() targets, which was far too limiting. With this new implementation, only //build/bazel:legacy_ninja_build_outputs needs to be testonly, and nothing actually depends on it in the GN graph (though it must be reachable from //BUILD.gn in order to generate its metadata file). + Move tests from //build/bazel/examples to //build/bazel/tests/ + generate-workspace.py: Fix the create_dir() function since shutil.rmtree() does not work well with the chains of readonly symlinks and directories found in the output base (resulting in strange NotADirectory errors). + test-all.py: Add new test to verify that Bazel queries before Ninja builds actually work. Improve error output when a command fails. Add --fuchsia-build-dir option, and auto-detect it otherwise (will be used in future CL). Change-Id: Idf88733d7dd534da2a43410c73ca85682ebf12d1 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/718889 Fuchsia-Auto-Submit: David Turner <digit@google.com> Reviewed-by: Jay Zhuang <jayzhuang@google.com> Commit-Queue: David Turner <digit@google.com>
Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.
We expect everyone interacting with our project to respect our code of conduct.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.