From bb91eec6ebe9981436730ebec890ae21bedc246d Mon Sep 17 00:00:00 2001 From: LN Liberda Date: Tue, 16 Dec 2025 20:39:00 +0100 Subject: [PATCH] Minor fixes for libstdc++ 15 (#178601) *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* This adds some includes and changes an API in an internal tool to use `std::string` instead of `std::string_view` for a path, fixing builds with libstdc++ 15 *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --- engine/src/flutter/display_list/dl_storage.h | 1 + engine/src/flutter/display_list/dl_text.h | 2 ++ engine/src/flutter/fml/synchronization/semaphore.h | 1 + engine/src/flutter/impeller/renderer/backend/gles/handle_gles.h | 1 + engine/src/flutter/impeller/typographer/font.h | 1 + .../common/client_wrapper/include/flutter/binary_messenger.h | 1 + engine/src/flutter/tools/licenses_cpp/src/filter.cc | 2 +- engine/src/flutter/tools/licenses_cpp/src/filter.h | 2 +- 8 files changed, 9 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/display_list/dl_storage.h b/engine/src/flutter/display_list/dl_storage.h index 879fae42340..acfa2de7754 100644 --- a/engine/src/flutter/display_list/dl_storage.h +++ b/engine/src/flutter/display_list/dl_storage.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_DISPLAY_LIST_DL_STORAGE_H_ #define FLUTTER_DISPLAY_LIST_DL_STORAGE_H_ +#include #include #include "flutter/fml/logging.h" diff --git a/engine/src/flutter/display_list/dl_text.h b/engine/src/flutter/display_list/dl_text.h index ae1dbabdd5e..ea9337ddd53 100644 --- a/engine/src/flutter/display_list/dl_text.h +++ b/engine/src/flutter/display_list/dl_text.h @@ -5,6 +5,8 @@ #ifndef FLUTTER_DISPLAY_LIST_DL_TEXT_H_ #define FLUTTER_DISPLAY_LIST_DL_TEXT_H_ +#include + #include "flutter/display_list/geometry/dl_geometry_types.h" namespace impeller { diff --git a/engine/src/flutter/fml/synchronization/semaphore.h b/engine/src/flutter/fml/synchronization/semaphore.h index 0bb17602867..6e33cbd28c0 100644 --- a/engine/src/flutter/fml/synchronization/semaphore.h +++ b/engine/src/flutter/fml/synchronization/semaphore.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_FML_SYNCHRONIZATION_SEMAPHORE_H_ #define FLUTTER_FML_SYNCHRONIZATION_SEMAPHORE_H_ +#include #include #include "flutter/fml/macros.h" diff --git a/engine/src/flutter/impeller/renderer/backend/gles/handle_gles.h b/engine/src/flutter/impeller/renderer/backend/gles/handle_gles.h index e6f51d2caae..a6234ebc147 100644 --- a/engine/src/flutter/impeller/renderer/backend/gles/handle_gles.h +++ b/engine/src/flutter/impeller/renderer/backend/gles/handle_gles.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_HANDLE_GLES_H_ #define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_HANDLE_GLES_H_ +#include #include #include #include diff --git a/engine/src/flutter/impeller/typographer/font.h b/engine/src/flutter/impeller/typographer/font.h index a48f8822dc2..b671a3bb269 100644 --- a/engine/src/flutter/impeller/typographer/font.h +++ b/engine/src/flutter/impeller/typographer/font.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_IMPELLER_TYPOGRAPHER_FONT_H_ #define FLUTTER_IMPELLER_TYPOGRAPHER_FONT_H_ +#include #include #include "fml/hash_combine.h" diff --git a/engine/src/flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h b/engine/src/flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h index d552b499ee2..553ba0bba49 100644 --- a/engine/src/flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h +++ b/engine/src/flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_SHELL_PLATFORM_COMMON_CLIENT_WRAPPER_INCLUDE_FLUTTER_BINARY_MESSENGER_H_ #define FLUTTER_SHELL_PLATFORM_COMMON_CLIENT_WRAPPER_INCLUDE_FLUTTER_BINARY_MESSENGER_H_ +#include #include #include diff --git a/engine/src/flutter/tools/licenses_cpp/src/filter.cc b/engine/src/flutter/tools/licenses_cpp/src/filter.cc index b4626f0ed1e..b81999fd089 100644 --- a/engine/src/flutter/tools/licenses_cpp/src/filter.cc +++ b/engine/src/flutter/tools/licenses_cpp/src/filter.cc @@ -6,7 +6,7 @@ #include #include "third_party/abseil-cpp/absl/strings/str_cat.h" -absl::StatusOr Filter::Open(std::string_view path) { +absl::StatusOr Filter::Open(const std::string& path) { std::ifstream input; input.open(path); absl::StatusOr result = Open(input); diff --git a/engine/src/flutter/tools/licenses_cpp/src/filter.h b/engine/src/flutter/tools/licenses_cpp/src/filter.h index a213b258612..4e35169f780 100644 --- a/engine/src/flutter/tools/licenses_cpp/src/filter.h +++ b/engine/src/flutter/tools/licenses_cpp/src/filter.h @@ -16,7 +16,7 @@ /// This is used for things like the include.txt and exclude.txt. class Filter { public: - static absl::StatusOr Open(std::string_view path); + static absl::StatusOr Open(const std::string& path); static absl::StatusOr Open(std::istream& input);