From fc3bdbecc50f677d4ed4af1fce2a83b87a7c4361 Mon Sep 17 00:00:00 2001 From: Tony Aiuto Date: Wed, 21 Aug 2019 17:02:20 -0400 Subject: [PATCH 1/2] Change all loads of bzl_library to have the absolute repository @bazel_skylib. This works around not having flipped the --incompatible_remap_main_repo flag. If that gets done we can unwind this change. The exact problem we are working around is namespace resolution for providers which are global. Without the main repo remapping, we see the equivalent of '//StarlarkLibraryInfo' from within this library, but Stardoc sees '@bazel_skylib//StarlarkLibraryInfo'. https://github.com/bazelbuild/bazel/issues/3115 https://github.com/bazelbuild/bazel/issues/7130 --- BUILD | 2 +- WORKSPACE | 9 ++++----- lib/BUILD | 2 +- rules/BUILD | 2 +- rules/private/BUILD | 2 +- tests/BUILD | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/BUILD b/BUILD index 66301326..7e62e3b0 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,4 @@ -load("//:bzl_library.bzl", "bzl_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["notice"]) # Apache 2.0 diff --git a/WORKSPACE b/WORKSPACE index 16344d43..348a55a7 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,7 +1,9 @@ workspace(name = "bazel_skylib") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") +maybe( + http_archive, name = "bazel_federation", url = "https://github.com/bazelbuild/bazel-federation/archive/130c84ec6d60f31b711400e8445a8d0d4a2b5de8.zip", sha256 = "9d4fdf7cc533af0b50f7dd8e58bea85df3b4454b7ae00056d7090eb98e3515cc", @@ -10,21 +12,18 @@ http_archive( ) load("@bazel_federation//:repositories.bzl", "bazel_skylib_deps") - bazel_skylib_deps() load("@bazel_federation//setup:bazel_skylib.bzl", "bazel_skylib_setup") - bazel_skylib_setup() + # Below this line is for documentation generation only, # and should thus not be included by dependencies on # bazel-skylib. load("//:internal_deps.bzl", "bazel_skylib_internal_deps") - bazel_skylib_internal_deps() load("//:internal_setup.bzl", "bazel_skylib_internal_setup") - bazel_skylib_internal_setup() diff --git a/lib/BUILD b/lib/BUILD index dd561871..b34a4e8a 100644 --- a/lib/BUILD +++ b/lib/BUILD @@ -1,4 +1,4 @@ -load("//:bzl_library.bzl", "bzl_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["notice"]) diff --git a/rules/BUILD b/rules/BUILD index a22dd461..6308e179 100644 --- a/rules/BUILD +++ b/rules/BUILD @@ -1,4 +1,4 @@ -load("//:bzl_library.bzl", "bzl_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["notice"]) diff --git a/rules/private/BUILD b/rules/private/BUILD index 63d76d8a..a2ed236a 100644 --- a/rules/private/BUILD +++ b/rules/private/BUILD @@ -1,4 +1,4 @@ -load("//:bzl_library.bzl", "bzl_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["notice"]) diff --git a/tests/BUILD b/tests/BUILD index 14f29bfa..8db21f51 100644 --- a/tests/BUILD +++ b/tests/BUILD @@ -1,4 +1,4 @@ -load("//:bzl_library.bzl", "bzl_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load(":build_test_tests.bzl", "build_test_test_suite") load(":collections_tests.bzl", "collections_test_suite") load(":dicts_tests.bzl", "dicts_test_suite") From 6146035a270da2b62b9851ccf8d8db9224ad2c91 Mon Sep 17 00:00:00 2001 From: Tony Aiuto Date: Wed, 21 Aug 2019 17:31:28 -0400 Subject: [PATCH 2/2] revert WORKSPACE change --- WORKSPACE | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 348a55a7..16344d43 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,9 +1,7 @@ workspace(name = "bazel_skylib") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -maybe( - http_archive, +http_archive( name = "bazel_federation", url = "https://github.com/bazelbuild/bazel-federation/archive/130c84ec6d60f31b711400e8445a8d0d4a2b5de8.zip", sha256 = "9d4fdf7cc533af0b50f7dd8e58bea85df3b4454b7ae00056d7090eb98e3515cc", @@ -12,18 +10,21 @@ maybe( ) load("@bazel_federation//:repositories.bzl", "bazel_skylib_deps") + bazel_skylib_deps() load("@bazel_federation//setup:bazel_skylib.bzl", "bazel_skylib_setup") -bazel_skylib_setup() +bazel_skylib_setup() # Below this line is for documentation generation only, # and should thus not be included by dependencies on # bazel-skylib. load("//:internal_deps.bzl", "bazel_skylib_internal_deps") + bazel_skylib_internal_deps() load("//:internal_setup.bzl", "bazel_skylib_internal_setup") + bazel_skylib_internal_setup()