Building from source error: The repository '@zlib' could not be resolved
os: centos-7.6
when run
tools/run_in_docker.sh bazel build -c opt tensorflow_serving/...
failed.
ERROR
ERROR: /root/abc/serving/.cache/_bazel_root/2d09b9f1da03dc789cd67b59a4571350/external/com_google_protobuf/BUILD:148:1: no such package '@zlib//': The repository '@zlib' could not be resolved and referenced by '@com_google_protobuf//:protobuf'
ERROR: Analysis of target '//tensorflow_serving/util:class_registration_test_proto_genproto' failed; build aborted: no such package '@zlib//': The repository '@zlib' could not be resolved
INFO: Elapsed time: 4.944s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (47 packages loaded, 426 targets configured)
currently loading: @org_tensorflow//tensorflow/core
Please provide details about what platform you are using (operating system, architecture). Also include your TensorFlow version. Also, did you compile from source or install a binary?
Make sure you also include the exact command if possible to produce the output included in your test case. If you are unclear what to include see the issue template displayed in the Github new issue template.
We ask for this in the issue submission template, because it is really difficult to help without that information. Thanks!
Compare a lot of BUILD files with "@zlib" in .cache/_bazel_root/2d09b9f1da03dc789cd67b59a4571350/external/ directory, just modify the file /root/abc/serving/.cache/_bazel_root/2d09b9f1da03dc789cd67b59a4571350/external/com_google_protobuf/BUILD by “ZLIB_DEPS = ["@zlib//:zlib"]” to ZLIB_DEPS = ["@zlib_archive//:zlib"] I don't know why, but work
Compare a lot of BUILD files with "@zlib" in .cache/_bazel_root/2d09b9f1da03dc789cd67b59a4571350/external/ directory, just modify the file /root/abc/serving/.cache/_bazel_root/2d09b9f1da03dc789cd67b59a4571350/external/com_google_protobuf/BUILD by “ZLIB_DEPS = ["@zlib//:zlib"]” to ZLIB_DEPS = ["@zlib_archive//:zlib"] I don't know why, but work
@luduling thans. it's works for me.
This should be fixed now.
This should be fixed now.
@nrobeR I met the sample problem. Not yet fixed?
Compare a lot of BUILD files with "@zlib" in .cache/_bazel_root/2d09b9f1da03dc789cd67b59a4571350/external/ directory, just modify the file /root/abc/serving/.cache/_bazel_root/2d09b9f1da03dc789cd67b59a4571350/external/com_google_protobuf/BUILD by “ZLIB_DEPS = ["@zlib//:zlib"]” to ZLIB_DEPS = ["@zlib_archive//:zlib"] I don't know why, but work
this works for me.
Today i have a same problem
I builind from docker (GCP Ubuntu 18.04 Host) with this command tools/run_in_docker.sh bazel build -c opt tensorflow_serving/...
I think since August this issue not fixed
same ☝️
I also have the same error, @badele did you already solve this problem?
@chengnignzhang After spending some days, I gave up :)
Did anybody found a solution for this issue?
I'm using Bazel and I'm getting /59500ca4bca19b28deb1169ec76b1fab/external/com_google_protobuf/BUILD:148:1: no such package '@zlib//': The repository '@zlib' could not be resolved and referenced by '@com_google_protobuf//:protobuf'
@chengnignzhang @edias I switched to tensorflow 2.0 I no longer have a build problem now :)
@badele I'm on TF 2.0 but still fails, yet @luduling 's solution still works.
I was trying to build tensorflow/serving 1.15 from the source (with a custom operation). Ran into the same issue but there seems to be a fix, here's what I did:
- I cloned this repo and checked out to
r1.15and the build failed with this error. - Instead, I downloaded the source code from https://github.com/tensorflow/serving/archive/1.15.0.tar.gz and I'm not seeing this error.
- I compared the above two directories by
diff -r. They are identical, the only difference is the.gitcontained in the original github repo but not in the unzipped source code. - I removed
.gitfrom the repo and the build succeeded.
It's super weird and I have no idea what's going on but it might be helpful :)