--PK
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFDTh%3DxPDb--Z%3DPEq06Gh11J0AtbakZ1NFMymGFUTCoTgA%40mail.gmail.com.
On Tue, Jun 16, 2020 at 9:26 PM Peter Kasting <pkas...@chromium.org> wrote:
- Proposal: Allow absl::any and absl::variant to start with, as these polyfill C++17 types, have no base:: implementation, and have consumer interest .
Variant has been a persistent thing that we've wanted (though I've heard std::variant can blow up in binary size, so we might want to be a little cautious). Does absl::any have a concrete use case in Chromium?
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFANC0-mmgXS4MGqYUubr50_OG5mevb_mp9uBpkfBA8jJA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAZdMacERRu%2BnpyWmF4owcuaseuUMoPSm5-gYn6c2bwt_HfJ2Q%40mail.gmail.com.
Hello cxx@,TLDR: Several of us think we should allow first-party code to depend on Abseil, and want to plan how to roll it out. Reply if you have opinions.Longer version: An internal thread raised several instances of requests for Abseil, ranging in necessity. Chrome Eng Review is on board in principle. danakj@, dcheng@, thakis@, and I discussed the technical blockers here, including getting sufficient support from Abseil for Chromium's needs, and not risking being stranded if Abseil wants to drop C++14 support before Chromium is ready. We believe those blockers are being addressed sufficiently.The immediate technical blocker is http://crbug.com/1046390 , which is being addressed. Once that is fixed, I believe that in principle we could begin allowing first-party use of absl:: code. To do this we need three things:
- Agreement-in-principle that we do, in fact, want to allow this.
- Proposal: Consider this agreed if there is no unresolved negative feedback after a week.
- A high-level idea of how to do the roll-out.
- Proposal: Treat this similarly to a new C++ version, in that we start with most things default-banned, allow on a by-request basis, and aim to default-allow within two years. Track in the Chromium style guide and chromium-cpp.appspot.com.
- Specific details for (2), particularly obviously-safe things to allow from the beginning or obviously-concerning constructs to look at more closely.
- Proposal: Allow absl::any and absl::variant to start with, as these polyfill C++17 types, have no base:: implementation, and have consumer interest . Allow other types and functions to begin with only as necessary to compile against third-party code using Abseil and convert to non-absl:: types. Create a list of overlaps between base:: and absl:: (e.g. base::Optional vs. absl::optional, base::StringPiece vs. absl::string_view, base::Time and related classes vs. absl::Time and related classes, etc.) and decide a plan for deduplication going forward. Bias towards std:: types, then absl:: types, then base:: types.
--PK
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFDTh%3DxPDb--Z%3DPEq06Gh11J0AtbakZ1NFMymGFUTCoTgA%40mail.gmail.com.
To me the key thing is that we not lose safety and correctness by preferring absl::foo to base::foo. We've put a lot of work into making base more resilient and secure — recently confirmed by Project Zero to have stopped some real attacks, by the way — and I *really* don't want for Chromium to regress.Toward that end, keep in mind that we always need to build Abseil with its hardening mode turned on in Chromium. That's a minimum requirement.In my dream world, we'd 'productize' as much of base as we could, re-designing it as we go and as/if necessary for ergonomic safety, and make it as easy as possible for any callers (inside or outside of Chromium) to call it. The world needs a safety-oriented C++ library that remains as efficient as possible, and base is low-key succeeding at that, IMO. AFAICT nobody else is attempting to do this, so there's an unmet need in the world.
Proposal: Treat this similarly to a new C++ version, in that we start with most things default-banned, allow on a by-request basis, and aim to default-allow within two years. Track in the Chromium style guide and chromium-cpp.appspot.com.
Proposal: Allow absl::any and absl::variant to start with, as these polyfill C++17 types, have no base:: implementation, and have consumer interest . Allow other types and functions to begin with only as necessary to compile against third-party code using Abseil and convert to non-absl:: types. Create a list of overlaps between base:: and absl:: (e.g. base::Optional vs. absl::optional, base::StringPiece vs. absl::string_view, base::Time and related classes vs. absl::Time and related classes, etc.) and decide a plan for deduplication going forward. Bias towards std:: types, then absl:: types, then base:: types.
--On Tue, Jun 16, 2020 at 7:04 PM Victor Vasiliev <vas...@chromium.org> wrote:Does Abseil still have no plan to support basic_string_view<T> for any T other than char? I assume that would mean we'd have to keep StringPiece16 even if we switch from StringPiece to absl::string_view.--On Tue, Jun 16, 2020 at 9:52 PM Peter Kasting <pkas...@chromium.org> wrote:--On Tue, Jun 16, 2020 at 6:48 PM Jeremy Roman <jbr...@chromium.org> wrote:On Tue, Jun 16, 2020 at 9:26 PM Peter Kasting <pkas...@chromium.org> wrote:
- Proposal: Allow absl::any and absl::variant to start with, as these polyfill C++17 types, have no base:: implementation, and have consumer interest .
Variant has been a persistent thing that we've wanted (though I've heard std::variant can blow up in binary size, so we might want to be a little cautious). Does absl::any have a concrete use case in Chromium?https://chromium-review.googlesource.com/c/chromium/src/+/2228543 uses it somewhat heavily (mainly because of the interface-with-third-party-code thing), and that project was one of the consumers that prompted this discussion.::variant is definitely the obvious one we've asked for, but given the CL above and the fact that absl::any is basically just C++17's std::any, I put it in the list. Feel free to disagree :)PK
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFANC0-mmgXS4MGqYUubr50_OG5mevb_mp9uBpkfBA8jJA%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAZdMacERRu%2BnpyWmF4owcuaseuUMoPSm5-gYn6c2bwt_HfJ2Q%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAOuvq22KYgih5TQvMQUviC4c%3Djs-g9wbgBk%3DDmHg2L1zLpMy0w%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFDTh%3DxPDb--Z%3DPEq06Gh11J0AtbakZ1NFMymGFUTCoTgA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CALhVsw2%3DWcaiDm4DCAxP1_znzBxXk77L3sBhc3UNN45GGrF7hw%40mail.gmail.com.
Does Abseil still have no plan to support basic_string_view<T> for any T other than char? I assume that would mean we'd have to keep StringPiece16 even if we switch from StringPiece to absl::string_view.
On Tue, Jun 16, 2020 at 9:26 PM Peter Kasting <pkas...@chromium.org> wrote:
- A high-level idea of how to do the roll-out.
- Proposal: Treat this similarly to a new C++ version, in that we start with most things default-banned, allow on a by-request basis, and aim to default-allow within two years. Track in the Chromium style guide and chromium-cpp.appspot.com.
A key difference with C++ style I think is that absl also brings in a library of utils. Hence, some folks not tracking cxx@ likely need a say in whether we let some utilities in. e.g. I'd want //base/task/OWNERS to be looped in if threading utils are considered.
On Tue, Jun 16, 2020 at 9:14 PM Chris Palmer <pal...@chromium.org> wrote:To me the key thing is that we not lose safety and correctness by preferring absl::foo to base::foo. We've put a lot of work into making base more resilient and secure — recently confirmed by Project Zero to have stopped some real attacks, by the way — and I *really* don't want for Chromium to regress.Toward that end, keep in mind that we always need to build Abseil with its hardening mode turned on in Chromium. That's a minimum requirement.In my dream world, we'd 'productize' as much of base as we could, re-designing it as we go and as/if necessary for ergonomic safety, and make it as easy as possible for any callers (inside or outside of Chromium) to call it. The world needs a safety-oriented C++ library that remains as efficient as possible, and base is low-key succeeding at that, IMO. AFAICT nobody else is attempting to do this, so there's an unmet need in the world.I'd like to second this point: for absl things we do start using in //base, I'd want to make sure we have some smoke tests to ensure that the appropriate CHECKs are enabled. To me, this is especially important because my understanding is absl transparently maps through to the standard library version if it's recent enough (e.g. support for optional, string_view, variant). I want to make sure we don't end up in a situation where we had security hardening and then lost it by upgrading a new C++ version.
Proposal: Treat this similarly to a new C++ version, in that we start with most things default-banned, allow on a by-request basis, and aim to default-allow within two years. Track in the Chromium style guide and chromium-cpp.appspot.com.How often does absl change/add new things? I'm a bit hesitant to say that we should just default-allow in two years, depending on how often new concepts/functionality is introduced. It seems to me the most value comes from the container types, especially for interop with other third-party libraries that are using absl at library boundaries.
Proposal: Allow absl::any and absl::variant to start with, as these polyfill C++17 types, have no base:: implementation, and have consumer interest . Allow other types and functions to begin with only as necessary to compile against third-party code using Abseil and convert to non-absl:: types. Create a list of overlaps between base:: and absl:: (e.g. base::Optional vs. absl::optional, base::StringPiece vs. absl::string_view, base::Time and related classes vs. absl::Time and related classes, etc.) and decide a plan for deduplication going forward. Bias towards std:: types, then absl:: types, then base:: types.I can't say that I personally care for any, but maybe I don't understand the use cases. I know there's a CL that wants to use absl::any, but it's hard to tell exactly what the intended usage is (since it's a support library for third-party code).
Finally, I'd like to add that span and absl's hash containers should probably be on this list: in particular, I'd really like to see absl's hash containers be the default recommendation (though we'll likely need to benchmark ARM).
For types that are redundant between //base and //absl, interoperating with third-party libraries that use absl is somewhat painful. An example of boilerplate that's needed ishttps://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/platform/peerconnection/webrtc_util.h;l=15;drc=8a030dd3c631e68b67926fff0839ff085d81bdd7, which is pretty unfortunate because it forces a bunch of copies.
I'm not sure if we should replace /everything/ (in particular, I'm skeptical of changing things like Time representations). However, the //base implementations of optional and span were intentionally designed to match the upstream standard library API as closely as possible to facilitate switching to the standard library (or absl) as appropriate.Does this concern also apply to types which have no equivalent in base (absl's hash tables, variant, et cetera)?
Can you provide more background on what is the motivation? I haven't seen a discussion of this on eng-review (only on allowing more third party dependencies to use it).
Specifically, I'm wondering what's to gain from removing the things in base/ that have equivalents in abseil. Presumably what we have works, so is converting them to use something equivalent a good use of our limited resources?
On Wed, Jun 17, 2020 at 3:30 PM Daniel Cheng <dch...@chromium.org> wrote:On Tue, Jun 16, 2020 at 9:14 PM Chris Palmer <pal...@chromium.org> wrote:To me the key thing is that we not lose safety and correctness by preferring absl::foo to base::foo. We've put a lot of work into making base more resilient and secure — recently confirmed by Project Zero to have stopped some real attacks, by the way — and I *really* don't want for Chromium to regress.Toward that end, keep in mind that we always need to build Abseil with its hardening mode turned on in Chromium. That's a minimum requirement.In my dream world, we'd 'productize' as much of base as we could, re-designing it as we go and as/if necessary for ergonomic safety, and make it as easy as possible for any callers (inside or outside of Chromium) to call it. The world needs a safety-oriented C++ library that remains as efficient as possible, and base is low-key succeeding at that, IMO. AFAICT nobody else is attempting to do this, so there's an unmet need in the world.I'd like to second this point: for absl things we do start using in //base, I'd want to make sure we have some smoke tests to ensure that the appropriate CHECKs are enabled. To me, this is especially important because my understanding is absl transparently maps through to the standard library version if it's recent enough (e.g. support for optional, string_view, variant). I want to make sure we don't end up in a situation where we had security hardening and then lost it by upgrading a new C++ version.This is a good point. @palmer: Do we currently have death tests that verify our hardening of different things? If not, it seems like we should add them.Regarding mapping through, you can toggle between "force std/force absl/auto-select"; see https://abseil.io/blog/201901115-options#read-more . Thus I don't think this concern should gate, but I do think we need the tests so that we don't lose security absent-mindedly.Proposal: Treat this similarly to a new C++ version, in that we start with most things default-banned, allow on a by-request basis, and aim to default-allow within two years. Track in the Chromium style guide and chromium-cpp.appspot.com.How often does absl change/add new things? I'm a bit hesitant to say that we should just default-allow in two years, depending on how often new concepts/functionality is introduced. It seems to me the most value comes from the container types, especially for interop with other third-party libraries that are using absl at library boundaries.Looking at this more, I share your core concern. It's a big concerning new functionality upstream adds gains significant usage in Chromium before we've had a chance to review-in-principle. But since Abseil is less "versioned" than C++ itself, it's harder to guarantee that from both a linguistic perspective ("Abseil v3 is allowed" is not very meaningful) or a technical one (we can live on LTS branches instead of HEAD, but those are just basically cut-every-six-months).For a steady-state goal, we have several choices I can think of:
- "Laissez faire": Since Abseil is guided by principles and values closer to Chromium's than C++ is, assume that reactively disallowing problematic functionality as needed will be sufficient
- "Proactive consideration": We monitor what goes into Abseil, discuss new additions periodically, and rule on them reasonably quickly
- "Constant vigilance": Only explicitly allowed functionality may ever be used (enforced by e.g. PRESUBMIT); using more requires an explicit request
Personally I'm OK with either 1 or 2; I don't think 3 is warranted. If we do 2, we'll need to figure out who/what is responsible for said monitoring.Proposal: Allow absl::any and absl::variant to start with, as these polyfill C++17 types, have no base:: implementation, and have consumer interest . Allow other types and functions to begin with only as necessary to compile against third-party code using Abseil and convert to non-absl:: types. Create a list of overlaps between base:: and absl:: (e.g. base::Optional vs. absl::optional, base::StringPiece vs. absl::string_view, base::Time and related classes vs. absl::Time and related classes, etc.) and decide a plan for deduplication going forward. Bias towards std:: types, then absl:: types, then base:: types.I can't say that I personally care for any, but maybe I don't understand the use cases. I know there's a CL that wants to use absl::any, but it's hard to tell exactly what the intended usage is (since it's a support library for third-party code).In Chromium itself, usage would be rare,
basically for type-erased stuff and "arbitrary property" sorts of cases (View class properties, WebContents user data, etc.). It's convenient but not critical for these and I'm not wedded to having it early or at all, but any objections we'd make to absl::any will also apply to std::any in C++17, so it's probably less about discussing whether to take absl's version as whether we think the feature is risky enough that we should permanently ban it.Finally, I'd like to add that span and absl's hash containers should probably be on this list: in particular, I'd really like to see absl's hash containers be the default recommendation (though we'll likely need to benchmark ARM).I didn't put ::span on the initial list since base::span exists and I didn't want to start off with a list that overlaps at all (since any overlapping thing should have a long-term plan about where we're converging to), but yes, with things like ::span and ::optional where base, absl, and std all aim to implement the identical API, I think there's a solid case for using first absl and then std, modulo security check support.Hash containers are one where I'd like to see the simplest, clearest guidance possible, and we already have enough containers that I'd want us to understand precisely how they should slot into that guidance before we allow them. So they wouldn't be on my initial list either, but certainly worth the time to look at in more detail.PK
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFCY3BEOtBa2CO%2Brtm7WpxxHJiQtxfF1d_HAQehuH2ijxw%40mail.gmail.com.
On Wed, Jun 17, 2020 at 4:45 PM Daniel Cheng <dch...@chromium.org> wrote:For types that are redundant between //base and //absl, interoperating with third-party libraries that use absl is somewhat painful. An example of boilerplate that's needed ishttps://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/platform/peerconnection/webrtc_util.h;l=15;drc=8a030dd3c631e68b67926fff0839ff085d81bdd7, which is pretty unfortunate because it forces a bunch of copies.I see, so a motivator is as more code that's rolled in via DEPS uses abseil, us not using it leads to more work at the edges.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CALhVsw1YKoOXHCiyRb0nWC2w8FdORT1ip_BX%3DpfSO8x7571Y%2Bw%40mail.gmail.com.
On Wed, Jun 17, 2020 at 3:30 PM Daniel Cheng <dch...@chromium.org> wrote:On Tue, Jun 16, 2020 at 9:14 PM Chris Palmer <pal...@chromium.org> wrote:To me the key thing is that we not lose safety and correctness by preferring absl::foo to base::foo. We've put a lot of work into making base more resilient and secure — recently confirmed by Project Zero to have stopped some real attacks, by the way — and I *really* don't want for Chromium to regress.Toward that end, keep in mind that we always need to build Abseil with its hardening mode turned on in Chromium. That's a minimum requirement.In my dream world, we'd 'productize' as much of base as we could, re-designing it as we go and as/if necessary for ergonomic safety, and make it as easy as possible for any callers (inside or outside of Chromium) to call it. The world needs a safety-oriented C++ library that remains as efficient as possible, and base is low-key succeeding at that, IMO. AFAICT nobody else is attempting to do this, so there's an unmet need in the world.I'd like to second this point: for absl things we do start using in //base, I'd want to make sure we have some smoke tests to ensure that the appropriate CHECKs are enabled. To me, this is especially important because my understanding is absl transparently maps through to the standard library version if it's recent enough (e.g. support for optional, string_view, variant). I want to make sure we don't end up in a situation where we had security hardening and then lost it by upgrading a new C++ version.This is a good point. @palmer: Do we currently have death tests that verify our hardening of different things? If not, it seems like we should add them.Regarding mapping through, you can toggle between "force std/force absl/auto-select"; see https://abseil.io/blog/201901115-options#read-more . Thus I don't think this concern should gate, but I do think we need the tests so that we don't lose security absent-mindedly.
Proposal: Treat this similarly to a new C++ version, in that we start with most things default-banned, allow on a by-request basis, and aim to default-allow within two years. Track in the Chromium style guide and chromium-cpp.appspot.com.How often does absl change/add new things? I'm a bit hesitant to say that we should just default-allow in two years, depending on how often new concepts/functionality is introduced. It seems to me the most value comes from the container types, especially for interop with other third-party libraries that are using absl at library boundaries.Looking at this more, I share your core concern. It's a big concerning new functionality upstream adds gains significant usage in Chromium before we've had a chance to review-in-principle. But since Abseil is less "versioned" than C++ itself, it's harder to guarantee that from both a linguistic perspective ("Abseil v3 is allowed" is not very meaningful) or a technical one (we can live on LTS branches instead of HEAD, but those are just basically cut-every-six-months).For a steady-state goal, we have several choices I can think of:
- "Laissez faire": Since Abseil is guided by principles and values closer to Chromium's than C++ is, assume that reactively disallowing problematic functionality as needed will be sufficient
- "Proactive consideration": We monitor what goes into Abseil, discuss new additions periodically, and rule on them reasonably quickly
- "Constant vigilance": Only explicitly allowed functionality may ever be used (enforced by e.g. PRESUBMIT); using more requires an explicit request
Personally I'm OK with either 1 or 2; I don't think 3 is warranted. If we do 2, we'll need to figure out who/what is responsible for said monitoring.
Hash containers are one where I'd like to see the simplest, clearest guidance possible, and we already have enough containers that I'd want us to understand precisely how they should slot into that guidance before we allow them. So they wouldn't be on my initial list either, but certainly worth the time to look at in more detail.PK
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFCY3BEOtBa2CO%2Brtm7WpxxHJiQtxfF1d_HAQehuH2ijxw%40mail.gmail.com.
On Thu, Jun 18, 2020 at 2:59 AM Peter Kasting <pkas...@chromium.org> wrote:On Wed, Jun 17, 2020 at 3:30 PM Daniel Cheng <dch...@chromium.org> wrote:On Tue, Jun 16, 2020 at 9:14 PM Chris Palmer <pal...@chromium.org> wrote:To me the key thing is that we not lose safety and correctness by preferring absl::foo to base::foo. We've put a lot of work into making base more resilient and secure — recently confirmed by Project Zero to have stopped some real attacks, by the way — and I *really* don't want for Chromium to regress.Toward that end, keep in mind that we always need to build Abseil with its hardening mode turned on in Chromium. That's a minimum requirement.In my dream world, we'd 'productize' as much of base as we could, re-designing it as we go and as/if necessary for ergonomic safety, and make it as easy as possible for any callers (inside or outside of Chromium) to call it. The world needs a safety-oriented C++ library that remains as efficient as possible, and base is low-key succeeding at that, IMO. AFAICT nobody else is attempting to do this, so there's an unmet need in the world.I'd like to second this point: for absl things we do start using in //base, I'd want to make sure we have some smoke tests to ensure that the appropriate CHECKs are enabled. To me, this is especially important because my understanding is absl transparently maps through to the standard library version if it's recent enough (e.g. support for optional, string_view, variant). I want to make sure we don't end up in a situation where we had security hardening and then lost it by upgrading a new C++ version.This is a good point. @palmer: Do we currently have death tests that verify our hardening of different things? If not, it seems like we should add them.Regarding mapping through, you can toggle between "force std/force absl/auto-select"; see https://abseil.io/blog/201901115-options#read-more . Thus I don't think this concern should gate, but I do think we need the tests so that we don't lose security absent-mindedly.Proposal: Treat this similarly to a new C++ version, in that we start with most things default-banned, allow on a by-request basis, and aim to default-allow within two years. Track in the Chromium style guide and chromium-cpp.appspot.com.How often does absl change/add new things? I'm a bit hesitant to say that we should just default-allow in two years, depending on how often new concepts/functionality is introduced. It seems to me the most value comes from the container types, especially for interop with other third-party libraries that are using absl at library boundaries.Looking at this more, I share your core concern. It's a big concerning new functionality upstream adds gains significant usage in Chromium before we've had a chance to review-in-principle. But since Abseil is less "versioned" than C++ itself, it's harder to guarantee that from both a linguistic perspective ("Abseil v3 is allowed" is not very meaningful) or a technical one (we can live on LTS branches instead of HEAD, but those are just basically cut-every-six-months).For a steady-state goal, we have several choices I can think of:
- "Laissez faire": Since Abseil is guided by principles and values closer to Chromium's than C++ is, assume that reactively disallowing problematic functionality as needed will be sufficient
- "Proactive consideration": We monitor what goes into Abseil, discuss new additions periodically, and rule on them reasonably quickly
- "Constant vigilance": Only explicitly allowed functionality may ever be used (enforced by e.g. PRESUBMIT); using more requires an explicit request
Personally I'm OK with either 1 or 2; I don't think 3 is warranted. If we do 2, we'll need to figure out who/what is responsible for said monitoring.Proposal: Allow absl::any and absl::variant to start with, as these polyfill C++17 types, have no base:: implementation, and have consumer interest . Allow other types and functions to begin with only as necessary to compile against third-party code using Abseil and convert to non-absl:: types. Create a list of overlaps between base:: and absl:: (e.g. base::Optional vs. absl::optional, base::StringPiece vs. absl::string_view, base::Time and related classes vs. absl::Time and related classes, etc.) and decide a plan for deduplication going forward. Bias towards std:: types, then absl:: types, then base:: types.I can't say that I personally care for any, but maybe I don't understand the use cases. I know there's a CL that wants to use absl::any, but it's hard to tell exactly what the intended usage is (since it's a support library for third-party code).In Chromium itself, usage would be rare, basically for type-erased stuff and "arbitrary property" sorts of cases (View class properties, WebContents user data, etc.). It's convenient but not critical for these and I'm not wedded to having it early or at all, but any objections we'd make to absl::any will also apply to std::any in C++17, so it's probably less about discussing whether to take absl's version as whether we think the feature is risky enough that we should permanently ban it.Finally, I'd like to add that span and absl's hash containers should probably be on this list: in particular, I'd really like to see absl's hash containers be the default recommendation (though we'll likely need to benchmark ARM).I didn't put ::span on the initial list since base::span exists and I didn't want to start off with a list that overlaps at all (since any overlapping thing should have a long-term plan about where we're converging to), but yes, with things like ::span and ::optional where base, absl, and std all aim to implement the identical API, I think there's a solid case for using first absl and then std, modulo security check support.base::span (and to some extent base::StringPiece) are in an interesting position where they are closer to the std:: equivalents than the absl:: ones (and also happen to have security checks). Thus aliasing base::span to absl::Span and base::StringPiece to absl::string_view would require a lot of work or is downright impossible. In these cases I therefore vote to keep the base versions.
--However, we can still add implicit conversions between the base and absl versions to alleviate pain at 3rd party API boundaries. Considering that both span and StringPiece are cheap view types this wouldn't cause expensive copies.We can of course also revisit this once abseil is closer to the C++ standard.--Hash containers are one where I'd like to see the simplest, clearest guidance possible, and we already have enough containers that I'd want us to understand precisely how they should slot into that guidance before we allow them. So they wouldn't be on my initial list either, but certainly worth the time to look at in more detail.PK
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFCY3BEOtBa2CO%2Brtm7WpxxHJiQtxfF1d_HAQehuH2ijxw%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CALB5StYbk_vVJE%2BXaN5-eBw_7t3tjHUB7uCtsdU1wgC2g73eoQ%40mail.gmail.com.
| Karl Wiberg | Software Engineer | kwi...@google.com | +46 70 696 1024 |
Summary of where I believe things stand; please correct misimpressions/omissions:
- Agreement in principle to do this
- No unresolved objections; resolved in favor pending details below. Object now if you feel otherwise, as there's a separate thread on this list now requesting approval for a specific first-party use.
- A high-level idea of how to roll out
- General concurrence for starting with most/all things banned and allowing gradually.
- Long-term policy cannot be "default-allow" as absl adds new capabilities and there's insufficient versioning to say "absl17 is allowed" as we do with C++.
- Proposal: Use same policy as with C++ ("force decision by two years"), but applied to individual pieces of absl. As new functionality is rolled in, add it to our canonical list, default-banned, with date added; that's the start date for the two year timeframe. The start date for all existing functionality is whenever we create this list. Enforce all bans with PRESUBMIT. mbonadei@/danilchap@ to establish procedures for ensuring absl is rolled in a timely fashion, new functionality is added to the default-banned list, PRESUBMIT checks are added, and cxx@ is notified if necessary.
- No significant discussion on using chromium-cpp.appspot.com to hold the canonical list. I assume this is OK.
- Specific details
- Agreement that absl usage must not regress security checks, and we should have death tests for these. Bug on file, WIP.
- Some discussion of base:: and absl:: overlaps.
- Proposal: If base:: and absl:: functionality overlap, do not allow the absl functionality without a plan to migrate usage. The standard plan is to migrate the base:: functionality to match absl, type-alias to verify, allow absl usage, and remove the base:: type. Ideally this should not move us farther away from std:: compliance. //base OWNERS to establish procedures for determining and documenting overlaps.
- Insufficient discussion of usage at third-party code boundaries.
- Proposal: All banned functionality is allowed at third-party code boundaries, but only as minimally necessary to compile and link; data must be converted to allowed types/containers for any further processing.
- Open question: Do people just ignore PRESUBMIT warnings for that then?
- Open question: Might there be things so unsafe we cannot even allow this level of usage?
- Significant discussion of specific pieces.
- Known problems:
- absl::string_view cannot replace base::StringPiece16
- absl::any will not work correctly in component builds
- absl::span is less std::-compliant than base::span
- Explicit interest expressed:
- absl::variant
- absl::optional
- hash containers
- Proposal: Once the above general procedures are in place, propose allowing absl::variant. Some //base OWNER (danakj@?) to propose allowing absl::optional, with migration plan. dcheng@ to propose allowing hash containers, with sufficient details about how these fit with our existing containers, usage guidance, performance metrics, etc. Propose formally banning all three "known problems" cases above until those problems are addressed.
I will wait at least a week before considering any of the proposals above to be accepted.PK
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFD30xvsYi2ot0s43LwEee%2BrOFXWo%3DrsUcuekp%3DHgiirFA%40mail.gmail.com.
On Fri, Jun 26, 2020 at 11:26 AM Peter Kasting <pkas...@chromium.org> wrote:
Summary of where I believe things stand; please correct misimpressions/omissions:
- Specific details
- Insufficient discussion of usage at third-party code boundaries.
- Proposal: All banned functionality is allowed at third-party code boundaries, but only as minimally necessary to compile and link; data must be converted to allowed types/containers for any further processing.
- Open question: Do people just ignore PRESUBMIT warnings for that then?
I don't think we should ever ignore warnings. We should have an allowlist to files that do conversions out of third party.
- Open question: Might there be things so unsafe we cannot even allow this level of usage?
If they are then they are unsafe to bring into third_party as well, correct? I don't think we have any real intention to monitor absl usage inside third_party deps in that way, do we?
On Fri, Jun 26, 2020 at 9:51 AM <dan...@chromium.org> wrote:On Fri, Jun 26, 2020 at 11:26 AM Peter Kasting <pkas...@chromium.org> wrote:Summary of where I believe things stand; please correct misimpressions/omissions:
- Specific details
- Insufficient discussion of usage at third-party code boundaries.
- Proposal: All banned functionality is allowed at third-party code boundaries, but only as minimally necessary to compile and link; data must be converted to allowed types/containers for any further processing.
- Open question: Do people just ignore PRESUBMIT warnings for that then?
I don't think we should ever ignore warnings. We should have an allowlist to files that do conversions out of third party.So for example, in https://chromium-review.googlesource.com/c/chromium/src/+/2228543 ,count_down_latch*, scheduled_executor*, system_clock.cc depend on absl::Time/Duration/etc.crypto.cc depends on absl::string_viewWould this directory have a PRESUBMIT.py that basically allows these specific dependencies in these specific files? Would we instead record them somewhere in a metadata file a la DEPS? Would we just whitelist this directory?
- Open question: Might there be things so unsafe we cannot even allow this level of usage?
If they are then they are unsafe to bring into third_party as well, correct? I don't think we have any real intention to monitor absl usage inside third_party deps in that way, do we?Yeah, it's worrisome. One of my concerns is e.g. if absl::any were to not get fixed to work correctly in the component build, and third_party code used it, we could see arbitrary, hard-to-detect bustage in component builds. That seems bad, but I'm not sure what to do here?
PK
Summary of where I believe things stand; please correct misimpressions/omissions:
- Agreement in principle to do this
- No unresolved objections; resolved in favor pending details below. Object now if you feel otherwise, as there's a separate thread on this list now requesting approval for a specific first-party use.
- A high-level idea of how to roll out
- General concurrence for starting with most/all things banned and allowing gradually.
- Long-term policy cannot be "default-allow" as absl adds new capabilities and there's insufficient versioning to say "absl17 is allowed" as we do with C++.
- Proposal: Use same policy as with C++ ("force decision by two years"), but applied to individual pieces of absl. As new functionality is rolled in, add it to our canonical list, default-banned, with date added; that's the start date for the two year timeframe. The start date for all existing functionality is whenever we create this list. Enforce all bans with PRESUBMIT. mbonadei@/danilchap@ to establish procedures for ensuring absl is rolled in a timely fashion, new functionality is added to the default-banned list, PRESUBMIT checks are added, and cxx@ is notified if necessary.
- No significant discussion on using chromium-cpp.appspot.com to hold the canonical list. I assume this is OK.
- Specific details
- Agreement that absl usage must not regress security checks, and we should have death tests for these. Bug on file, WIP.
- Some discussion of base:: and absl:: overlaps.
- Proposal: If base:: and absl:: functionality overlap, do not allow the absl functionality without a plan to migrate usage. The standard plan is to migrate the base:: functionality to match absl, type-alias to verify, allow absl usage, and remove the base:: type. Ideally this should not move us farther away from std:: compliance. //base OWNERS to establish procedures for determining and documenting overlaps.
- Insufficient discussion of usage at third-party code boundaries.
- Proposal: All banned functionality is allowed at third-party code boundaries, but only as minimally necessary to compile and link; data must be converted to allowed types/containers for any further processing.
- Open question: Do people just ignore PRESUBMIT warnings for that then?
- Open question: Might there be things so unsafe we cannot even allow this level of usage?
On Fri, Jun 26, 2020 at 11:26 AM Peter Kasting <pkas...@chromium.org> wrote:Summary of where I believe things stand; please correct misimpressions/omissions:
- Agreement in principle to do this
- No unresolved objections; resolved in favor pending details below. Object now if you feel otherwise, as there's a separate thread on this list now requesting approval for a specific first-party use.
- A high-level idea of how to roll out
- General concurrence for starting with most/all things banned and allowing gradually.
- Long-term policy cannot be "default-allow" as absl adds new capabilities and there's insufficient versioning to say "absl17 is allowed" as we do with C++.
- Proposal: Use same policy as with C++ ("force decision by two years"), but applied to individual pieces of absl. As new functionality is rolled in, add it to our canonical list, default-banned, with date added; that's the start date for the two year timeframe. The start date for all existing functionality is whenever we create this list. Enforce all bans with PRESUBMIT. mbonadei@/danilchap@ to establish procedures for ensuring absl is rolled in a timely fashion, new functionality is added to the default-banned list, PRESUBMIT checks are added, and cxx@ is notified if necessary.
- No significant discussion on using chromium-cpp.appspot.com to hold the canonical list. I assume this is OK.
- Specific details
- Agreement that absl usage must not regress security checks, and we should have death tests for these. Bug on file, WIP.
- Some discussion of base:: and absl:: overlaps.
- Proposal: If base:: and absl:: functionality overlap, do not allow the absl functionality without a plan to migrate usage. The standard plan is to migrate the base:: functionality to match absl, type-alias to verify, allow absl usage, and remove the base:: type. Ideally this should not move us farther away from std:: compliance. //base OWNERS to establish procedures for determining and documenting overlaps.
- Insufficient discussion of usage at third-party code boundaries.
- Proposal: All banned functionality is allowed at third-party code boundaries, but only as minimally necessary to compile and link; data must be converted to allowed types/containers for any further processing.
- Open question: Do people just ignore PRESUBMIT warnings for that then?
I don't think we should ever ignore warnings. We should have an allowlist to files that do conversions out of third party.
- Open question: Might there be things so unsafe we cannot even allow this level of usage?
If they are then they are unsafe to bring into third_party as well, correct? I don't think we have any real intention to monitor absl usage inside third_party deps in that way, do we?
On Fri, Jun 26, 2020 at 9:51 AM <dan...@chromium.org> wrote:On Fri, Jun 26, 2020 at 11:26 AM Peter Kasting <pkas...@chromium.org> wrote:Summary of where I believe things stand; please correct misimpressions/omissions:
- Specific details
- Insufficient discussion of usage at third-party code boundaries.
- Proposal: All banned functionality is allowed at third-party code boundaries, but only as minimally necessary to compile and link; data must be converted to allowed types/containers for any further processing.
- Open question: Do people just ignore PRESUBMIT warnings for that then?
I don't think we should ever ignore warnings. We should have an allowlist to files that do conversions out of third party.So for example, in https://chromium-review.googlesource.com/c/chromium/src/+/2228543 ,count_down_latch*, scheduled_executor*, system_clock.cc depend on absl::Time/Duration/etc.crypto.cc depends on absl::string_viewWould this directory have a PRESUBMIT.py that basically allows these specific dependencies in these specific files? Would we instead record them somewhere in a metadata file a la DEPS? Would we just whitelist this directory?
PK
- Open question: Might there be things so unsafe we cannot even allow this level of usage?
I think absl::any (and probably std::any) needs to be banned also in third_party code because they don't work in component builds without RTTI. Should we go one step further with absl::any and ban it also from third_party?
On Fri, Jul 10, 2020 at 12:43 PM Mirko Bonadei <mbon...@chromium.org> wrote:
- Open question: Might there be things so unsafe we cannot even allow this level of usage?
I think absl::any (and probably std::any) needs to be banned also in third_party code because they don't work in component builds without RTTI. Should we go one step further with absl::any and ban it also from third_party?So it works in component builds if you enable RTTI? Is that because they try to use RTTI first and only fall back to (whatever the thing that doesn't work in component builds is) when that's unavailable?
I worry about whether there are other constructs that might quietly break without RTTI that we don't know about. Should we try to build third_party (non-Blink) code with RTTI enabled (maybe just for component builds)? Can we somehow compile-fail in places where someone is trying to do a fallback like this?
PK
Updated detailed proposal below.
- Agreement in principle: Resolved; first-party use of Abseil is directionally approved
- Roll-out idea:
- chromium-cpp.appspot.com will list the banned/allowed/TBD subsets of absl, as it does for C++ versions. [AI: Add a starting list, all banned-as-TBD, of everything currently in absl. Proposed owner: volunteers needed]
- third_party/abseil-cpp/ will be rolled weekly. Team that performs rolls will add any new functionality to the TBD list, with the current date, or appropriately notify cxx@ to do so. [Owners: mbonadei, danilchap]
- cxx@ will be the point of first contact for requesting bans/allowances for various items, and will involve other knowledgeable owners where relevant. Decisions will be by consensus, as with C++ standards features. [Owner: cxx]
- If an item is still TBD by two years after introduction, cxx@ will discuss it with the goal of explicitly banning or allowing it. In the absence of any significant reason to ban, the feature will be allowed. (Again, matches C++ standards features.) [Owner: pkasting]
- First-party code will only be allowed to use explicitly-allowed parts of absl. Enforcement will be via the root DEPS file, which will continue to contain the existing "-absl" rule, but will gain specific "+absl/..." allowances as approved. [Owner: cxx]
- Third-party code will be allowed to use anything in absl except explicitly-blocked pieces due to incompatibility with Chromium (e.g. absl::any). Enforcement will be via ensuring third_party/abseil_cpp/BUILD.gn does not have the blocked functionality in the absl target or its dependencies, so attempts to use this will not link. [AI: Remove absl/types:any from that file, audit remaining, fix relevant resulting bustage. Proposed owner: mbonadei]
- For FastTypeId specifically, we can carry a local patch that causes a compile failure in the broken case, as a backstop. [AI: Add this patch. Proposed owner: mbonadei]
- Interface code between first- and third-party will be allowed to use anything the third-party library uses, only as minimally necessary to convert to the subset of absl that first-party code can generally use. Enforcement will be via code review. (It would be nice to claim that such code would need to add explicit DEPS rules for all not-generally-allowed types, but due to both lacking IWYU enforcement and lacking "gn check" enforcement, it's possible for CLs to land without doing this -- as https://chromium-review.googlesource.com/c/chromium/src/+/2228543 did. When possible, though, it would be good to add a relevant DEPS file to list all necessary headers.) [Proposed owner: third_party/OWNERS?]
- Guidelines for banning/allowing items in absl:
- Items which overlap existing functionality will only be allowed in the context of a transition plan that ensures we do not carry multiple solutions indefinitely. By default, this plan is "make the existing functionality match the absl behavior; use a type alias to change the implementation to be based on absl; remove old implementation and convert the alias to direct usage of the absl type".
- Transitions to absl concepts must not cause regressions on safety/security checks, or introduce the risk of silently doing so in the future.
- For reimplementations of STL concepts, migrations to absl types with lower standards compliance than the existing Chromium solutions will generally not be considered. (It's the requester's responsibility to work with the absl team to bring absl up-to-par first.)
- Specific items mentioned so far:
- absl::any should be banned for first- and third-party code due to silent incorrect functionality in component builds. [Proposed owner: pkasting]
- absl::Span should be banned for first-party code due to being less std::-compliant than base::Span. [Proposed owner: pkasting]
- absl::string_view should be banned for first-party code due to only working with 8-bit characters. [Proposed owner: pkasting]
- absl::flat_hash_map/flat_hash_set should be discussed for allowing, including details/proposed guidance relative to existing containers. [Proposed owner: dcheng]
- absl::optional should be discussed for allowing, including transition plan details from base::Optional. [Proposed owner: //base/OWNERS volunteers needed]
- absl::variant should be discussed for allowing. [Proposed owner: pkasting]
Let me know if I overlooked or misstated anything. (If you read through and approve, I encourage explicitly saying so -- this is a large enough change that vocal affirmation is preferable to me over silent assent.)
Assuming we want to move forward, the immediate blocking items will be:
- Getting the full list of absl items together for chromium-cpp.appspot.com (maybe https://docs.ros.org/api/abseil_cpp/html/namespaceabsl.html helps here)
- Adding a FastTypeId compile break for component builds
- Maybe a quick sanity-check that the enforcement guardrails above work as we expect, and someone can't easily add non-compliant code, but compliant code works? [Proposed owner: volunteers needed]
- Announcement to chromium-dev@ [Proposed owner: pkasting]
PK
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFC4OXwSPnEdo0V7FpHU5qj8wALSQMtwMeYfby5BAY2kPQ%40mail.gmail.com.
Thanks a lot for driving this, Peter!
Assuming we want to move forward, the immediate blocking items will be:
- Getting the full list of absl items together for chromium-cpp.appspot.com (maybe https://docs.ros.org/api/abseil_cpp/html/namespaceabsl.html helps here)
Alternatively, would it make sense to have an allow-list and block-list for headers of the public interface? A simple find returns this, which is likely a bit more easy to manage than a list of every symbol in the absl namespace.
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFD7s8HVUng17Q6k9%2B%3D6HURJ6oHzmRokzxWX4cMU2HZ8Nw%40mail.gmail.com.
Updated detailed proposal below.
- Agreement in principle: Resolved; first-party use of Abseil is directionally approved
- Roll-out idea:
- chromium-cpp.appspot.com will list the banned/allowed/TBD subsets of absl, as it does for C++ versions. [AI: Add a starting list, all banned-as-TBD, of everything currently in absl. Proposed owner: volunteers needed]
Updated detailed proposal below.
- Agreement in principle: Resolved; first-party use of Abseil is directionally approved
- Roll-out idea:
- chromium-cpp.appspot.com will list the banned/allowed/TBD subsets of absl, as it does for C++ versions. [AI: Add a starting list, all banned-as-TBD, of everything currently in absl. Proposed owner: volunteers needed]
- third_party/abseil-cpp/ will be rolled weekly. Team that performs rolls will add any new functionality to the TBD list, with the current date, or appropriately notify cxx@ to do so. [Owners: mbonadei, danilchap]
- cxx@ will be the point of first contact for requesting bans/allowances for various items, and will involve other knowledgeable owners where relevant. Decisions will be by consensus, as with C++ standards features. [Owner: cxx]
- If an item is still TBD by two years after introduction, cxx@ will discuss it with the goal of explicitly banning or allowing it. In the absence of any significant reason to ban, the feature will be allowed. (Again, matches C++ standards features.) [Owner: pkasting]
- First-party code will only be allowed to use explicitly-allowed parts of absl. Enforcement will be via the root DEPS file, which will continue to contain the existing "-absl" rule, but will gain specific "+absl/..." allowances as approved. [Owner: cxx]
- Third-party code will be allowed to use anything in absl except explicitly-blocked pieces due to incompatibility with Chromium (e.g. absl::any). Enforcement will be via ensuring third_party/abseil_cpp/BUILD.gn does not have the blocked functionality in the absl target or its dependencies, so attempts to use this will not link. [AI: Remove absl/types:any from that file, audit remaining, fix relevant resulting bustage. Proposed owner: mbonadei]
- For FastTypeId specifically, we can carry a local patch that causes a compile failure in the broken case, as a backstop. [AI: Add this patch. Proposed owner: mbonadei]
- Interface code between first- and third-party will be allowed to use anything the third-party library uses, only as minimally necessary to convert to the subset of absl that first-party code can generally use. Enforcement will be via code review. (It would be nice to claim that such code would need to add explicit DEPS rules for all not-generally-allowed types, but due to both lacking IWYU enforcement and lacking "gn check" enforcement, it's possible for CLs to land without doing this -- as https://chromium-review.googlesource.com/c/chromium/src/+/2228543 did. When possible, though, it would be good to add a relevant DEPS file to list all necessary headers.) [Proposed owner: third_party/OWNERS?]
- Guidelines for banning/allowing items in absl:
- Items which overlap existing functionality will only be allowed in the context of a transition plan that ensures we do not carry multiple solutions indefinitely. By default, this plan is "make the existing functionality match the absl behavior; use a type alias to change the implementation to be based on absl; remove old implementation and convert the alias to direct usage of the absl type".
- Transitions to absl concepts must not cause regressions on safety/security checks, or introduce the risk of silently doing so in the future.
- For reimplementations of STL concepts, migrations to absl types with lower standards compliance than the existing Chromium solutions will generally not be considered. (It's the requester's responsibility to work with the absl team to bring absl up-to-par first.)
- Specific items mentioned so far:
- absl::any should be banned for first- and third-party code due to silent incorrect functionality in component builds. [Proposed owner: pkasting]
- absl::Span should be banned for first-party code due to being less std::-compliant than base::Span. [Proposed owner: pkasting]
- absl::string_view should be banned for first-party code due to only working with 8-bit characters. [Proposed owner: pkasting]
- absl::flat_hash_map/flat_hash_set should be discussed for allowing, including details/proposed guidance relative to existing containers. [Proposed owner: dcheng]
- absl::optional should be discussed for allowing, including transition plan details from base::Optional. [Proposed owner: //base/OWNERS volunteers needed]
- absl::variant should be discussed for allowing. [Proposed owner: pkasting]
Let me know if I overlooked or misstated anything. (If you read through and approve, I encourage explicitly saying so -- this is a large enough change that vocal affirmation is preferable to me over silent assent.)
Assuming we want to move forward, the immediate blocking items will be:
- Getting the full list of absl items together for chromium-cpp.appspot.com (maybe https://docs.ros.org/api/abseil_cpp/html/namespaceabsl.html helps here)
- Adding a FastTypeId compile break for component builds
- Maybe a quick sanity-check that the enforcement guardrails above work as we expect, and someone can't easily add non-compliant code, but compliant code works? [Proposed owner: volunteers needed]
Updated detailed proposal below.
- Roll-out idea:
- chromium-cpp.appspot.com will list the banned/allowed/TBD subsets of absl, as it does for C++ versions. [AI: Add a starting list, all banned-as-TBD, of everything currently in absl. Proposed owner: volunteers needed]
- For FastTypeId specifically, we can carry a local patch that causes a compile failure in the broken case, as a backstop. [AI: Add this patch. Proposed owner: mbonadei]
- It would be nice to claim that such code would need to add explicit DEPS rules for all not-generally-allowed types, but due to both lacking IWYU enforcement and lacking "gn check" enforcement, it's possible for CLs to land without doing this -- as https://chromium-review.googlesource.com/c/chromium/src/+/2228543 did.
- Maybe a quick sanity-check that the enforcement guardrails above work as we expect, and someone can't easily add non-compliant code, but compliant code works? [Proposed owner: volunteers needed]
On Wed, Jul 15, 2020 at 6:04 PM Peter Kasting <pkas...@chromium.org> wrote:Updated detailed proposal below.
- Roll-out idea:
- chromium-cpp.appspot.com will list the banned/allowed/TBD subsets of absl, as it does for C++ versions. [AI: Add a starting list, all banned-as-TBD, of everything currently in absl. Proposed owner: volunteers needed]
- Maybe a quick sanity-check that the enforcement guardrails above work as we expect, and someone can't easily add non-compliant code, but compliant code works? [Proposed owner: volunteers needed]
mbonadei@ is fallback here, but this could benefit from a volunteer. No particular special knowledge needed (in fact it's likely better that you know no more than the average Chrome engineer would).
Specific items mentioned so far:
- absl::optional should be discussed for allowing, including transition plan details from base::Optional. [Proposed owner: //base/OWNERS volunteers needed]
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFBCG6aWDak-7zfCss2wD4w-R-JKBfZjxrqAkFiEVG2Ecg%40mail.gmail.com.
On Thu, Jul 16, 2020 at 3:04 AM Peter Kasting <pkas...@chromium.org> wrote:Specific items mentioned so far:
- absl::optional should be discussed for allowing, including transition plan details from base::Optional. [Proposed owner: //base/OWNERS volunteers needed]
While I'm not technically a //base OWNER I wouldn't mind taking this on, unless folks have objections.
On Wed, Jun 17, 2020 at 3:30 PM Daniel Cheng <dch...@chromium.org> wrote:
On Tue, Jun 16, 2020 at 9:14 PM Chris Palmer <pal...@chromium.org> wrote:To me the key thing is that we not lose safety and correctness by preferring absl::foo to base::foo. We've put a lot of work into making base more resilient and secure — recently confirmed by Project Zero to have stopped some real attacks, by the way — and I *really* don't want for Chromium to regress.Toward that end, keep in mind that we always need to build Abseil with its hardening mode turned on in Chromium. That's a minimum requirement.In my dream world, we'd 'productize' as much of base as we could, re-designing it as we go and as/if necessary for ergonomic safety, and make it as easy as possible for any callers (inside or outside of Chromium) to call it. The world needs a safety-oriented C++ library that remains as efficient as possible, and base is low-key succeeding at that, IMO. AFAICT nobody else is attempting to do this, so there's an unmet need in the world.I'd like to second this point: for absl things we do start using in //base, I'd want to make sure we have some smoke tests to ensure that the appropriate CHECKs are enabled. To me, this is especially important because my understanding is absl transparently maps through to the standard library version if it's recent enough (e.g. support for optional, string_view, variant). I want to make sure we don't end up in a situation where we had security hardening and then lost it by upgrading a new C++ version.This is a good point. @palmer: Do we currently have death tests that verify our hardening of different things? If not, it seems like we should add them.Regarding mapping through, you can toggle between "force std/force absl/auto-select"; see https://abseil.io/blog/201901115-options#read-more . Thus I don't think this concern should gate, but I do think we need the tests so that we don't lose security absent-mindedly.Proposal: Treat this similarly to a new C++ version, in that we start with most things default-banned, allow on a by-request basis, and aim to default-allow within two years. Track in the Chromium style guide and chromium-cpp.appspot.com.How often does absl change/add new things? I'm a bit hesitant to say that we should just default-allow in two years, depending on how often new concepts/functionality is introduced. It seems to me the most value comes from the container types, especially for interop with other third-party libraries that are using absl at library boundaries.Looking at this more, I share your core concern. It's a big concerning new functionality upstream adds gains significant usage in Chromium before we've had a chance to review-in-principle. But since Abseil is less "versioned" than C++ itself, it's harder to guarantee that from both a linguistic perspective ("Abseil v3 is allowed" is not very meaningful) or a technical one (we can live on LTS branches instead of HEAD, but those are just basically cut-every-six-months).For a steady-state goal, we have several choices I can think of:
- "Laissez faire": Since Abseil is guided by principles and values closer to Chromium's than C++ is, assume that reactively disallowing problematic functionality as needed will be sufficient
- "Proactive consideration": We monitor what goes into Abseil, discuss new additions periodically, and rule on them reasonably quickly
- "Constant vigilance": Only explicitly allowed functionality may ever be used (enforced by e.g. PRESUBMIT); using more requires an explicit request
Personally I'm OK with either 1 or 2; I don't think 3 is warranted. If we do 2, we'll need to figure out who/what is responsible for said monitoring.Proposal: Allow absl::any and absl::variant to start with, as these polyfill C++17 types, have no base:: implementation, and have consumer interest . Allow other types and functions to begin with only as necessary to compile against third-party code using Abseil and convert to non-absl:: types. Create a list of overlaps between base:: and absl:: (e.g. base::Optional vs. absl::optional, base::StringPiece vs. absl::string_view, base::Time and related classes vs. absl::Time and related classes, etc.) and decide a plan for deduplication going forward. Bias towards std:: types, then absl:: types, then base:: types.I can't say that I personally care for any, but maybe I don't understand the use cases. I know there's a CL that wants to use absl::any, but it's hard to tell exactly what the intended usage is (since it's a support library for third-party code).In Chromium itself, usage would be rare, basically for type-erased stuff and "arbitrary property" sorts of cases (View class properties, WebContents user data, etc.). It's convenient but not critical for these and I'm not wedded to having it early or at all, but any objections we'd make to absl::any will also apply to std::any in C++17, so it's probably less about discussing whether to take absl's version as whether we think the feature is risky enough that we should permanently ban it.Finally, I'd like to add that span and absl's hash containers should probably be on this list: in particular, I'd really like to see absl's hash containers be the default recommendation (though we'll likely need to benchmark ARM).I didn't put ::span on the initial list since base::span exists and I didn't want to start off with a list that overlaps at all (since any overlapping thing should have a long-term plan about where we're converging to), but yes, with things like ::span and ::optional where base, absl, and std all aim to implement the identical API, I think there's a solid case for using first absl and then std, modulo security check support.
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAOuvq20_g7699iwhK4Y3V3JefeXuUzc7mH7B0duDEBd8oDqBGQ%40mail.gmail.com.