bazel fetch unconditionally fetching dependencies, is that correct?

619 views
Skip to first unread message

Derek Perez

unread,
Apr 20, 2021, 11:18:55 PM4/20/21
to bazel-discuss, David Jones
Here's what I'm doing:

cloning this repository:

and running bazel fetch //... fails with the following message:

ERROR: /private/var/tmp/_bazel_pzd/c17e9dfd65f609874d4755d44ce042d8/external/com_google_googletest/BUILD.bazel:57:11: no such package '@com_google_absl//absl/types': The repository '@com_google_absl' could not be resolved and referenced by '@com_google_googletest//:gtest'
ERROR: /private/var/tmp/_bazel_pzd/c17e9dfd65f609874d4755d44ce042d8/external/com_google_googletest/BUILD.bazel:57:11: no such package '@com_google_absl//absl/debugging': The repository '@com_google_absl' could not be resolved and referenced by '@com_google_googletest//:gtest'
ERROR: /private/var/tmp/_bazel_pzd/c17e9dfd65f609874d4755d44ce042d8/external/com_google_googletest/BUILD.bazel:57:11: no such package '@com_google_absl//absl/types': The repository '@com_google_absl' could not be resolved and referenced by '@com_google_googletest//:gtest'
ERROR: /private/var/tmp/_bazel_pzd/c17e9dfd65f609874d4755d44ce042d8/external/com_google_googletest/BUILD.bazel:57:11: no such package '@com_google_absl//absl/debugging': The repository '@com_google_absl' could not be resolved and referenced by '@com_google_googletest//:gtest'
ERROR: /private/var/tmp/_bazel_pzd/c17e9dfd65f609874d4755d44ce042d8/external/com_google_googletest/BUILD.bazel:57:11: no such package '@com_google_absl//absl/debugging': The repository '@com_google_absl' could not be resolved and referenced by '@com_google_googletest//:gtest'
ERROR: /private/var/tmp/_bazel_pzd/c17e9dfd65f609874d4755d44ce042d8/external/com_google_googletest/BUILD.bazel:57:11: no such package '@com_google_absl//absl/strings': The repository '@com_google_absl' could not be resolved and referenced by '@com_google_googletest//:gtest'

Our project does not depend on absl, but googletest does:

However, that appears to be select conditioned, and nothing I can tell should be setting absl=1 as a --define. So, this kinda makes it seem like its unconditionally attempting to fetch it.....is this how it should work?

If I run bazel build --nobuild --fetch //... this works expected.

Xudong Yang

unread,
Apr 21, 2021, 4:49:53 AM4/21/21
to Derek Perez, bazel-discuss, David Jones
Looks like this might be similar to https://github.com/bazelbuild/bazel/issues/12861, where `bazel query` causes all match arms to be fetched. So `bazel fetch` might be doing the same thing.

This is arguably a bug, but I don't have enough knowledge about `bazel fetch` (yet) to tell how feasible a fix would be. Good to keep this in mind though.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAJGs%2BiKxy4H1biU9WNmMR5v-%2BdA-HU%2BK9R5f4O532c3%3DPh6vWw%40mail.gmail.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages