Skip to content

Commit

Permalink
Fix generated url for github_proto_repository macro
Browse files Browse the repository at this point in the history
  • Loading branch information
pcj committed Jun 22, 2023
1 parent 3799dab commit 34119a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rules/proto/proto_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,15 @@ def patch(ctx):
fail("Error applying patch command %s:\n%s%s" %
(cmd, st.stdout, st.stderr))

def github_proto_repository(name, owner, repo, commit, prefix = "", build_file_expunge = True, build_file_proto_mode = "file", **kwargs):
def github_proto_repository(name, owner, repo, commit, prefix = "", host = "github.com", build_file_expunge = True, build_file_proto_mode = "file", **kwargs):
"""github_proto_repository is a macro for a proto_repository hosted at github.com
Args:
name: the name of the rule
owner: the github owner (e.g. 'protocolbuffers')
repo: the github repo name (e.g. 'protobuf')
prefix: the strip_prefix value for the repo (e.g. 'src')
host: the source host (default 'github.com')
commit: the git commit (required for this macro)
build_file_expunge: defaults to true for this macro.
build_file_proto_mode: defaults to 'file' for this macro.
Expand All @@ -427,14 +428,14 @@ def github_proto_repository(name, owner, repo, commit, prefix = "", build_file_e

proto_repository(
name = name,
source_host = "github.com",
source_host = host,
source_owner = owner,
source_repo = repo,
source_commit = commit,
source_prefix = prefix,
strip_prefix = strip_prefix,
build_file_expunge = build_file_expunge,
build_file_proto_mode = build_file_proto_mode,
urls = ["https://%s/%s/archive/%s.tar.gz" % (owner, repo, commit)],
urls = ["https://%s/%s/%s/archive/%s.tar.gz" % (host, owner, repo, commit)],
**kwargs
)

0 comments on commit 34119a6

Please sign in to comment.