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

[C++] Fix errors from VS 2019 in cpp/src/parquet/types.h #28392

Closed
asfimport opened this issue May 3, 2021 · 7 comments
Closed

[C++] Fix errors from VS 2019 in cpp/src/parquet/types.h #28392

asfimport opened this issue May 3, 2021 · 7 comments
Assignees
Milestone

Comments

@asfimport
Copy link
Collaborator

On April 30, a nightly CI job that builds libarrow with Visual Studio 2019 (test-build-vcpkg-win) started failing because of numerous syntax errors:

D:\a\crossbow\crossbow\arrow\cpp\src\parquet/types.h(115,38): error C2143: syntax error: missing '}' before '=' [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\dataset\arrow_dataset_shared.vcxproj]
4423D:\a\crossbow\crossbow\arrow\cpp\src\parquet/types.h(115,38): error C2059: syntax error: '=' [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\dataset\arrow_dataset_shared.vcxproj]
4424D:\a\crossbow\crossbow\arrow\cpp\src\parquet/types.h(115,87): error C2143: syntax error: missing ';' before '}' [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\dataset\arrow_dataset_shared.vcxproj]
4425D:\a\crossbow\crossbow\arrow\cpp\src\parquet/types.h(115,87): error C2238: unexpected token(s) preceding ';' [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\dataset\arrow_dataset_shared.vcxproj]
4426D:\a\crossbow\crossbow\arrow\cpp\src\parquet/types.h(173,22): error C2039: 'schema': is not a member of 'parquet' [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\dataset\arrow_dataset_shared.vcxproj]
4427D:\a\crossbow\crossbow\arrow\cpp\src\parquet/types.h(40): message : see declaration of 'parquet' [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\dataset\arrow_dataset_shared.vcxproj]
4428D:\a\crossbow\crossbow\arrow\cpp\src\parquet/types.h(173,22): error C3083: 'schema': the symbol to the left of a '::' must be a type [D:\a\crossbow\crossbow\arrow\cpp\build\src\arrow\dataset\arrow_dataset_shared.vcxproj]
4429D:\a\crossbow\crossbow\arrow\cpp\src\parquet/types.h(173,30): error C2039: 'DecimalMetadata': is not a member of 'parquet' 

See full log at https://github.com/ursacomputing/crossbow/runs/2473230854#step:4:4422

@bkietz [~davidli]  I am almost certain that this was caused by ARROW-11929

PR: #10166

Commit: 7430bbd

When I check out the commit immediately before this one, the build succeeds without these errors. When I check out this commit, the build shows these errors.

I believe the issue is not directly related to vcpkg. It happens also when I use conda for dependencies. It seems to be related to Visual Studio 2019.

Reporter: Ian Cook / @ianmcook
Assignee: Ian Cook / @ianmcook

PRs and other links:

Note: This issue was originally created as ARROW-12640. Please see the migration documentation for further details.

@asfimport
Copy link
Collaborator Author

Antoine Pitrou / @pitrou:
Can you try adding the following lines somewhere in src/parquet/types.h:

#ifdef OPTIONAL
#undef OPTIONAL
#endif

@asfimport
Copy link
Collaborator Author

David Li / @lidavidm:
I can confirm Antoine's suggestion fixes the error in a local build.

@asfimport
Copy link
Collaborator Author

Ian Cook / @ianmcook:
@pitrou  that solved it; thank you.

Does it matter where in the file I add this? Should it be at the top?

@asfimport
Copy link
Collaborator Author

Ian Cook / @ianmcook:
Oh, I see—I'll add this to the top of  src/parquet/types.h just below #pragma once:

#include "parquet/windows_compatibility.h" 

@asfimport
Copy link
Collaborator Author

Antoine Pitrou / @pitrou:
Please don't. This will indirectly include windows.h. We don't want to do this in header files.

@asfimport
Copy link
Collaborator Author

Ian Cook / @ianmcook:
Ah, ok. Then I'll just add this below the includes:

#ifdef _WIN32

// parquet.thrift's OPTIONAL RepetitionType conflicts with a #define from
// above, so we undefine it
#ifdef OPTIONAL
#undef OPTIONAL
#endif

#endif 

@asfimport
Copy link
Collaborator Author

Ian Cook / @ianmcook:
Issue resolved by pull request 10234
#10234

@asfimport asfimport added this to the 5.0.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants