Skip to content

Commit

Permalink
Switch to new http_archive rules so that building with bazel 0.20 works.
Browse files Browse the repository at this point in the history
Bazel deprecated new_http_archive in version 0.20, which causes an error at
build time (unless a temporary flag is used to renable new_http_archive).

Resolves #86

PiperOrigin-RevId: 224024305
  • Loading branch information
rickeylev authored and Copybara-Service committed Dec 4, 2018
1 parent 910aa92 commit f24641c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,37 @@
# limitations under the License.
workspace(name = "io_abseil_py")

new_http_archive(
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "six_archive",
urls = [
"http://mirror.bazel.build/pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz",
"https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz",
],
sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
strip_prefix = "six-1.10.0",
build_file = "third_party/six.BUILD",
build_file = "@//third_party:six.BUILD",
)

new_http_archive(
http_archive(
name = "mock_archive",
urls = [
"http://mirror.bazel.build/pypi.python.org/packages/a2/52/7edcd94f0afb721a2d559a5b9aae8af4f8f2c79bc63fdbe8a8a6c9b23bbe/mock-1.0.1.tar.gz",
"https://pypi.python.org/packages/a2/52/7edcd94f0afb721a2d559a5b9aae8af4f8f2c79bc63fdbe8a8a6c9b23bbe/mock-1.0.1.tar.gz",
],
sha256 = "b839dd2d9c117c701430c149956918a423a9863b48b09c90e30a6013e7d2f44f",
strip_prefix = "mock-1.0.1",
build_file = "third_party/mock.BUILD",
build_file = "@//third_party:mock.BUILD",
)

new_http_archive(
http_archive(
# NOTE: The name here is used in _enum_module.py to find the sys.path entry.
name = "enum34_archive",
urls = [
"https://mirror.bazel.build/pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz",
"https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz"
],
sha256 = "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1",
build_file = "third_party/enum34.BUILD"
build_file = "@//third_party:enum34.BUILD"
)
2 changes: 2 additions & 0 deletions third_party/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This BUILD file is empty. It is only needed so that this directory is a bazel
# package and its files can be referenced by `http_archive.build_file`.

0 comments on commit f24641c

Please sign in to comment.