-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change all loads of bzl_library to have the absolute repository #184
Conversation
@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'. bazelbuild/bazel#3115 bazelbuild/bazel#7130
Just so I understand the effects of this change:
Is (2) true, or is this just a valid workaround because bazel-skylib calls itself bazel_skylib in its own WORKSPACE? |
Yes. I don't think it is just cyclic, the problem of the no remap manifests in a lot of ways. For example, I had to do this in rules_pkg so that people using the rule from their own clients would find the helper.
I'm not sure what you mean. We can not call the repo @bazel-skylib because '-' is not allowed in repository names, so that renaming is mandatory. |
If a user depends on this repository via a name other than |
bzl_library rules won't work. They will fail on StarlarkLIbraryInfo. But that pretty much Without this change
With this change
I have a playground for this in bazelbuild/rules_pkg#81 Basically, because of the mutual recursion of skylib and stardoc, you can not load either under different names than expected. I'm willing to cast that in stone (and we can bump the version to 1.0.0 to indicate a breaking change) because with the federation we are going to force rules to come in as specific names. If you want to use my_bazel_skylib, you will be using that in spite of what the rest of the federation rules use. |
Stale. We flipped the flag. |
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. When that gets flipped we can unwind this change.
The exact problem we are working around is namespace resolution for providers which are global. As far as my limited mental model of the behavior goes, without the main repo remapping, we see the equivalent of
//StarlarkLibraryInfo
from within this library, but Stardoc sees@bazel_skylib//StarlarkLibraryInfo
.@fweikert With this in place, we can change the federation test to not require --incompatible_remap_main_repo. I was able to prove it, but not easily, because the mutual recursion of federation and skylib make it very difficult to test. More on that later.
bazelbuild/bazel#3115
bazelbuild/bazel#7130