-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opt into unstable libcxx ABI and add a custom namespace. #49002
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@text-exemption-reviewers" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Noticed this while answering this thread and seeing |
This should also make the output of I don't know how we decided the default __config_site was fine but git blame says I checked it in. So 🤷🏽 |
FWIW, the optimizations this opts into are here. Though, the primary reason for the change is the namespacing and avoiding collisions. I don't expect this to move the needle on benchmarks. |
Are the ASAN and test failures related, or does this need a rebase past a bad commit? Is there any way to test this? Is there some way to make the build fail if these changes are accidentally backed out? |
We use a statically linked libcxx and don't expose any of the internal symbols. This theoretically allows us to namespace everything to avoid accidentally using the wrong version libcxx. Also, not having to worry about ABI stability allows libcxx to opt into optimized routines. But, since libcxx uses CMake and we don't, the mechanism to generate the __config_site file doesn't exist in GN. Instead, we check in a file that would have been generated for us by CMake. The file we check in though is a default with additional configuration. This version of the file makes it so that we opt into the unstable ABI (and get optimizations) and also namespace everything for Flutter so collisions are immediately flagged.
f4b43b5
to
dcc919a
Compare
The Creating a GObject apparently initializes the object with zeros and does not run the C++ constructors for the class members. It looks like the old implementation of libcxx As a hack workaround I was able to get these tests to run by using placement new to force construction of the |
/cc @robert-ancell for GTK-side expertise. Any advice on recommended approaches here? Does what @jason-simmons is proposing sound reasonable? |
From what @jason-simmons said, it seems like we were depending undefined behavior in the ABI instead mixing libcxxs (which is what I was primarily concerned about). There are number optimizations that are enabled by when the ABI can be unstable. But we can check this by setting |
Trying a canary run with version set to 1. |
That did it. @jason-simmons If you had to manually perform a placement new, that also means that the delete was not happening right? So we are leaking std::function guts because the destructors are not being called? We got away with the ctors not being called earlier because presumably the zero initialization was a find ctor. |
The change to ABI version 1 LGTM Filed flutter/flutter#140183 |
If the Linux tests still have issues I think we should just change the use of |
…140350) flutter/engine@92d88c7...632103f 2023-12-18 matej.knopp@gmail.com Convert chromium wheel delta to physical pixels on macOS (flutter/engine#49028) 2023-12-18 skia-flutter-autoroll@skia.org Roll Skia from 3de801338767 to 63bed826008e (1 revision) (flutter/engine#49200) 2023-12-18 skia-flutter-autoroll@skia.org Roll Dart SDK from ff7e92c7886d to b21443096387 (1 revision) (flutter/engine#49199) 2023-12-18 skia-flutter-autoroll@skia.org Roll Skia from 83f8fe8bbcee to 3de801338767 (2 revisions) (flutter/engine#49195) 2023-12-18 skia-flutter-autoroll@skia.org Roll Skia from 10e7ee119ea9 to 83f8fe8bbcee (1 revision) (flutter/engine#49193) 2023-12-18 barpac02@gmail.com Delete `SemanticsUpdateBuilderNew` and all references and usages (flutter/engine#49139) 2023-12-18 chinmaygarde@google.com Opt into unstable libcxx ABI and add a custom namespace. (flutter/engine#49002) 2023-12-18 skia-flutter-autoroll@skia.org Roll Skia from 4b2639427e7e to 10e7ee119ea9 (10 revisions) (flutter/engine#49191) 2023-12-18 skia-flutter-autoroll@skia.org Roll Dart SDK from e1a26302800d to ff7e92c7886d (1 revision) (flutter/engine#49185) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC jsimmons@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#140350) flutter/engine@92d88c7...632103f 2023-12-18 matej.knopp@gmail.com Convert chromium wheel delta to physical pixels on macOS (flutter/engine#49028) 2023-12-18 skia-flutter-autoroll@skia.org Roll Skia from 3de801338767 to 63bed826008e (1 revision) (flutter/engine#49200) 2023-12-18 skia-flutter-autoroll@skia.org Roll Dart SDK from ff7e92c7886d to b21443096387 (1 revision) (flutter/engine#49199) 2023-12-18 skia-flutter-autoroll@skia.org Roll Skia from 83f8fe8bbcee to 3de801338767 (2 revisions) (flutter/engine#49195) 2023-12-18 skia-flutter-autoroll@skia.org Roll Skia from 10e7ee119ea9 to 83f8fe8bbcee (1 revision) (flutter/engine#49193) 2023-12-18 barpac02@gmail.com Delete `SemanticsUpdateBuilderNew` and all references and usages (flutter/engine#49139) 2023-12-18 chinmaygarde@google.com Opt into unstable libcxx ABI and add a custom namespace. (flutter/engine#49002) 2023-12-18 skia-flutter-autoroll@skia.org Roll Skia from 4b2639427e7e to 10e7ee119ea9 (10 revisions) (flutter/engine#49191) 2023-12-18 skia-flutter-autoroll@skia.org Roll Dart SDK from e1a26302800d to ff7e92c7886d (1 revision) (flutter/engine#49185) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC jsimmons@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
We use a statically linked libcxx and don't expose any of the internal symbols. This theoretically allows us to namespace everything to avoid accidentally using the wrong version libcxx. Also, not having to worry about ABI stability allows libcxx to opt into optimized routines.
But, since libcxx uses CMake and we don't, the mechanism to generate the __config_site file doesn't exist in GN. Instead, we check in a file that would have been generated for us by CMake. The file we check in though is a default with additional configuration. This version of the file makes it so that we opt into the unstable ABI (and get optimizations) and also namespace everything for Flutter so collisions are immediately flagged.