--
You received this message because you are subscribed to the Google Groups "bazel-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-dev+...@googlegroups.com.
To post to this group, send email to baze...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-dev/add076c4-2897-4461-911c-2324929286a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
+John Field (given that Dmitry and Klaus are on vacation.)
--
László Csomor | Software Engineer | laszlo...@google.com
Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: HamburgGeschäftsführer: Paul Manicle, Halimah DeLaine PradoOn Fri, Jun 22, 2018 at 9:31 AM László Csomor <laszlo...@google.com> wrote:Hi Rong Jie,I agree it'd be nice for Bazel to use Abseil. Migration has a non-zero cost for us though, plus there are other questions.
Questions:- Rong Jie: sounds like you are volunteering to migrate Bazel's C++ code to use Abseil, is that correct? :)
- Rong Jie: can you say more about which functions you see fit to use from Abseil? String manipulation comes to mind, is there anything else, e.g. file I/O?
I believe we will have to check in absl into Bazel's source tree as it is will be part of the main binary and therefore required for bootstrapping Bazel.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-dev+unsubscribe@googlegroups.com.
To post to this group, send email to baze...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-dev/add076c4-2897-4461-911c-2324929286a2%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
--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
So I think using Abseil is better than not and as such, volunteers are *very* appreciated.
A word of warning to Laszlo, though: merging these changes won't be trivial since we also need to update our internal C++ code, too. It's not a lot, but it's not zero work, either.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-dev+...@googlegroups.com.
To post to this group, send email to baze...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-dev/add076c4-2897-4461-911c-2324929286a2%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
--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
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-dev/CAJ5fxH%2BduChTsQhSLZK8RaUN9BCT61N4TA1LV%2BrmKcFBhrsBjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Until logging was available, we had decided that the additional library in bazel/third_party would be an unnecessary burden.
But note that most of our code is in Java. The C++ part is relatively small. I don't think the point "Adopting Abseil can help open-sourcing more Blaze's code faster" is true (I can't think of any C++ code we plan to open-source in Bazel). I also suspect that migrating to Abseil will create extra work and bring very little benefits.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-dev/CAMC1H_pd7eheLjHzGXEYde0YMUSND5CADFF5qVgKZMUUWC82ng%40mail.gmail.com.
note that we already use parts of it
require that the repo is self contained
I’m not aware of any remaining C++ code for us to open source, is there?
Google security team tells me that all source going into the Bazel binary must be code reviewed, and the easiest way to programmatically enforce that is to require that the repo is self contained and has no binary plugs. This may not be the case right now, but will have to be in the future.That said, I don’t see much benefit from using more of Abseil (note that we already use parts of it).
I’m not aware of any remaining C++ code for us to open source, is there?
> `//src/main/cpp/util` has a few functions that are the same as Abseil.Well, yes, but how many functions we are talking about? Do they change much? Why it is beneficial to switch to Abseil implementations?
> By adopting Abseil C++, we can be sure that Bazel is using the most performant and secure implementation of these functions.Do we have evidence that current implementations are insufficiently performant or insecure for Bazel?
What are the sizes savings we are talking about? My guess is that should be < 100Kbytes, probably much less. Does it justify additional dependency for Bazel?
I am still wondering whether we have a strong reason to add Abseil as a Bazel dependency *at this time*.
Not to say we shouldn't use Abseil in the future, e.g. for logging when it is available, as Rong Jie Loo and Chloe Calvarin mentioned.
But for now, I do not see very strong motivation pro Abseil to offset the costs of adding an extra dependency - let me know if I missed or misrepresented anything.
On Mon, Jul 2, 2018 at 7:45 PM Dmitry Lomov <dsl...@google.com> wrote:> `//src/main/cpp/util` has a few functions that are the same as Abseil.Well, yes, but how many functions we are talking about? Do they change much? Why it is beneficial to switch to Abseil implementations?> By adopting Abseil C++, we can be sure that Bazel is using the most performant and secure implementation of these functions.Do we have evidence that current implementations are insufficiently performant or insecure for Bazel?One example I can think of: absl::StrCat vs other string formatting utilities. See screenshot at https://youtu.be/xu7q8dGvuwk?t=44m35s for benchmark (Note: Bazel currently uses std::to_string and *stringstream heavily to construct paths and command line).
What are the sizes savings we are talking about? My guess is that should be < 100Kbytes, probably much less. Does it justify additional dependency for Bazel?If all projects migrate to absl::logging (which Abseil team promises does not use [i]ostream) and every string formatting to no longer depends on *stringstream, each final executable should have about 100KB or more saving if they are fully statically linked to libstdc++ (depends on the number of operator<< overloads, the saving will be less if final executable is dynamically linked to libstdc++). [1] (However, I don't think gRPC and protobuf can be iostream-free anytime soon, migrating existing code to absl::logging and absl/strings won't be quick).Sharing other Abseil primitives with gRPC and Protobuf probably can push this a little further.I am still wondering whether we have a strong reason to add Abseil as a Bazel dependency *at this time*.Not to say we shouldn't use Abseil in the future, e.g. for logging when it is available, as Rong Jie Loo and Chloe Calvarin mentioned.But for now, I do not see very strong motivation pro Abseil to offset the costs of adding an extra dependency - let me know if I missed or misrepresented anything.Since there are no more C++ code to be open-sourced and internal version of Blaze is Abseil-free, starting the migration now or later probably won't make a difference. Therefore, I agree that there is no hurry to add a new dependency now. However, once Bazel has decided to use absl::logging (and maybe together with absl::Status [2]), I think it won't hurt to use more Abseil *after* that?
[1]: [i]ostream and family have long been criticized for their binary footprint as they will pull in the the huge <locale> library into the final binary and linker usually can't eliminate dead code.[2]: absl::Status can be used to propagate error message back to caller and all the way down instead of just call BAZEL_DIE/diag_err[x] in callee to terminate program. See TODO: https://github.com/bazelbuild/bazel/blob/master/src/main/cpp/blaze_util_windows.cc#L68
On Mon, Jul 2, 2018 at 3:08 PM Rong Jie Loo <looro...@gmail.com> wrote:Since there are no more C++ code to be open-sourced and internal version of Blaze is Abseil-free, starting the migration now or later probably won't make a difference. Therefore, I agree that there is no hurry to add a new dependency now. However, once Bazel has decided to use absl::logging (and maybe together with absl::Status [2]), I think it won't hurt to use more Abseil *after* that?Once we do have a dependency then by all means - for any *new* code.I would caution against change for the sake of change though: if we do not see a clear benefit in rewriting something to use Abseil, we should not do it.
--
You received this message because you are subscribed to the Google Groups "bazel-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-dev+...@googlegroups.com.
To post to this group, send email to baze...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-dev/CAObu7DFSWtctKa05v5oRs6zaRHpM48bVpBB5rFnTF-b4Sut4kw%40mail.gmail.com.
Agreed that the rewrite will need to be done carefully, but I'm with Julio that it's worth it. I've spent a lot of time in the last few months trying to get our c++ libraries to do what they say they do - having libraries that we trust, out of the box? Amazing.To add another point to the list of reasons to do this - Laszlo's working on the Bazel client's performance when extracting the Bazel binary and starting up the server. In https://github.com/bazelbuild/bazel/pull/5487, he's having to add threadpool to our c++ utilities, where we could just rely on abseil's concurrency support. Can we agree to add abseil directly instead of reimplementing threadpools?