bazel: [Bazel CI] Error with Label '@@platforms//host:extension.bzl' is invalid because 'host' is not a package
CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3769
Platform: Ubuntu, MacOs, Windows
Logs:
ERROR: [0merror loading package '': Label '@@platforms//host:extension.bzl' is invalid because 'host' is not a package; perhaps you meant to put the colon here: '@@platforms//:host/extension.bzl'?
Culprit: https://github.com/bazelbuild/bazel/commit/74c8ca4886cfc188d60a18e796743e842f675842
CC Greenteam @fweikert @meteorcloudy @Wyverald
Few downstream projects are failing with below error
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 25 (22 by maintainers)
Commits related to this issue
- Forcibly use the bundled version of `@platforms` for loading the host platform repo rule https://github.com/bazelbuild/bazel/issues/21877 happened because, even though we define `@platforms` to be th... — committed to bazelbuild/bazel by Wyverald 3 years ago
- Forcibly use the bundled version of `@platforms` for loading the host platform repo rule https://github.com/bazelbuild/bazel/issues/21877 happened because, even though we define `@platforms` to be th... — committed to fishbone/bazel by Wyverald 3 years ago
- Forcibly use the bundled version of `@platforms` for loading the host platform repo rule https://github.com/bazelbuild/bazel/issues/21877 happened because, even though we define `@platforms` to be th... — committed to fweikert/bazel by Wyverald 3 years ago
- Force `local_config_platform` to redirect to the bundled platforms repo Similar to 77469e0385b585281f93720c5cd4744a7e8ca3c6, we redirect the redirects/aliases generated by `local_config_plaform` to t... — committed to bazelbuild/bazel by Wyverald 3 years ago
- Force `local_config_platform` to redirect to the bundled platforms repo Similar to 77469e0385b585281f93720c5cd4744a7e8ca3c6, we redirect the redirects/aliases generated by `local_config_plaform` to t... — committed to bazelbuild/bazel by Wyverald 3 years ago
- Force `local_config_platform` to redirect to the bundled platforms repo Similar to 77469e0385b585281f93720c5cd4744a7e8ca3c6, we redirect the redirects/aliases generated by `local_config_plaform` to t... — committed to bazel-io/bazel by Wyverald 3 years ago
- Revert `android_sdk_repository` to using `local_config_platform` The native repo rule `android_sdk_repository` used to load from `@local_config_platform//:constraints.bzl`; https://github.com/bazelbu... — committed to fmeum/bazel by Wyverald 3 years ago
- Use new host constraints in `@platforms` Fixes https://github.com/bazelbuild/bazel/issues/21877. — committed to bazel-contrib/rules_dotnet by Wyverald 3 years ago
- Use new host platform constraints in test/bzlmod Fixes the Stardoc part of https://github.com/bazelbuild/bazel/issues/21877. — committed to bazelbuild/stardoc by Wyverald 3 years ago
- Use new host platform constraints in test/bzlmod Fixes the Stardoc part of https://github.com/bazelbuild/bazel/issues/21877. — committed to bazelbuild/stardoc by Wyverald 3 years ago
- Use new host constraints in `@platforms` Also updates to latest Stardoc version. Addresses the rules_dotnet part of https://github.com/bazelbuild/bazel/issues/21877. — committed to bazel-contrib/rules_dotnet by Wyverald 3 years ago
- Use new host platform constraints in test/bzlmod (#215) Fixes the Stardoc part of https://github.com/bazelbuild/bazel/issues/21877. — committed to bazelbuild/stardoc by Wyverald 3 years ago
- Forcibly use the bundled version of `@platforms` for loading the host platform repo rule https://github.com/bazelbuild/bazel/issues/21877 happened because, even though we define `@platforms` to be th... — committed to bazelbuild/bazel by Wyverald 3 years ago
- Force `local_config_platform` to redirect to the bundled platforms repo Similar to 77469e0385b585281f93720c5cd4744a7e8ca3c6, we redirect the redirects/aliases generated by `local_config_plaform` to t... — committed to bazelbuild/bazel by Wyverald 3 years ago
- Revert `android_sdk_repository` to using `local_config_platform` The native repo rule `android_sdk_repository` used to load from `@local_config_platform//:constraints.bzl`; https://github.com/bazelbu... — committed to bazelbuild/bazel by Wyverald 3 years ago
- Use new host constraints in `@platforms` (#437) Also updates to latest Stardoc version. Addresses the rules_dotnet part of https://github.com/bazelbuild/bazel/issues/21877. — committed to bazel-contrib/rules_dotnet by Wyverald 3 years ago
- Forcibly use the bundled version of `@platforms` for loading the host platform repo rule https://github.com/bazelbuild/bazel/issues/21877 happened because, even though we define `@platforms` to be th... — committed to bazelbuild/bazel by Wyverald 3 years ago
- Force `local_config_platform` to redirect to the bundled platforms repo Similar to 77469e0385b585281f93720c5cd4744a7e8ca3c6, we redirect the redirects/aliases generated by `local_config_plaform` to t... — committed to bazelbuild/bazel by Wyverald 3 years ago
- Revert `android_sdk_repository` to using `local_config_platform` The native repo rule `android_sdk_repository` used to load from `@local_config_platform//:constraints.bzl`; https://github.com/bazelbu... — committed to bazelbuild/bazel by Wyverald 3 years ago
- Forcibly use the bundled version of `@platforms` for loading the host platform repo rule https://github.com/bazelbuild/bazel/issues/21877 happened because, even though we define `@platforms` to be th... — committed to bazelbuild/bazel by Wyverald 3 years ago
Not really – Stardoc dropping WORKSPACE support doesn’t help with this specific issue. Projects using old Stardoc (pre-
starlark_doc_extract) will fail anyway with Bzlmod; projects using newer Stardoc will be broken because they need to update theirbzl_librarydeps. This is very unsatisfactory but is an unfortunately consequence ofbzl_librarybeing inbazel_skylib. We need to movebzl_libraryintobazel_toolsand then we could properly set upbzl_librarytargets for .bzl files in@bazel_tools,@platforms, etc.Changing the flag default based on another flag sounds pretty error-prone. But I think I can safely change what
@bazel_tools//tools:host_platformaliases to based on the value of--enable_bzlmod.This part is unnecessary; it’s done in the WORKSPACE suffix. In fact it’s what’s causing the current breakage…
I mostly wanted to deprecate the native repo rule. I guess that’s still doable, we just need to ship a copy of
@@platforms//host:extension.bzlin Bazel 7.x. Which isn’t the end of the world, but the setup is getting quite convoluted.All green now!
ah, I see – yes, that’s the plan.
bzl_libraryinbazel_skylibwould just be an alias for its counterpart inbazel_tools.Still not fixed… https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3801#018ef488-87d2-4d8d-ac56-65762421b4a0
Looks like this still fails when Stardoc and/or android_sdk_repository are involved. Will take a look.
Could we just keep the default value of
--host_platformas is for WORKSPACE (i.e., depending on the--enable_bzlmodflag)? Realistically speaking all WORKSPACE projects would otherwise have to manually bump platforms and also add the separate setup step for the generated repo. Since WORKSPACE users won’t benefit from the future improvements to constraint registration, that pain won’t pay off for them anyway.