serving icon indicating copy to clipboard operation
serving copied to clipboard

Building from source error: The repository '@zlib' could not be resolved

Open wangzhilong opened this issue 7 years ago • 13 comments

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

wangzhilong avatar Aug 01 '19 04:08 wangzhilong

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!

rmothukuru avatar Aug 01 '19 09:08 rmothukuru

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 avatar Aug 01 '19 11:08 luduling

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.

wangzhilong avatar Aug 02 '19 06:08 wangzhilong

This should be fixed now.

nrobeR avatar Aug 02 '19 17:08 nrobeR

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.

gzpyy avatar Sep 29 '19 03:09 gzpyy

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

badele avatar Oct 03 '19 08:10 badele

same ☝️

m4nd31br0t avatar Oct 28 '19 14:10 m4nd31br0t

I also have the same error, @badele did you already solve this problem?

chengnignzhang avatar Dec 04 '19 10:12 chengnignzhang

@chengnignzhang After spending some days, I gave up :)

badele avatar Dec 05 '19 16:12 badele

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'

edias avatar Jan 06 '20 09:01 edias

@chengnignzhang @edias I switched to tensorflow 2.0 I no longer have a build problem now :)

badele avatar Jan 13 '20 16:01 badele

@badele I'm on TF 2.0 but still fails, yet @luduling 's solution still works.

372046933 avatar Jan 15 '20 01:01 372046933

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:

  1. I cloned this repo and checked out to r1.15 and the build failed with this error.
  2. 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.
  3. I compared the above two directories by diff -r. They are identical, the only difference is the .git contained in the original github repo but not in the unzipped source code.
  4. I removed .git from the repo and the build succeeded.

It's super weird and I have no idea what's going on but it might be helpful :)

caren-guo avatar Jan 06 '21 01:01 caren-guo