Why does "bazel build" download data runtime dependencies?

66 views
Skip to first unread message

Carlos Galvez

unread,
Jul 4, 2022, 5:32:24 AM7/4/22
to bazel-discuss
Hi,

Having the following:

cc_binary(
  name = "foo",
  srcs = ["foo.cpp"],
  data = ["@some//:files"],  # Very large, gigabytes
)

Where:

filegroup(
  name = "files",
  data = [ ... ],
)

And the "@some" repository comes from an "http_archive".

If I run "bazel build //path/to:foo", it downloads GB's of runtime data dependencies, that are not needed to simply build C++ code.

Why are these runtime data dependencies downloaded at "build" time? Is there a way to avoid this, and download only at "run" time? This causes great trouble for build and lint actions that don't depend on the data.

Thanks!


  

Xudong Yang

unread,
Jul 4, 2022, 8:50:23 AM7/4/22
to Carlos Galvez, bazel-discuss
See https://github.com/bazelbuild/bazel/issues/15017; this is intended behavior.

--
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/dab6195d-ae22-4482-95e9-674522a41a06n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages