Skip to content

Commit

Permalink
fix: avoid breaking Bazel 5 users
Browse files Browse the repository at this point in the history
Related to #584 which removed a Bazel 5 workaround
  • Loading branch information
alexeagle committed Oct 10, 2023
1 parent eda4929 commit cfd0e02
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
10 changes: 6 additions & 4 deletions docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 2 additions & 6 deletions lib/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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"],
Expand Down
12 changes: 2 additions & 10 deletions lib/private/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"],
Expand Down

0 comments on commit cfd0e02

Please sign in to comment.