Skip to content

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

Merged
kou merged 2 commits into
apache:mainfrom
kou:cpp-template-export
Oct 16, 2024
Merged

kou merged 2 commits into
apache:mainfrom
kou:cpp-template-export

Conversation

@kou

@kou kou commented Oct 10, 2024 •

Copy link
Copy Markdown
Member

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.
@github-actions

Copy link
Copy Markdown

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

@pitrou

pitrou commented Oct 10, 2024 •

Copy link
Copy Markdown
Member

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

@pitrou

pitrou commented Oct 10, 2024

Copy link
Copy Markdown
Member

@github-actions crossbow submit win

@github-actions

Copy link
Copy Markdown

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

kou commented Oct 10, 2024

Copy link
Copy Markdown
Member Author

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

pitrou commented Oct 10, 2024

Copy link
Copy Markdown
Member

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

@kou

kou commented Oct 10, 2024

Copy link
Copy Markdown
Member Author

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

pitrou commented Oct 10, 2024

Copy link
Copy Markdown
Member

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

@kou

kou commented Oct 11, 2024

Copy link
Copy Markdown
Member Author

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
@kou
kou deleted the cpp-template-export branch October 16, 2024 06:00
@conbench-apache-arrow

Copy link
Copy Markdown

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