diff --git a/build_rules/github.bzl b/build_rules/github.bzl index caa220a4..33afe571 100644 --- a/build_rules/github.bzl +++ b/build_rules/github.bzl @@ -70,7 +70,7 @@ def github_new_http_archive(name, package, build_file = None, build_file_content build_file_content = build_file_content, ) -def github_go_repository(name, package, importpath = "", commit = None, tag = None, sha256 = ""): +def github_go_repository(name, package, commit = None , tag = None, importpath = "", sha256 = "", mirror_urls = [], **kwargs): """Adding go repository from github and convert it to bazel repository. Note that for now the dependencies will not be pulled in automatically. You @@ -87,18 +87,16 @@ def github_go_repository(name, package, importpath = "", commit = None, tag = No github.com/Shopify/sarama. commit: (string) Commit number. tag: (string) Commit tag. Exactly one of commit or tag is required. - importpath: (string) Optionally override the import path. - sha256: (string) Optional checksum. + mirror_urls: (list of string) Optional list of mirror URLs. This does not + have to include the github URL. """ - remote = "https://github.com/" + package if importpath == "": importpath = "github.com/" + package return go_repository( name = name, importpath = importpath, - remote = remote, - vcs = "git", - commit = commit, - tag = tag, + urls = [_github_tar_gz_url(package, commit, tag)] + mirror_urls, + strip_prefix = _tar_gz_prefix(package, commit, tag), sha256 = sha256, + **kwargs ) diff --git a/build_rules/init_go.bzl b/build_rules/init_go.bzl index e0183c64..f1da5ded 100644 --- a/build_rules/init_go.bzl +++ b/build_rules/init_go.bzl @@ -6,7 +6,7 @@ def init_go(): # go_prefix, which requires us to rework ALL the repositories. http_archive( name = "io_bazel_rules_go", - url = "https://github.com/lingochamp/rules_go/archive/d8f26fc6e707e951e9069790fc2098420fc9b82d.tar.gz", - sha256 = "b7d50d95a9252c69f850af79caf4adc84a654a8a8e24c281cd8fd61e49fa67dc", - strip_prefix = "rules_go-d8f26fc6e707e951e9069790fc2098420fc9b82d", + url = "https://github.com/lingochamp/rules_go/archive/3b8b931a870ed93477e92e089e358c48deaa3836.tar.gz", + #sha256 = "b7d50d95a9252c69f850af79caf4adc84a654a8a8e24c281cd8fd61e49fa67dc", + #strip_prefix = "rules_go-3b8b931a870ed93477e92e089e358c48deaa3836", )