--
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-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/04b2c790-6629-4e18-9036-4978c360490a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
+hlopko, plf
On Tue, May 29, 2018 at 2:57 PM, Magnus Andersson <magnus.a...@gmail.com> wrote:
The cc_library(...) and cc_binary(...) rules only have one dependency list (the "deps" parameter). Some other build systems have two dependency lists - one public and one private. The public dependencies are the dependencies for the public .h-files. The private dependencies are the dependencies for private .h-files and .c/.cpp-files. The benefit with private dependencies is that .h-files that only your implementation needs are not exposed to libraries that depend on you. Or to put it in another way: Private dependencies only adds -I flags when you build your library. Public dependencies adds -I flags when you build your library, and everything that depends on your library.One example of a build system that supports private dependencies is GN, the build system in Chromium (which generates ninja files from BUILD.gn files which are very similar to Bazel BUILD files).What is the reason why Bazel lacks private dependencies? Are there any plans to add this feature?
--
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/04b2c790-6629-4e18-9036-4978c360490a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
cc_library(
name = "libA",
srcs = ["a.c"],
deps = [":libB"],
)
cc_library(
name ="libB",
hdrs = ["b.h"],
srcs = ["b.c"]
deps = [":libC"],
)
cc_library(
name = "libC",
hdrs = ["c.h"],
)cc_library(
name = "libA",
srcs = ["a.c"],
deps = [":libB"],
)
cc_library(
name ="libB",
hdrs = ["b.h"],
srcs = ["b.c"]
impl_deps = [":libC"],
)
cc_library(
name = "libC",
hdrs = ["c.h"],
)To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/a43e6303-e1ef-4c70-8acb-6924abe7fe4b%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/07a58bee-892c-431f-a420-de5b95585e9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/07a58bee-892c-431f-a420-de5b95585e9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Ulf,A side question about include scanning:In one of your talks you said that the (or at least a) purpose of include scanning was to minimize the number of headers that need to be copied to the remote host, when using remote execution.Does the current remote execution implementation copy all public headers transitively to the remote host?
Then I would say that include scanning is not only useful, but required for us to get decent build performance with remote execution. We have long dependency graph branches, and ususally only a fraction of all these .h-files are necessary to compile a specific .c-file.
/ Magnus
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/07a58bee-892c-431f-a420-de5b95585e9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Marcel Hlopko | Software Engineer | hlo...@google.com |Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany | Geschäftsführer: Geschäftsführer: Paul Manicle, Halimah DeLaine Prado | Registergericht und -nummer: Hamburg, HRB 86891
--
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/CAFXA0Af6TcEo4jQBkoomvc19T%3D7bJ4H-n36fGvKiMgrDOoa8nw%40mail.gmail.com.
On Mon, Jun 4, 2018 at 11:01 AM Magnus Andersson <magnus.a...@gmail.com> wrote:Hi Ulf,A side question about include scanning:In one of your talks you said that the (or at least a) purpose of include scanning was to minimize the number of headers that need to be copied to the remote host, when using remote execution.Does the current remote execution implementation copy all public headers transitively to the remote host?That's correct.Then I would say that include scanning is not only useful, but required for us to get decent build performance with remote execution. We have long dependency graph branches, and ususally only a fraction of all these .h-files are necessary to compile a specific .c-file.The protocol cost per file is fairly low; include scanning may be more expensive than just posting the additional files in the protocol (assuming the remote executor caches input files so you don't have to upload the files all the time) until you get to a very large number of files.I don't know where the crossover point is that makes include scanning a net win. It is possible that very small builds would already benefit. There are also some additional drawbacks of include scanning including higher local CPU utilization as well as more expensive locally clean, remotely cached builds. Our include scanning implementation is also not perfect, and sometimes requires "include hints" to find all the necessary files.As an example from Google, we have cases where include scanning reduces the number of inputs to the protocol from ~hundreds of millions to ~tens of millions for a build of a single target (not a single action).I'll also say that we initially didn't want to open source include scanning because we were hoping to be able to remove it while still maintaining good performance. None of those plans have panned out, however, and I currently believe that include scanning is here to stay.