-
Notifications
You must be signed in to change notification settings - Fork 6k
[Windows] Reduce Visual Studio build errors caused by keyboard unit tests #49814
Conversation
|
||
#define EXPECT_CALL_IS_EVENT(_key_call, ...) \ | ||
EXPECT_EQ(_key_call.type, KeyCall::kKeyCallOnKey); \ | ||
EXPECT_EVENT_EQUALS(_key_call.key_event, __VA_ARGS__); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSVC (Visual Studio's C++ compiler) doesn't expand __VA_ARGS__
well. Instead of "expanding" the __VA_ARGS
into multiple arguments, it places them all into a single argument. This causes EXPECT_EVENT_EQUALS
to have unexpected commas while in Visual Studio.
.physical = _physical, \ | ||
.logical = _logical, \ | ||
.character = _character, \ | ||
.synthesized = _synthesized, \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This avoids C++20 designated initializers as Visual Studio reports these as build errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awful since I've been using it all over the place in engine...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're building the engine/embedder with clang, so I'd have thought this shouldn't be an issue. This definitely used to be an issue when building with MSVC though, so we can't use it for example in the runner.
Has something regressed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has something regressed?
No, this isn't a regression. Building inside of Visual Studio still works, however, the Visual Studio editor reports errors.
I would say it's fine to keep using designated initializers in C++ code. This particular macro is a bit of an exception as it's used pervasively in keyboard_unittests
, resulting in massive amounts of errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summarizing our Discord conversation: Visual Studio's Intellisense appears to use MSVC. Building within Visual Studio still worked as expected, this change only improves the editor experience. |
…141744) flutter/engine@73a2de5...98c16b4 2024-01-18 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Manual roll Dart SDK from d6c08fa9bb54 to 6ff69d6b7f59 (15 revisions)" (flutter/engine#49852) 2024-01-18 [email protected] Roll Skia from 5abf9717ea92 to 31f275e8fcc7 (8 revisions) (flutter/engine#49850) 2024-01-18 [email protected] Reland: [Impeller] Turned on new blur. (#48472) (flutter/engine#49642) 2024-01-17 [email protected] [Windows] Reduce Visual Studio build errors caused by keyboard unit tests (flutter/engine#49814) 2024-01-17 [email protected] [Impeller] disabled misleading vulkan golden image tests (flutter/engine#49836) 2024-01-17 [email protected] [Windows] Remove unnecessary statics in keyboard (flutter/engine#49834) 2024-01-17 [email protected] Roll Skia from 5c9e3474cf13 to 5abf9717ea92 (1 revision) (flutter/engine#49831) 2024-01-17 [email protected] Move mac cache builder to bringup. (flutter/engine#49843) 2024-01-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] Switch from transient stencil-only to depth+stencil buffer." (flutter/engine#49832) 2024-01-17 [email protected] Roll Skia from d8da1ee69767 to 5c9e3474cf13 (2 revisions) (flutter/engine#49827) 2024-01-17 [email protected] Manual roll Dart SDK from d6c08fa9bb54 to 6ff69d6b7f59 (15 revisions) (flutter/engine#49825) 2024-01-17 [email protected] Roll Skia from 02e94b3b4d29 to d8da1ee69767 (1 revision) (flutter/engine#49824) 2024-01-17 [email protected] Flutter GPU: Add GpuContext.createHostBuffer (flutter/engine#49822) 2024-01-17 [email protected] Roll Fuchsia Linux SDK from Klxww53tA4-TG5pA9... to GuU0e5WxJCi92Scz8... (flutter/engine#49823) 2024-01-17 [email protected] [Impeller] Switch from transient stencil-only to depth+stencil buffer. (flutter/engine#47987) 2024-01-17 [email protected] Roll Skia from 31309ff09537 to 02e94b3b4d29 (43 revisions) (flutter/engine#49819) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from Klxww53tA4-T to GuU0e5WxJCi9 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 [email protected],[email protected],[email protected] 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
The
EXPECT_CALL_IS_EVENT
macro used features that are not supported by Visual Studio 2022's intellisense, which results in >130 errors when editing in Visual Studio. These issues only affect the editing experience, building still works as expected.This change reduces false errors in Visual Studio by making
EXPECT_CALL_IS_EVENT
buildable in Visual Studio.Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.