From cfd0e021f48e362290fc94b52bf538827f7fd3ca Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 10 Oct 2023 15:47:39 -0700 Subject: [PATCH] fix: avoid breaking Bazel 5 users Related to #584 which removed a Bazel 5 workaround --- docs/BUILD.bazel | 10 ++++++---- lib/BUILD.bazel | 8 ++------ lib/private/BUILD.bazel | 12 ++---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index 5a0e47963..eb4844636 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -116,10 +116,12 @@ stardoc_with_diff_test( bzl_library_target = "//lib:host_repo", ) -stardoc_with_diff_test( - name = "platform_utils", - bzl_library_target = "//lib:platform_utils", -) +# NB: we don't bother documenting this, because it just has three trivial functions, +# and the dependency on @local_config_platform makes the load() break for Bazel 5 users. +# stardoc_with_diff_test( +# name = "platform_utils", +# bzl_library_target = "//lib:platform_utils", +# ) stardoc_with_diff_test( name = "stamping", diff --git a/lib/BUILD.bazel b/lib/BUILD.bazel index 9cdd3c02f..0369fab6d 100644 --- a/lib/BUILD.bazel +++ b/lib/BUILD.bazel @@ -5,6 +5,8 @@ load("//lib/private:copy_common.bzl", "copy_options") load("//lib/private:stamping.bzl", "stamp_build_setting") # Ensure that users building their own rules can dep on our bzl_library targets for their stardoc +# This file has a dependency on @local_config_platform which is breaking for Bazel 5 users. +# gazelle:exclude platform_utils.bzl package(default_visibility = ["//visibility:public"]) exports_files( @@ -277,12 +279,6 @@ bzl_library( ], ) -bzl_library( - name = "platform_utils", - srcs = ["platform_utils.bzl"], - deps = ["//lib/private:platform_utils"], -) - bzl_library( name = "base64", srcs = ["base64.bzl"], diff --git a/lib/private/BUILD.bazel b/lib/private/BUILD.bazel index bef73226e..5f67119ae 100644 --- a/lib/private/BUILD.bazel +++ b/lib/private/BUILD.bazel @@ -1,5 +1,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +# This file has a dependency on @local_config_platform which is breaking for Bazel 5 users. +# gazelle:exclude platform_utils.bzl exports_files( [ "diff_test_tmpl.sh", @@ -250,16 +252,6 @@ bzl_library( deps = [":repo_utils"], ) -bzl_library( - name = "platform_utils", - srcs = [ - "platform_utils.bzl", - "@local_config_platform//:constraints.bzl", # keep - ], - visibility = ["//lib:__subpackages__"], - deps = [], # keep -) - bzl_library( name = "tar_toolchain", srcs = ["tar_toolchain.bzl"],