Skip to content
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

MINOR: [C++] Include <string> before using std::string #42004

Merged
merged 1 commit into from
Jun 7, 2024
Merged

MINOR: [C++] Include <string> before using std::string #42004

merged 1 commit into from
Jun 7, 2024

Conversation

StephanTLavavej
Copy link
Contributor

Rationale for this change

I work on MSVC's STL, and we regularly build popular open-source projects, including yours, with development builds of the MSVC toolset. This allows us to find and fix toolset regressions before they affect users, and also allows us to provide advance notice of breaking changes, which is the case here.

We recently merged microsoft/STL#4633 which will ship in VS 2022 17.11 Preview 3. This improved build throughput by refactoring <string_view> so that it no longer drags in std::string. It's also a source-breaking change for code that wasn't properly including <string>. Your cpp/src/arrow/json/object_writer.h declares std::string Serialize(); without including <string>. When built with our updated STL, this will emit a compiler error:

C:\gitP\apache\arrow\cpp\src\arrow/json/object_writer.h(39): error C2039: 'string': is not a member of 'std'

What changes are included in this PR?

The fix is simple and portable: include the necessary header.

Are these changes tested?

Nope, I'm totally YOLOing it. If it builds, it's good.

(This will be tested in MSVC's internal "Real World Code" test infrastructure. Also, after VS 2022 17.11 ships, your existing build/test coverage will ensure that this keeps compiling.)

Are there any user-facing changes?

No.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kou kou merged commit a708fab into apache:main Jun 7, 2024
38 of 39 checks passed
@kou kou removed the awaiting review Awaiting review label Jun 7, 2024
@github-actions github-actions bot added the awaiting merge Awaiting merge label Jun 7, 2024
@StephanTLavavej StephanTLavavej deleted the include-string branch June 7, 2024 04:33
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit a708fab.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 10 possible false positives for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants