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-40855: [C++][ORC] Fix std::filesystem related link error with ORC 2.0.0 or later #41023

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

kou
Copy link
Member

@kou kou commented Apr 5, 2024

Rationale for this change

If we use std::filesystem, we need -lstdc++fs with GCC 8 and -lc++fs for clang 7. We don't want to maintain CMake code for GCC 8/clang 7.

What changes are included in this PR?

  • Don't use std::filesystem with ORC 2.0.0 or later.
  • Use missing -lstdc++fs/-lc++fs with bundled ORC 2.0.0.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@kou kou requested a review from wgtmac as a code owner April 5, 2024 08:58
@kou
Copy link
Member Author

kou commented Apr 5, 2024

@github-actions crossbow submit almalinux-8-amd64

@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Apr 5, 2024
Copy link

github-actions bot commented Apr 5, 2024

Revision: 7e2e612

Submitted crossbow builds: ursacomputing/crossbow @ actions-0fade13009

Task Status
almalinux-8-amd64 GitHub Actions

@kou
Copy link
Member Author

kou commented Apr 5, 2024

My guess was wrong...
ORC 2.0.0 or later uses std::filesystem. So we need to specify -lstdc++fs or -lc++fs to use liborc.a.

@@ -29,6 +29,7 @@ endif()
find_package(orc ${find_package_args})
if(orc_FOUND)
set(orcAlt_FOUND TRUE)
set(orcAlt_VERSION ${orc_VERSION})
Copy link
Member

Choose a reason for hiding this comment

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

Does this work with conan?

Copy link
Member Author

Choose a reason for hiding this comment

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

I hope so...
Do you know conan's ORC recipe provide valid(?) CMake package for ORC?

(BTW, is there a plan that ORC provides its CMake package?)

Copy link
Member

Choose a reason for hiding this comment

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

Do you know conan's ORC recipe provide valid(?) CMake package for ORC?

I suppose it does. It was added by me: https://github.com/conan-io/conan-center-index/blob/master/recipes/orc/all/conanfile.py#L145

is there a plan that ORC provides its CMake package?

I'm not sure if I understand the question correctly, do you mean the ORC community provides an official FindOrc.cmake file or something similar?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.
(orcConfig.cmake will be better than FindOrc.cmake.)

FYI: Apache Arrow provides ArrowConfig.cmake, ArrowFlightConfig.cmake, ParquetConfig.cmake and so on.

Copy link
Member

Choose a reason for hiding this comment

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

OK, let me investigate how does it work and add it to ORC.

@wgtmac
Copy link
Member

wgtmac commented Apr 5, 2024

My guess was wrong... ORC 2.0.0 or later uses std::filesystem. So we need to specify -lstdc++fs or -lc++fs to use liborc.a.

Is any other module doing the same thing, or ORC is the only one that requires std::filesystem?

…r later

If we use `std::filesystem`, we need `-lstdc++fs` with GCC 8 and
`-lc++fs` for clang 7. We don't want to maintain CMake code for GCC
8/clang 7. So this avoids using `std::filesystem` with ORC 2.0.0 or
later.
@kou
Copy link
Member Author

kou commented Apr 5, 2024

@github-actions crossbow submit almalinux-8-amd64

Copy link

github-actions bot commented Apr 5, 2024

Revision: 9987fb6

Submitted crossbow builds: ursacomputing/crossbow @ actions-297049266f

Task Status
almalinux-8-amd64 GitHub Actions

@kou
Copy link
Member Author

kou commented Apr 5, 2024

Is any other module doing the same thing, or ORC is the only one that requires std::filesystem?

The latter.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Apr 5, 2024
@wgtmac
Copy link
Member

wgtmac commented Apr 5, 2024

Is any other module doing the same thing, or ORC is the only one that requires std::filesystem?

The latter.

I can fix that on the ORC side by removing std::filesystem dependency in 2.0.1 if you think appropriate and revert ORC 2.0.0 to 1.9.3.

@kou
Copy link
Member Author

kou commented Apr 5, 2024

I can fix that on the ORC side by removing std::filesystem dependency in 2.0.1 if you think appropriate and revert ORC 2.0.0 to 1.9.3.

It'll be helpful. Could you do it? But we don't need to revert bundled ORC to 1.9.3. Time zone DB path check in ORC 2.0.0 will be useful. And this PR will fix this std::filesystem problem.

@wgtmac
Copy link
Member

wgtmac commented Apr 5, 2024

