Update rules_closure to latest version

This updates rules_closure to the version with Protobuf 3.7.1. The new
Protobuf version introduced dependency on zlib, that we also have to
add as transitive dependency.

Change-Id: Ic8fa455e86ed12dc3b7fe71ec2ba32ec00b043cd
This commit is contained in:
David Ostrovsky
2019-03-21 23:19:54 +01:00
parent f619b01a3d
commit a1d98360a1
2 changed files with 77 additions and 3 deletions

View File

@@ -14,9 +14,23 @@ http_archive(
http_archive(
name = "io_bazel_rules_closure",
sha256 = "ddce3b3a3909f99b28b25071c40b7fec7e2e1d1d1a4b2e933f3082aa99517105",
strip_prefix = "rules_closure-316e6133888bfc39fb860a4f1a31cfcbae485aef",
urls = ["https://github.com/bazelbuild/rules_closure/archive/316e6133888bfc39fb860a4f1a31cfcbae485aef.tar.gz"],
sha256 = "34abd9170fdbfdfc6f3b63f2c18cee3cbcb2ddbd5e3c97324add0aa7809ed875",
strip_prefix = "rules_closure-9d543facf886631e4ed379996e60ce3533188adc",
urls = ["https://github.com/bazelbuild/rules_closure/archive/9d543facf886631e4ed379996e60ce3533188adc.tar.gz"],
)
# Transitive dependency of rules_closure and protobuf
http_archive(
name = "net_zlib",
build_file = "//:lib/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",
)
# File is specific to Polymer and copied from the Closure Github -- should be

60
lib/zlib/BUILD Normal file
View File

@@ -0,0 +1,60 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # BSD/MIT-like license (for zlib)
_ZLIB_HEADERS = [
"crc32.h",
"deflate.h",
"gzguts.h",
"inffast.h",
"inffixed.h",
"inflate.h",
"inftrees.h",
"trees.h",
"zconf.h",
"zlib.h",
"zutil.h",
]
_ZLIB_PREFIXED_HEADERS = ["zlib/include/" + hdr for hdr in _ZLIB_HEADERS]
# In order to limit the damage from the `includes` propagation
# via `:zlib`, copy the public headers to a subdirectory and
# expose those.
genrule(
name = "copy_public_headers",
srcs = _ZLIB_HEADERS,
outs = _ZLIB_PREFIXED_HEADERS,
cmd = "cp $(SRCS) $(@D)/zlib/include/",
visibility = ["//visibility:private"],
)
cc_library(
name = "zlib",
srcs = [
"adler32.c",
"compress.c",
"crc32.c",
"deflate.c",
"gzclose.c",
"gzlib.c",
"gzread.c",
"gzwrite.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"uncompr.c",
"zutil.c",
# Include the un-prefixed headers in srcs to work
# around the fact that zlib isn't consistent in its
# choice of <> or "" delimiter when including itself.
] + _ZLIB_HEADERS,
hdrs = _ZLIB_PREFIXED_HEADERS,
copts = [
"-Wno-unused-variable",
"-Wno-implicit-function-declaration",
],
includes = ["zlib/include/"],
)