Skip to content

Commit b3481bd

Browse files
committed
[bazel] Remove local parameter from bare_repository
This is no longer used / usable with Bzlmod. Use `override_repo` in the `MODULE.bazel` instead. Signed-off-by: James Wainwright <[email protected]>
1 parent bee8bc1 commit b3481bd

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rules/repo.bzl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,14 @@ def http_archive_or_local(local = None, **kwargs):
2727
)
2828

2929
def _bare_repository_impl(rctx):
30-
if rctx.attr.local:
31-
# Although not particularly well documented, the `get_child` function will only add
32-
# the workspace for relative paths, and simply ignore it if given an absolute path.
33-
path = rctx.workspace_root.get_child(rctx.attr.local)
34-
35-
# NOTE By default, Bazel will automatically watch those directories and refetch
36-
# the repository if they change.
37-
for child in path.readdir():
38-
rctx.symlink(child, child.basename)
39-
elif rctx.attr.url:
30+
if rctx.attr.url:
4031
rctx.download_and_extract(
4132
url = rctx.attr.url,
4233
sha256 = rctx.attr.sha256,
4334
stripPrefix = rctx.attr.strip_prefix,
4435
)
4536
else:
46-
fail("Specify a `url` or `local` path")
37+
fail("Specify a `url` path")
4738

4839
for rpath, lpath in rctx.attr.additional_files.items():
4940
rctx.symlink(rctx.path(lpath), rpath)
@@ -56,7 +47,6 @@ bare_repository = repository_rule(
5647
"url": attr.string(doc = "Location of an archive file (exclusive with `local`)."),
5748
"sha256": attr.string(doc = "SHA256 of the archive."),
5849
"strip_prefix": attr.string(doc = "Prefix to strip when extracting the archive."),
59-
"local": attr.string(doc = "Path to a local subdirectory (exclusive with `url`)."),
6050
"additional_files": attr.string_dict(
6151
doc = "Additional files to place in the repository (mapping repo filename to local file).",
6252
),

third_party/tock/extensions.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ tock = module_extension(
4242
def _tock_repos():
4343
bare_repository(
4444
name = "tock",
45-
local = None,
4645
strip_prefix = "tock-e81987f6a41e9b92f60fda1d5283f46b3cb597b5",
4746
url = "https://github.com/tock/tock/archive/e81987f6a41e9b92f60fda1d5283f46b3cb597b5.tar.gz",
4847
sha256 = "b7c239f3bd7e7727eee99814661424e1e50587fe9068cec1943a7bb6743ed777",
@@ -154,7 +153,6 @@ def _tock_repos():
154153

155154
bare_repository(
156155
name = "libtock",
157-
local = None,
158156
strip_prefix = "libtock-rs-a2c6ad80648e3ba073e7433b4330706df052a6ae",
159157
url = "https://github.com/tock/libtock-rs/archive/a2c6ad80648e3ba073e7433b4330706df052a6ae.tar.gz",
160158
sha256 = "888d1925cd760e818385d13187286d6b87f763c548a4dc1bb26e55786dc95636",

0 commit comments

Comments
 (0)