Skip to content

Commit

Permalink
Allow local_archive paths to be labels
Browse files Browse the repository at this point in the history
1. If a local_archive path looks like a label, interpret it as such.

Signed-off-by: Chris Frantz <[email protected]>
  • Loading branch information
cfrantz committed Dec 6, 2023
1 parent 6209f4e commit e6f9c95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rules/local_archive.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ def _local_archive_impl(rctx):
if rctx.attr.build_file and rctx.attr.build_file_content:
fail("Use only one of build_file and build_file_content.")

path = rctx.attr.path
if path.startswith("@") or path.startswith("//") or ":" in path:
path = Label(path)
rctx.extract(
archive = rctx.attr.path,
archive = path,
stripPrefix = rctx.attr.strip_prefix,
)
if rctx.attr.build_file:
Expand Down

0 comments on commit e6f9c95

Please sign in to comment.