commit | f5619cea3a453cba086e88a030cf6f519dc4f4ea | [log] [tgz] |
---|---|---|
author | Kevin Lubick <kjlubick@google.com> | Fri Nov 11 09:29:04 2022 -0500 |
committer | Kevin Lubick <kjlubick@google.com> | Fri Nov 11 14:49:34 2022 +0000 |
tree | 789e4ef7d9a6dfc5361f74889d8b8bac5e315363 | |
parent | 484976bf0fde55cb2db4db24d702fb229fa1f00a [diff] |
[bazel] Generate .gni files from Bazel files in CheckGeneratedFiles job In order to do this, we also need to have Bazel download gn from CIPD. This approach emulates ./bin/fetch-gn [1] instead of using [2] because the former is simpler and does not require fetching depot_tools. To make it easier to call the right version of the pre-compiled GN binary, this adds in a wrapper rule which uses a cross-platform Python script to find the GN binary and properly update the working directory. Suggested Review order: - bazel/cipd_install.bzl to see the macro which produces an http_archive rule - WORKSPACE.bazel which uses that cipd_install macro to install 3 flavors of GN for the 3 platforms Skia's Bazel rules currently support. - bazel/external/gn/BUILD.bazel to see the generated Python script (similar to [3]) - bazel/Makefile to see the gn wrapper rule be used - check_generated_files.go which calls the Makefile target. Note that it is currently infeasible to put the gni generation in a Bazel rule because it calls Bazel itself, causing an apparent deadlock. [1] https://github.com/google/skia/blob/3d2d941dd76ce5c3e2ee7fb24df2a9ebf7780344/bin/fetch-gn#L29 [2] https://github.com/google/skia-buildbot/blob/89ee531de064568d1489ec4f7f60b6ef3961c807/bazel/external/cipd_install.bzl [3] https://skia-review.googlesource.com/c/skia/+/599856 Change-Id: I82362392591f28dcd6132d4635a84b4f69a55fca Reviewed-on: https://skia-review.googlesource.com/c/skia/+/603400 Reviewed-by: Chris Mumford <cmumford@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>