Hi,
I'm trying to figure out how to use abseil with bazel as an external dependency without having to download it onto my machine (since this requires giving an absolute path to the source, which is ugly...). To test this out, I basically checked out the git repo, made a tarball out of it and uploaded it onto a server. After doing this, I added the following into my blaze WORKSPACE file:
http_archive(
name = "com_google_absl",
sha256 = "a085fb163b5996fdbe9145d79f1a57908ae3341a57052679956073655d050a18",
urls = ["
http://hans.math.upenn.edu/~edvardf/abseil-cpp.tar.gz"]
)
I added a BUILD dep for a test binary:
cc_binary(
name = "server_main",
srcs = [ "main.cc" ],
deps = [
"@com_google_absl//absl/strings",
],
)
Doing "bazel build :server_main", I see the following error:
ERROR: /Users/efagerho/git/tfserver/server/BUILD:19:1: no such package '@com_google_absl//absl/strings': BUILD file not found on package path and referenced by '//server:server_main'
ERROR: Analysis of target '//server:server_main' failed; build aborted: no such package '@com_google_absl//absl/strings': BUILD file not found on package path
INFO: Elapsed time: 0.133s
FAILED: Build did NOT complete successfully (0 packages loaded)
If I untar abseil-cpp.tar.gz, I see that there's not file named "BUILD" in the folder, but there is a file named "BUILD.bazel". Not sure if this is the problem or if there's something else going on? It would also help if the project created official snapshots of the library as tarballs and put them on github, so this would work out-of-the-box.
Best,
Edvard