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

GH-44364: [C++] Don't export template class #44365

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Conversation

kou
Copy link
Member

@kou kou commented Oct 10, 2024

Rationale for this change

It works with MSVC but doesn't work with clang-cl.

What changes are included in this PR?

Remove ARROW_EXPORT from template classes.

Are these changes tested?

Yes but with only MSVC. We don't have clang-cl CI jobs.

Are there any user-facing changes?

Yes.

It works with MSVC but doesn't work with clang-cl.
Copy link

⚠️ GitHub issue #44364 has been automatically assigned in GitHub to PR creator.

@pitrou
Copy link
Member

pitrou commented Oct 10, 2024

I think these were exported precisely because of MSVC at some point, so I'm surprised this isn't needed anymore.

@pitrou
Copy link
Member

pitrou commented Oct 10, 2024

@github-actions crossbow submit win

Copy link

Revision: a365cbf

Submitted crossbow builds: ursacomputing/crossbow @ actions-5eb8803ff8

Task Status
conda-win-x64-cpu-py3 Azure
conda-win-x64-cuda-py3 Azure
test-build-vcpkg-win GitHub Actions
verify-rc-binaries-wheels-windows GitHub Actions
verify-rc-source-windows GitHub Actions
wheel-windows-cp310-amd64 GitHub Actions
wheel-windows-cp311-amd64 GitHub Actions
wheel-windows-cp312-amd64 GitHub Actions
wheel-windows-cp313-amd64 GitHub Actions
wheel-windows-cp39-amd64 GitHub Actions

@kou
Copy link
Member Author

kou commented Oct 10, 2024

I'm not sure when we need ARROW_EXPORT...
For example, a365cbf is needed... Here is the error message without it:

https://github.com/apache/arrow/actions/runs/11268303462/job/31334825247#step:9:1229

D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(178): error C2220: the following warning is treated as an error
D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(178): warning C4661: 'int32_t arrow::SmallBasicDecimal<int32_t>::CountLeadingBinaryZeros(void) const': no suitable definition provided for explicit template instantiation request
D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(244): note: see declaration of 'arrow::SmallBasicDecimal<int32_t>::CountLeadingBinaryZeros'
D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(178): warning C4661: 'int32_t arrow::SmallBasicDecimal<int64_t>::CountLeadingBinaryZeros(void) const': no suitable definition provided for explicit template instantiation request
D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(244): note: see declaration of 'arrow::SmallBasicDecimal<int64_t>::CountLeadingBinaryZeros'
D:\a\arrow\arrow\build\cpp\src\arrow\CMakeFiles\arrow_io_shared.dir\Unity\unity_0_cxx.cxx(27): warning C4661: 'int32_t arrow::SmallBasicDecimal<int32_t>::CountLeadingBinaryZeros(void) const': no suitable definition provided for explicit template instantiation request
D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(244): note: see declaration of 'arrow::SmallBasicDecimal<int32_t>::CountLeadingBinaryZeros'
D:\a\arrow\arrow\build\cpp\src\arrow\CMakeFiles\arrow_io_shared.dir\Unity\unity_0_cxx.cxx(27): warning C4661: 'int32_t arrow::SmallBasicDecimal<int64_t>::CountLeadingBinaryZeros(void) const': no suitable definition provided for explicit template instantiation request
D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(244): note: see declaration of 'arrow::SmallBasicDecimal<int64_t>::CountLeadingBinaryZeros'
D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(192): warning C4661: 'int32_t arrow::SmallBasicDecimal<int32_t>::CountLeadingBinaryZeros(void) const': no suitable definition provided for explicit template instantiation request
D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(244): note: see declaration of 'arrow::SmallBasicDecimal<int32_t>::CountLeadingBinaryZeros'
D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(192): warning C4661: 'int32_t arrow::SmallBasicDecimal<int64_t>::CountLeadingBinaryZeros(void) const': no suitable definition provided for explicit template instantiation request
D:\a\arrow\arrow\cpp\src\arrow/util/basic_decimal.h(244): note: see declaration of 'arrow::SmallBasicDecimal<int64_t>::CountLeadingBinaryZeros'
[184/608] Building CXX object src\arrow\CMakeFiles\arrow_array_shared.dir\Unity\unity_2_cxx.cxx.obj

@pitrou
Copy link
Member

pitrou commented Oct 10, 2024

Do we have CI with clang-cl? Or did you test this PR yourself with it?

@kou
Copy link
Member Author

kou commented Oct 10, 2024

Do we have CI with clang-cl?

No. But we may be able to add it because it seems that we can use it on GitHub Actions: actions/runner-images#10018

Or did you test this PR yourself with it?

@zhanweiw tested: #44310 (comment)

But this PR has more ARROW_EXPORT removes.

@pitrou
Copy link
Member

pitrou commented Oct 10, 2024

Well, according to #44310 (comment), only the TimeScalar change is needed anyway. So this PR should be good.

@kou
Copy link
Member Author

kou commented Oct 11, 2024

clang-cl CI: #44378

I'll merge this in a few days (for 19.0.0 not 18.0.0) if nobody objects this.

@kou kou merged commit d661607 into apache:main Oct 16, 2024
39 checks passed
@kou kou deleted the cpp-template-export branch October 16, 2024 06:00
@kou kou removed the awaiting committer review Awaiting committer review label Oct 16, 2024
Copy link

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

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

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