diff options
author | Ulises Mendez Martinez <umendez@google.com> | 2023-06-01 09:51:58 +0000 |
---|---|---|
committer | Ulises Mendez Martinez <umendez@google.com> | 2023-06-01 10:30:10 +0000 |
commit | 24201c269fdfa8fd4757a71e4f8c07d868d0cac4 (patch) | |
tree | 63750cdd2d0cd2a93e74cf5c5d2cc7279948f17e | |
parent | 87168445232683baab6af39a85e26d83d7026a86 (diff) | |
download | build-24201c269fdfa8fd4757a71e4f8c07d868d0cac4.tar.gz |
kleaf: Fix buildifier warnings in kernel_build file
Bug: 265923948
Change-Id: I5e593ad899cef6903e53f782c02bfa612e3c475f
Signed-off-by: Ulises Mendez Martinez <umendez@google.com>
-rw-r--r-- | kleaf/common_kernels.bzl | 8 | ||||
-rw-r--r-- | kleaf/impl/kernel_build.bzl | 14 |
2 files changed, 14 insertions, 8 deletions
diff --git a/kleaf/common_kernels.bzl b/kleaf/common_kernels.bzl index 6c3464de..0f977ece 100644 --- a/kleaf/common_kernels.bzl +++ b/kleaf/common_kernels.bzl @@ -11,9 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +"""Functions that are useful in the common kernel package (usually `//common`).""" load("@bazel_skylib//lib:dicts.bzl", "dicts") -load("@bazel_skylib//lib:paths.bzl", "paths") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load( ":kernel.bzl", @@ -30,7 +30,6 @@ load( load("//build/bazel_common_rules/dist:dist.bzl", "copy_to_dist_dir") load("//build/kernel/kleaf/artifact_tests:kernel_test.bzl", "initramfs_modules_options_test") load("//build/kernel/kleaf/impl:gki_artifacts.bzl", "gki_artifacts") -load("//build/kernel/kleaf/impl:utils.bzl", "utils") load( "//build/kernel/kleaf/impl:constants.bzl", "MODULE_OUTS_FILE_OUTPUT_GROUP", @@ -174,6 +173,7 @@ def _filter_keys(d, valid_keys, what = "", allow_unknown_keys = False): )) return ret +# buildifier: disable=unnamed-macro def define_common_kernels( branch = None, target_configs = None, @@ -814,7 +814,7 @@ def _define_common_kernels_additional_tests( kernel_images( name = test_name + "_fake_images", - kernel_modules_install = kernel_build_name + "_modules_install", + kernel_modules_install = kernel_modules_install, build_initramfs = True, modules_options = fake_modules_options, ) @@ -833,7 +833,7 @@ def _define_common_kernels_additional_tests( kernel_images( name = test_name + "_empty_images", - kernel_modules_install = kernel_build_name + "_modules_install", + kernel_modules_install = kernel_modules_install, build_initramfs = True, # Not specify module_options ) diff --git a/kleaf/impl/kernel_build.bzl b/kleaf/impl/kernel_build.bzl index d62cbd73..3da608db 100644 --- a/kleaf/impl/kernel_build.bzl +++ b/kleaf/impl/kernel_build.bzl @@ -11,6 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +""" +Defines a kernel build target. +""" load("@bazel_skylib//lib:paths.bzl", "paths") load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo") @@ -257,10 +260,10 @@ def kernel_build( Labels are created for each item in `module_implicit_outs` as in `outs`. - kmi_symbol_list: A label referring to the main KMI symbol list file. See `additional_kmi_symbol_list`. + kmi_symbol_list: A label referring to the main KMI symbol list file. See `additional_kmi_symbol_lists`. This is the Bazel equivalent of `ADDTIONAL_KMI_SYMBOL_LISTS`. - additional_kmi_symbol_list: A list of labels referring to additional KMI symbol list files. + additional_kmi_symbol_lists: A list of labels referring to additional KMI symbol list files. This is the Bazel equivalent of `ADDTIONAL_KMI_SYMBOL_LISTS`. @@ -323,7 +326,8 @@ def kernel_build( If the value is `"false"`; or the value is `"auto"` and `--kbuild_symtypes` is not specified, then `KBUILD_SYMTYPES=`. toolchain_version: The toolchain version to depend on. - kwargs: Additional attributes to the internal rule, e.g. + dtstree: Device tree support. + **kwargs: Additional attributes to the internal rule, e.g. [`visibility`](https://docs.bazel.build/versions/main/visibility.html). See complete list [here](https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes). @@ -349,7 +353,7 @@ def kernel_build( ) internal_kwargs = dict(kwargs) - internal_kwargs.pop("visibility", default = None) + internal_kwargs.pop("visibility", None) kwargs_with_manual = dict(kwargs) kwargs_with_manual["tags"] = ["manual"] @@ -930,6 +934,7 @@ _kernel_build = rule( }, ) +#buildifier: disable=return-value def _kernel_build_check_toolchain(ctx): """ Check toolchain_version is the same as base_kernel. @@ -941,6 +946,7 @@ def _kernel_build_check_toolchain(ctx): base_toolchain_file = utils.getoptattr(base_kernel[KernelToolchainInfo], "toolchain_version_file") if base_toolchain == None and base_toolchain_file == None: + # buildifier: disable=print print(("\nWARNING: {this_label}: No check is performed between the toolchain " + "version of the base build ({base_kernel}) and the toolchain version of " + "{this_name} ({this_toolchain}), because the toolchain version of {base_kernel} " + |