From 6bf834cb5329a892e25b7b1bfe4287b7c7f8b7cd Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Fri, 11 Nov 2022 16:37:02 -0800 Subject: [PATCH] ANDROID: kleaf: Add build rules for allmodconfig. These corresponds to the build.config.allmodconfig.* build configs. Unlike build.sh, the Kleaf variant deliberately does not copy any outputs to the distribution directory. There's not even a dist target. This is because allmodconfig is a build test only. Test: bazel build --allow_undeclared_mdoules //common:allmodconfig_{aarch64,arm,x86_64} Bug: 258259749 Change-Id: Iefe8f69149f6391938696e90243939d42d4fda84 Signed-off-by: Yifan Hong --- BUILD.bazel | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/BUILD.bazel b/BUILD.bazel index 8967b61d5d91..68b160637797 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -324,6 +324,42 @@ copy_to_dist_dir( flat = True, ) +# allmodconfig build tests. +# These are build tests only, so: +# - outs are intentionally set to empty to not copy anything to DIST_DIR +# - --allow-undeclared-modules must be used so modules are not declared or copied. +# - No dist target because these are build tests. We don't care about the artifacts. + +# tools/bazel build --allow_undeclared_modules //common:allmodconfig_aarch64 +kernel_build( + name = "allmodconfig_aarch64", + # Hack to actually check the build. + # Otherwise, Bazel thinks that there are no output files, and skip building. + outs = [".config"], + build_config = "build.config.allmodconfig.aarch64", + visibility = ["//visibility:private"], +) + +# tools/bazel build --allow_undeclared_modules //common:allmodconfig_x86_64 +kernel_build( + name = "allmodconfig_x86_64", + # Hack to actually check the build. + # Otherwise, Bazel thinks that there are no output files, and skip building. + outs = [".config"], + build_config = "build.config.allmodconfig.x86_64", + visibility = ["//visibility:private"], +) + +# tools/bazel build --allow_undeclared_modules //common:allmodconfig_arm +kernel_build( + name = "allmodconfig_arm", + # Hack to actually check the build. + # Otherwise, Bazel thinks that there are no output files, and skip building. + outs = [".config"], + build_config = "build.config.allmodconfig.arm", + visibility = ["//visibility:private"], +) + # DDK Headers # All headers. These are the public targets for DDK modules to use. alias(