-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Starlarkify all repository rules #18285
Comments
@Wyverald Starlarkifying |
A starkark version of |
See https://docs.google.com/document/d/17RZKMuMjAIgNfFdrsLhqNsMTQDSS-BBA-S-fCSBPV7M/edit# for the design to address the missing API. |
@bazel-io fork 7.1.0 |
This new flag defaults to `false`. When set to `true`, native repo rules cannot be used in WORKSPACE; their Starlark counterparts must be used. Native repo rules already can't be used in Bzlmod. Work towards #18285.
@Wyverald I tried to use the local repo rules in an extension with In load("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")
def _extension_impl(ctx):
local_repository(name = "foo", path = "../../")
myext = module_extension(
implementation = _extension_impl,
) In ext = use_extension("//:extension.bzl", "myext")
use_repo(ext, "foo") It raises this error telling me that the
|
@aaronmondal I can't reproduce this with |
It looks like i messed something up. I don't know what it was but your right it works. Thanks for checking, I was about to defer this and now it looks like we can get LLVM working with bzlmod after all ❤️ |
This new flag defaults to `false`. When set to `true`, native repo rules cannot be used in WORKSPACE; their Starlark counterparts must be used. Native repo rules already can't be used in Bzlmod. Work towards #18285.
This new flag defaults to `false`. When set to `true`, native repo rules cannot be used in WORKSPACE; their Starlark counterparts must be used. Native repo rules already can't be used in Bzlmod. Work towards #18285.
This new flag defaults to `false`. When set to `true`, native repo rules cannot be used in WORKSPACE; their Starlark counterparts must be used. Native repo rules already can't be used in Bzlmod. Work towards #18285.
This new flag defaults to `false`. When set to `true`, native repo rules cannot be used in WORKSPACE; their Starlark counterparts must be used. Native repo rules already can't be used in Bzlmod. Work towards #18285. Closes #21913. PiperOrigin-RevId: 626410163 Change-Id: I4981cd8d99fc87d0d0b66991e563941478b40f12
Added `local_repository` and `new_local_repository` as Starlark repo rules under `@bazel_tools//tools/build_defs/repo:local.bzl`. They're drop-in replacements for their native counterparts. Work towards #18285. RELNOTES: The `local_repository` and `new_local_repository` repository rules are now available as Starlark rules under `@bazel_tools//tools/build_defs/repo:local.bzl`. They are drop-in replacements for their native counterparts, and can be used in module extensions. Closes #21681. PiperOrigin-RevId: 615926923 Change-Id: I0cc7355b011751da23f2a3aa189f120ef177e0fe
* Upgrade to `platforms` 0.0.9 * `--host_platform` now defaults to `@bazel_tools//tools:host_platform`, which is an alias of `@platforms//host` * `local_config_platform` (the repo rule) now just outputs a thin wrapper; `@local_config_platform//:host` is an alias of `@platforms//host`, and `@local_config_platform//:constraints.bzl` re-exports `@platforms//host:constraints.bzl` * Removed all test mocks of `local_config_platform`. A follow-up will guard prod usage behind a flag. Work towards #8766 and #18285. PiperOrigin-RevId: 620316973 Change-Id: I6593f62569f31faee69e88a520a0f7f42009e05d
… platform repo rule #21877 happened because, even though we define `@platforms` to be the bundled version shipped with Bazel (which is 0.0.9 on HEAD), people tend to define their own versions of `@platforms` in WORKSPACE. If this ends up being a lower version (very likely), the subsequent `load` to use the `host_platform_repo` repo rule (which is a Starlark version of `local_config_platform`) will fail because that repo rule was only introduced in `platforms` version 0.0.9. To resolve this conundrum, we define a new repo `@internal_platforms_do_not_use` that _also_ points to the bundled version of `@platforms`. Nobody is likely to define this repo, so we can fairly reliably get the Starlark repo rule, and also still allow people to override the actual `@platforms` targets they use. This only affects WORKSPACE users; if `--enable_bzlmod` is set, the `@host_platform` seen by `@bazel_tools` will come from the module extension instead. Work towards #18285. Fixes #21877. Closes #21902. PiperOrigin-RevId: 622238362 Change-Id: I6335ab1bc26ba9ef54473d8a21fc5a8510a3ace5
This new flag defaults to `false`. When set to `true`, native repo rules cannot be used in WORKSPACE; their Starlark counterparts must be used. Native repo rules already can't be used in Bzlmod. Work towards #18285. Closes #21913. PiperOrigin-RevId: 626410163 Change-Id: I4981cd8d99fc87d0d0b66991e563941478b40f12
Added `local_repository` and `new_local_repository` as Starlark repo rules under `@bazel_tools//tools/build_defs/repo:local.bzl`. They're drop-in replacements for their native counterparts. Work towards #18285. RELNOTES: The `local_repository` and `new_local_repository` repository rules are now available as Starlark rules under `@bazel_tools//tools/build_defs/repo:local.bzl`. They are drop-in replacements for their native counterparts, and can be used in module extensions. Closes #21681. PiperOrigin-RevId: 615926923 Change-Id: I0cc7355b011751da23f2a3aa189f120ef177e0fe
* Upgrade to `platforms` 0.0.9 * `--host_platform` now defaults to `@bazel_tools//tools:host_platform`, which is an alias of `@platforms//host` * `local_config_platform` (the repo rule) now just outputs a thin wrapper; `@local_config_platform//:host` is an alias of `@platforms//host`, and `@local_config_platform//:constraints.bzl` re-exports `@platforms//host:constraints.bzl` * Removed all test mocks of `local_config_platform`. A follow-up will guard prod usage behind a flag. Work towards #8766 and #18285. PiperOrigin-RevId: 620316973 Change-Id: I6593f62569f31faee69e88a520a0f7f42009e05d
… platform repo rule #21877 happened because, even though we define `@platforms` to be the bundled version shipped with Bazel (which is 0.0.9 on HEAD), people tend to define their own versions of `@platforms` in WORKSPACE. If this ends up being a lower version (very likely), the subsequent `load` to use the `host_platform_repo` repo rule (which is a Starlark version of `local_config_platform`) will fail because that repo rule was only introduced in `platforms` version 0.0.9. To resolve this conundrum, we define a new repo `@internal_platforms_do_not_use` that _also_ points to the bundled version of `@platforms`. Nobody is likely to define this repo, so we can fairly reliably get the Starlark repo rule, and also still allow people to override the actual `@platforms` targets they use. This only affects WORKSPACE users; if `--enable_bzlmod` is set, the `@host_platform` seen by `@bazel_tools` will come from the module extension instead. Work towards #18285. Fixes #21877. Closes #21902. PiperOrigin-RevId: 622238362 Change-Id: I6335ab1bc26ba9ef54473d8a21fc5a8510a3ace5
This new flag defaults to `false`. When set to `true`, native repo rules cannot be used in WORKSPACE; their Starlark counterparts must be used. Native repo rules already can't be used in Bzlmod. Work towards #18285. Closes #21913. PiperOrigin-RevId: 626410163 Change-Id: I4981cd8d99fc87d0d0b66991e563941478b40f12
Added `local_repository` and `new_local_repository` as Starlark repo rules under `@bazel_tools//tools/build_defs/repo:local.bzl`. They're drop-in replacements for their native counterparts. Work towards #18285. RELNOTES: The `local_repository` and `new_local_repository` repository rules are now available as Starlark rules under `@bazel_tools//tools/build_defs/repo:local.bzl`. They are drop-in replacements for their native counterparts, and can be used in module extensions. Closes #21681. PiperOrigin-RevId: 615926923 Change-Id: I0cc7355b011751da23f2a3aa189f120ef177e0fe
* Upgrade to `platforms` 0.0.9 * `--host_platform` now defaults to `@bazel_tools//tools:host_platform`, which is an alias of `@platforms//host` * `local_config_platform` (the repo rule) now just outputs a thin wrapper; `@local_config_platform//:host` is an alias of `@platforms//host`, and `@local_config_platform//:constraints.bzl` re-exports `@platforms//host:constraints.bzl` * Removed all test mocks of `local_config_platform`. A follow-up will guard prod usage behind a flag. Work towards #8766 and #18285. PiperOrigin-RevId: 620316973 Change-Id: I6593f62569f31faee69e88a520a0f7f42009e05d
… platform repo rule #21877 happened because, even though we define `@platforms` to be the bundled version shipped with Bazel (which is 0.0.9 on HEAD), people tend to define their own versions of `@platforms` in WORKSPACE. If this ends up being a lower version (very likely), the subsequent `load` to use the `host_platform_repo` repo rule (which is a Starlark version of `local_config_platform`) will fail because that repo rule was only introduced in `platforms` version 0.0.9. To resolve this conundrum, we define a new repo `@internal_platforms_do_not_use` that _also_ points to the bundled version of `@platforms`. Nobody is likely to define this repo, so we can fairly reliably get the Starlark repo rule, and also still allow people to override the actual `@platforms` targets they use. This only affects WORKSPACE users; if `--enable_bzlmod` is set, the `@host_platform` seen by `@bazel_tools` will come from the module extension instead. Work towards #18285. Fixes #21877. Closes #21902. PiperOrigin-RevId: 622238362 Change-Id: I6335ab1bc26ba9ef54473d8a21fc5a8510a3ace5
This new flag defaults to `false`. When set to `true`, native repo rules cannot be used in WORKSPACE; their Starlark counterparts must be used. Native repo rules already can't be used in Bzlmod. Work towards #18285. Closes #21913. PiperOrigin-RevId: 626410163 Change-Id: I4981cd8d99fc87d0d0b66991e563941478b40f12
… platform repo rule bazelbuild#21877 happened because, even though we define `@platforms` to be the bundled version shipped with Bazel (which is 0.0.9 on HEAD), people tend to define their own versions of `@platforms` in WORKSPACE. If this ends up being a lower version (very likely), the subsequent `load` to use the `host_platform_repo` repo rule (which is a Starlark version of `local_config_platform`) will fail because that repo rule was only introduced in `platforms` version 0.0.9. To resolve this conundrum, we define a new repo `@internal_platforms_do_not_use` that _also_ points to the bundled version of `@platforms`. Nobody is likely to define this repo, so we can fairly reliably get the Starlark repo rule, and also still allow people to override the actual `@platforms` targets they use. This only affects WORKSPACE users; if `--enable_bzlmod` is set, the `@host_platform` seen by `@bazel_tools` will come from the module extension instead. Work towards bazelbuild#18285. Fixes bazelbuild#21877. Closes bazelbuild#21902. PiperOrigin-RevId: 622238362 Change-Id: I6335ab1bc26ba9ef54473d8a21fc5a8510a3ace5
This new flag defaults to `false`. When set to `true`, native repo rules cannot be used in WORKSPACE; their Starlark counterparts must be used. Native repo rules already can't be used in Bzlmod. Work towards bazelbuild#18285. Closes bazelbuild#21913. PiperOrigin-RevId: 626410163 Change-Id: I4981cd8d99fc87d0d0b66991e563941478b40f12
We originally wanted to allow native repo rule usage in module extensions (#15412), but that turned out to be surprisingly hard to implement.
Instead, we could just go down the other route: Starlarkify all the repo rules!
local_repository
(trivial) (added in 6f254ce)local_config_platform
(trivial; but also kind of unnecessary, since nobody should use it other than@local_config_platform
itself) (done in Implement local_config_platform in @platforms platforms#86)repository_ctx
API to acquire aDirectoryListingValue
(added in 7.1.0:path.readdir
) This would unblock the following:new_local_repository
(added in 6f254ce)android_sdk_repository
(now in https://github.com/bazelbuild/rules_android)android_ndk_repository
(partially done: https://github.com/bazelbuild/rules_android_ndk)The text was updated successfully, but these errors were encountered: