Stop providing obsolete usage of 'files' attribute in Bazel pkg_tar. RELNOTES: Further deprecation and removal of pkg_tar. Stop supporting legacy use of 'files' attribute, where it could be a list of labels instead of a map of paths to labels. PiperOrigin-RevId: 431767324
diff --git a/tools/build_defs/pkg/pkg.bzl b/tools/build_defs/pkg/pkg.bzl index afa771a..7a84430 100644 --- a/tools/build_defs/pkg/pkg.bzl +++ b/tools/build_defs/pkg/pkg.bzl
@@ -156,19 +156,10 @@ }, ) -def pkg_tar(**kwargs): - # Compatibility with older versions of pkg_tar that define files as - # a flat list of labels. - if "srcs" not in kwargs: - if "files" in kwargs: - if not hasattr(kwargs["files"], "items"): - label = "%s//%s:%s" % (native.repository_name(), native.package_name(), kwargs["name"]) - print("%s: you provided a non dictionary to the pkg_tar `files` attribute. " % (label,) + - "This attribute was renamed to `srcs`. " + - "Consider renaming it in your BUILD file.") - kwargs["srcs"] = kwargs.pop("files") +def pkg_tar(name, **kwargs): extension = kwargs.get("extension") or "tar" _real_pkg_tar( - out = kwargs["name"] + "." + extension, + name = name, + out = name + "." + extension, **kwargs )