From dd33adcb849e1a9e4439f1d46f655f9deb962a3d Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Tue, 11 Dec 2018 15:57:26 -0800 Subject: [PATCH] Updated Bazel workspace in examples/ to handle zlib dependency To make this work, I created a symlink to the existing zlib.BUILD file. Maybe there is a better way to do this, but this is at least a quick workaround to fix the build. --- Makefile.am | 1 + examples/WORKSPACE | 15 +++++++++++++++ examples/third_party/zlib.BUILD | 1 + 3 files changed, 17 insertions(+) create mode 120000 examples/third_party/zlib.BUILD diff --git a/Makefile.am b/Makefile.am index 4873663094..4e71a37d05 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1103,6 +1103,7 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ examples/list_people.py \ examples/list_people_test.go \ examples/pubspec.yaml \ + examples/third_party/zlib.BUILD \ protobuf.bzl \ python/release/wheel/build_wheel_manylinux.sh \ python/release/wheel/Dockerfile \ diff --git a/examples/WORKSPACE b/examples/WORKSPACE index f6c0ef09b0..878b25582f 100644 --- a/examples/WORKSPACE +++ b/examples/WORKSPACE @@ -1,3 +1,5 @@ +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + # This com_google_protobuf repository is required for proto_library rule. # It provides the protocol compiler binary (i.e., protoc). http_archive( @@ -39,5 +41,18 @@ http_archive( urls = ["https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"], ) +http_archive( + name = "net_zlib", + build_file = "//:third_party/zlib.BUILD", + sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1", + strip_prefix = "zlib-1.2.11", + urls = ["https://zlib.net/zlib-1.2.11.tar.gz"], +) + +bind( + name = "zlib", + actual = "@net_zlib//:zlib", +) + load("@bazel_skylib//lib:versions.bzl", "versions") versions.check(minimum_bazel_version = "0.5.4") diff --git a/examples/third_party/zlib.BUILD b/examples/third_party/zlib.BUILD new file mode 120000 index 0000000000..1bbef2dbab --- /dev/null +++ b/examples/third_party/zlib.BUILD @@ -0,0 +1 @@ +../../third_party/zlib.BUILD \ No newline at end of file