I can fix that on the ORC side by removing std::filesystem dependency in 2.0.1 if you think appropriate and revert ORC 2.0.0 to 1.9.3.

It'll be helpful. Could you do it? But we don't need to revert bundled ORC to 1.9.3. Time zone DB path check in ORC 2.0.0 will be useful. And this PR will fix this std::filesystem problem.

OK, I will remove std::filesystem dependency but keep the TZDB check on the ORC side.

@kou
Copy link
Member Author

kou commented Apr 5, 2024

Thanks!

@kou
Copy link
Member Author

kou commented Apr 5, 2024

@github-actions crossbow submit -g cpp

Copy link

github-actions bot commented Apr 5, 2024

Revision: 9987fb6

Submitted crossbow builds: ursacomputing/crossbow @ actions-45d2d9e22b

Task Status
test-alpine-linux-cpp GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind Azure
test-cuda-cpp GitHub Actions
test-debian-12-cpp-amd64 GitHub Actions
test-debian-12-cpp-i386 GitHub Actions
test-fedora-39-cpp GitHub Actions
test-ubuntu-20.04-cpp GitHub Actions
test-ubuntu-20.04-cpp-bundled GitHub Actions
test-ubuntu-20.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-20.04-cpp-thread-sanitizer GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions

@kou kou changed the title GH-40855: [C++][ORC] Don't use std::filesystem with ORC 2.0.0 or later GH-40855: [C++][ORC] Fix std:;filesystem related link error ith ORC 2.0.0 or later Apr 5, 2024
@kou kou changed the title GH-40855: [C++][ORC] Fix std:;filesystem related link error ith ORC 2.0.0 or later GH-40855: [C++][ORC] Fix std::filesystem related link error with ORC 2.0.0 or later Apr 5, 2024
Copy link

github-actions bot commented Apr 5, 2024

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

@kou kou merged commit df7da77 into apache:main Apr 5, 2024
41 of 43 checks passed
@kou kou deleted the cpp-orc-filesystem branch April 5, 2024 23:13
@kou kou removed the awaiting changes Awaiting changes label Apr 5, 2024
Copy link

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

There were no benchmark performance regressions. 🎉

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

dongjoon-hyun pushed a commit to apache/orc that referenced this pull request Apr 10, 2024
### What changes were proposed in this pull request?
Remove std::filesystem and use OS API instead.

### Why are the changes needed?
Apache Arrow C++ library is required to support old compilers like clang8. Since Apache ORC C++ library has used std::filesystem to check TZDB availability since 2.0.0, Apache Arrow requires to add more linking options for std::filesystem. See apache/arrow#41023 for detail.

### How was this patch tested?
Passing CIs.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #1886 from wgtmac/ORC-1686.

Authored-by: Gang Wu <ustcwg@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun pushed a commit to apache/orc that referenced this pull request Apr 10, 2024
### What changes were proposed in this pull request?
Remove std::filesystem and use OS API instead.

### Why are the changes needed?
Apache Arrow C++ library is required to support old compilers like clang8. Since Apache ORC C++ library has used std::filesystem to check TZDB availability since 2.0.0, Apache Arrow requires to add more linking options for std::filesystem. See apache/arrow#41023 for detail.

### How was this patch tested?
Passing CIs.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #1886 from wgtmac/ORC-1686.

Authored-by: Gang Wu <ustcwg@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 695e0f3)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
tolleybot pushed a commit to tmct/arrow that referenced this pull request May 2, 2024
…ith ORC 2.0.0 or later (apache#41023)

### Rationale for this change

If we use `std::filesystem`, we need `-lstdc++fs` with GCC 8 and `-lc++fs` for clang 7. We don't want to maintain CMake code for GCC 8/clang 7.

### What changes are included in this PR?

* Don't use `std::filesystem` with ORC 2.0.0 or later.
* Use missing `-lstdc++fs`/`-lc++fs` with bundled ORC 2.0.0.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#40855

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
vibhatha pushed a commit to vibhatha/arrow that referenced this pull request May 25, 2024
…ith ORC 2.0.0 or later (apache#41023)

### Rationale for this change

If we use `std::filesystem`, we need `-lstdc++fs` with GCC 8 and `-lc++fs` for clang 7. We don't want to maintain CMake code for GCC 8/clang 7.

### What changes are included in this PR?

* Don't use `std::filesystem` with ORC 2.0.0 or later.
* Use missing `-lstdc++fs`/`-lc++fs` with bundled ORC 2.0.0.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#40855

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
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