-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to build with pre-download external dependencies for offline build? #11123
Comments
Did you place these unreachable files in |
Yes, I downloaded the dependency package glog in advance ,in /home/jamescook/lab/test/new-glog/download/. Can you give me an example of how to use the Distdir option correctly?I can't find it in bazel's official guide and that will help me a lot. |
Did you manage find the right command? |
Yes, use “--override_repository” option. |
@lxlmummy Did you solve it? I have the same problem as you. |
@shadow-yuan Yes, use “--override_repository” option. |
I just learned to use bazel to build google glog project. My computer network is blocked. I've downloaded glog which gflag dependents to the directory '/home/jamescook/lab/test/new-glog/download/ '.
Now, I run the follow command:
bazel build --distdir=/home/jamescook/lab/test/new-glog/download/ glog
then build error happens,follow is the detail info:
bazel build --distdir=/home/jamescook/lab/test/new-glog/download/ glog
INFO: Call stack for the definition of repository 'com_github_gflags_gflags' which is a http_archive (rule definition at /root/.cache/bazel/_bazel_root/4103e065900cc37ff22791b2ccc18505/external/bazel_tools/tools/build_defs/repo/http.bzl:296:16):
/home/jamescook/lab/test/new-glog/glog-0.4.0/WORKSPACE:3:1
WARNING: Download from https://mirror.bazel.build/github.com/gflags/gflags/archive/v2.2.2.tar.gz failed: class java.net.ConnectException Network is unreachable (connect failed)
WARNING: Download from https://github.com/gflags/gflags/archive/v2.2.2.tar.gz failed: class java.net.ConnectException Network is unreachable (connect failed)
ERROR: An error occurred during the fetch of repository 'com_github_gflags_gflags':
java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/gflags/gflags/archive/v2.2.2.tar.gz, https://github.com/gflags/gflags/archive/v2.2.2.tar.gz] to /root/.cache/bazel/_bazel_root/4103e065900cc37ff22791b2ccc18505/external/com_github_gflags_gflags/v2.2.2.tar.gz: Network is unreachable (connect failed)
ERROR: /home/jamescook/lab/test/new-glog/glog-0.4.0/BUILD:5:1: //:glog depends on @com_github_gflags_gflags//:gflags in repository @com_github_gflags_gflags which failed to fetch. no such package '@com_github_gflags_gflags//': java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/gflags/gflags/archive/v2.2.2.tar.gz, https://github.com/gflags/gflags/archive/v2.2.2.tar.gz] to /root/.cache/bazel/_bazel_root/4103e065900cc37ff22791b2ccc18505/external/com_github_gflags_gflags/v2.2.2.tar.gz: Network is unreachable (connect failed)
ERROR: Analysis of target '//:glog' failed; build aborted: no such package '@com_github_gflags_gflags//': java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/gflags/gflags/archive/v2.2.2.tar.gz, https://github.com/gflags/gflags/archive/v2.2.2.tar.gz] to /root/.cache/bazel/_bazel_root/4103e065900cc37ff22791b2ccc18505/external/com_github_gflags_gflags/v2.2.2.tar.gz: Network is unreachable (connect failed)
INFO: Elapsed time: 25.645s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
If I used it wrong, how should I change it?
The text was updated successfully, but these errors were encountered: