-
-
Notifications
You must be signed in to change notification settings - Fork 766
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
ICU-22261 Refactor MF2 attributes and options parsing code #2940
ICU-22261 Refactor MF2 attributes and options parsing code #2940
Conversation
Assuming this is still for ICU 75, it needs to now target the https://github.com/unicode-org/icu/tree/maint/maint-75 branch rather than "main". |
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.
LGTM. Thanks!
The CI failures are jobs that timed out. Not sure if there's a way to re-run them. |
I clicked rerun on the failed CI checks on this PR yesterday when I noticed it. If you click the "details" link, there (hopefully) is a dropdown button in the upper right that lets you rerun jobs (all jobs & just failing jobs). Once you click the button to get the failing jobs to rerun, the button won't be visible until there's another occurrence of a failed (finished) job. If you don't see or have the ability to click the rerun jobs button, just ping me and I'll be happy to poke this thing until it passes. |
After discussing with Elango, I added 2497b11 to increase the timeouts for the two MSVC debug jobs that are timing out. |
Hmm, I'm not sure why the MSVC debug jobs were being reported as timeouts, because when I looked at the logs just now, there are actually test failures. I'll look at that tomorrow. |
Based on the log output, it looks like the failed runtime assertion caused the system to give an interactive prompt:
At least we can revert |
The last few commits should fix the build failures on MSVC. If anyone is curious:
I suspect that the other compilers were doing copy elision here, and MSVC wasn't. It would be a bug to call the implicit copy constructor for |
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.
LGTM. All checks are passing now. Good work in debugging and diagnosing.
@markusicu @roubert FYI on Tim's comment above, where a failing debug assert theoretically should have caused failures on all compiler builds across the board, but only seemed to cause a failure with MSVC. Is there a way to explain this? |
I can't find any unit test in which |
The test that fails is https://github.com/unicode-org/icu/blob/main/icu4c/source/test/intltest/messageformat2test.cpp#L411 . There are no unit tests specifically for I can do some more work to narrow this down before you put any more time into it. |
I've convinced myself that I understand why the assertion only failed on Windows; it was for the same reason as the second bug (unintentionally using a default copy constructor). I've also convinced myself that the correct fix is actually not to change the assertion, but rather, to change Meanwhile, I'll squash this so it can be merged. |
Previously, there were separate overrides for the options and attributes parsing methods in the parser that were used in different context. (Options can appear in Operator and Markup, while attributes can appear in Expression and Markup.) This is a refactoring that eliminates this duplicated code. To enable it, a builder is added for the internal OptionMap type. Separately, this patch also explicitly deletes copy constructors and copy assignment operators for all Builder classes; a bug in an earlier version of this patch caused me to notice this hadn't been done. Also explicitly deletes move constructors/assignment operators with the exception of OptionMap::Builder (OptionMap is non-public, so that shouldn't cause confusion).
c35ab92
to
b215909
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
Previously, there were separate overrides for the options and attributes parsing methods in the parser that were used in different context. (Options can appear in Operator and Markup, while attributes can appear in Expression and Markup.)
This is a refactoring that eliminates this duplicated code. To enable it, a builder is added for the internal OptionMap type.
This doesn't change any public APIs, but is also not an urgent change.
Checklist