diff options
author | Yifan Hong <elsk@google.com> | 2024-05-07 13:37:42 -0700 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2024-05-08 16:56:22 +0000 |
commit | 14ac1c98d4a280c1f2e239c24f9c1ff3a7688791 (patch) | |
tree | cc928a83fb647416d3772701d54c368ba60f45d5 | |
parent | fc580fc748e1adc06e6f7fb9f61b31d160dfc72d (diff) | |
download | build-14ac1c98d4a280c1f2e239c24f9c1ff3a7688791.tar.gz |
kleaf: Delete //build/kernel:hermetic-tools/*
The alises are turned into fail_rule() for
a sufficient amount of time. This change deletes
these fail_rule() targets. After this change,
command like the following:
bazel build //build/kernel:hermetic-tools/cp
will throw an error that says the target is
not found, instead of an error to use
hermetic_toolchain. The new error looks like, e.g.
ERROR: Skipping '//build/kernel:hermetic-tools/cp': no such target '//build/kernel:hermetic-tools/cp': target 'hermetic-tools/cp' not declared in package 'build/kernel' defined by /mnt/sdc/android/kernel/build/kernel/BUILD.bazel (did you mean hermetic-tools?)
Bug: 291816237
Change-Id: I509a9e25af1f4bf6468155af565c3f30309b6e49
-rw-r--r-- | BUILD.bazel | 129 | ||||
-rw-r--r-- | kleaf/hermetic_tools.bzl | 33 |
2 files changed, 0 insertions, 162 deletions
diff --git a/BUILD.bazel b/BUILD.bazel index 6f0ca80a..32fb33be 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -107,134 +107,6 @@ _HERMETIC_TOOLS = [ "build-tools/kleaf_internal_do_not_use_path/linux-x86/cxx_extractor", ]) -# DO NOT ADD MORE TO THIS LIST. -# The duplication of items in this list and other fields in hermetic-tools is -# intentional. These aliases are deprecated but kept for backwards -# compatibility. -# Existing users of individual tools are advised to migrate to -# hermetic_toolchain or hermetic_genrule. -_DEPRECATED_DO_NOT_ADD_MORE_ALIASES = [ - # keep sorted - "avbtool", - "awk", - "basename", - "bash", - "bc", - "bison", - "blk_alloc_to_base_fs", - "build_image", - "build_super_image", - "bzcat", - "bzip2", - "cat", - "certify_bootimg", - "chmod", - "cmp", - "comm", - "cp", - "cpio", - "cut", - "cxx_extractor", - "date", - "dd", - "depmod", - "diff", - "dirname", - "dtc", - "du", - "e2fsck", - "e2fsdroid", - "echo", - "egrep", - "env", - "expr", - "fec", - "find", - "flex", - "getconf", - "grep", - "gzip", - "head", - "hostname", - "id", - "img2simg", - "install", - "interceptor", - "interceptor_analysis", - "llvm-strings", - "ln", - "lpmake", - "ls", - "lz4", - "m4", - "make", - "md5sum", - "mkbootfs", - "mkdir", - "mkdtimg", - "mke2fs", - "mkfs.erofs", - "mktemp", - "mkuserimg_mke2fs", - "modinfo", - "mv", - "nproc", - "od", - "openssl", - "pahole", - "paste", - "perl", - "pgrep", - "pkill", - "ps", - "pwd", - "python", - "python3", - "readlink", - "realpath", - "rm", - "rmdir", - "rsync", - "runextractor", - "sed", - "seq", - "setsid", - "sh", - "sha1sum", - "sha256sum", - "sha512sum", - "simg2img", - "sleep", - "soong_zip", - "sort", - "stat", - "stgdiff", - "swig", - "tail", - "tar", - "tee", - "test", - "timeout", - "touch", - "tr", - "true", - "truncate", - "tune2fs", - "ufdt_apply_overlay", - "uname", - "uniq", - "unix2dos", - "unzip", - "wc", - "which", - "whoami", - "xargs", - "xxd", - "xz", - "xzcat", - "zipinfo", -] - # Hermetic tools symlinks (other than _HERMETIC_TOOLS) _TOYS = [ # keep sorted @@ -303,7 +175,6 @@ _TOYS = [ hermetic_tools( name = "hermetic-tools", - aliases = _DEPRECATED_DO_NOT_ADD_MORE_ALIASES, symlinks = select({ "//build/kernel/kleaf:debug_cache_dir_conflict_needs_flock": { ":toybox_flock": "flock", diff --git a/kleaf/hermetic_tools.bzl b/kleaf/hermetic_tools.bzl index 294eebd3..13aa70d4 100644 --- a/kleaf/hermetic_tools.bzl +++ b/kleaf/hermetic_tools.bzl @@ -25,7 +25,6 @@ load( load("//build/kernel/kleaf/impl:hermetic_genrule.bzl", _hermetic_genrule = "hermetic_genrule") load("//build/kernel/kleaf/impl:hermetic_toolchain.bzl", _hermetic_toolchain = "hermetic_toolchain") load("//build/kernel/kleaf/impl:utils.bzl", "utils") -load(":fail.bzl", "fail_rule") # Re-export functions hermetic_exec = _hermetic_exec @@ -169,7 +168,6 @@ def hermetic_tools( name, deps = None, symlinks = None, - aliases = None, **kwargs): """Provide tools for a hermetic build. @@ -182,28 +180,12 @@ def hermetic_tools( {"//label/to:toybox": "cp:realpath"} ``` deps: additional dependencies. These aren't added to the `PATH`. - aliases: **Deprecated; do not use.** - - [nonconfigurable](https://bazel.build/reference/be/common-definitions#configurable-attributes). - - List of aliases to create to refer to a `fail_rule`. - - For example, if `aliases = ["cp"],` then usage of `<name>/cp` will - fail. - - **Note**: It is not allowed to rely on these targets. Consider - using the full hermetic toolchain with - [`hermetic_toolchain`](#hermetic_toolchainget) or - [`hermetic_genrule`](#hermetic_genrule), etc. **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 """ - if aliases == None: - aliases = [] - if symlinks == None: symlinks = {} @@ -216,18 +198,3 @@ def hermetic_tools( symlinks = symlinks, **kwargs ) - - alias_kwargs = kwargs | dict( - # Disallow direct usage of aliases. - message = """\ -Use hermetic_toolchain or hermetic_genrule for the full hermetic toolchain. - See build/kernel/kleaf/docs/hermeticity.md for details. -""", - tags = ["manual"], - ) - - for alias in aliases: - fail_rule( - name = name + "/" + alias, - **alias_kwargs - ) |