Skip to content

Conversation

@wgtmac
Copy link
Member

@wgtmac wgtmac commented Sep 26, 2025

What changes were proposed in this pull request?

  • Rename builtin FindXXX.cmake to FindXXXAlt.cmake to not interfere with cannonical package name. These are now only used when XXX_HOME or its friends are set. This includes:
    • FindGTest.cmake -> FindGTestAlt.cmake
    • FindLZ4.cmake -> FindLZ4Alt.cmake
    • FindProtobuf.cmake -> FindProtobufAlt.cmake
    • FindSnappy.cmake -> FindSnappyAlt.cmake
    • FindZLIB.cmake -> FindZLIBAlt.cmake
    • FindZSTD.cmake -> FindZSTDAlt.cmake
  • Bump CMake minimum requirement to 3.25 to leverage FetchContent with FIND_PACKAGE_ARGS. For 3rd party dependencies now, we try to find system installed one via CONFIG mode or fallback to vendor it. This includes:
    • GTest
    • LZ4
    • Protobuf
    • Snappy
    • ZSTD
    • ZLIB: note that we use an unreleased version (1.4.0) to work around its misuse of build and install interface
    • Sparsehash: always vendor it with workaround to its CMake misuse

Why are the changes needed?

How was this patch tested?

  • Pass all CIs
  • Test it manually

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

No

@wgtmac wgtmac force-pushed the fetch_content branch 15 times, most recently from 92abe65 to fd72130 Compare September 28, 2025 02:41
@wgtmac wgtmac changed the title WIP: [C++] Bump to CMake 3.25+ to use FetchContent ORC-2013: [C++] Bump to CMake 3.25+ to use FetchContent Sep 28, 2025
@wgtmac wgtmac force-pushed the fetch_content branch 8 times, most recently from a211c31 to f08a5b2 Compare September 28, 2025 09:11
@github-actions github-actions bot added the INFRA label Sep 28, 2025
@wgtmac wgtmac marked this pull request as ready for review September 28, 2025 09:21
@wgtmac
Copy link
Member Author

wgtmac commented Oct 8, 2025

The two failed CIs are due to outdated CMake versions from amazonlinux23 and debian11. Should we remove them? @dongjoon-hyun

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Oct 8, 2025

The two failed CIs are due to outdated CMake versions from amazonlinux23 and debian11. Should we remove them? @dongjoon-hyun

Do you mean to remove amazonlinux23 and debian11, @wgtmac ? Can we upgrade CMake on those Docker images? Then, I can help you by publishing new images.

@dongjoon-hyun
Copy link
Member

For Debian 11, we can remove it because we added Debian 12 and Debian 13. However, Amazonlinux23 is the latest one. I believe we need to support it.

@dongjoon-hyun
Copy link
Member

Here is the Debian 11 removal PR.

@dongjoon-hyun
Copy link
Member

For AmazonLinux2023, I confirmed that it has CMake 3.22.2. Let me update it locally first.

$ docker run -it --rm apache/orc-dev:amazonlinux23 cmake --version
cmake version 3.22.2

@dongjoon-hyun
Copy link
Member

Unfortunately, CMake version is still old even after refreshing the base image.

-FROM amazonlinux:2023
+FROM amazonlinux:2023.9.20250929.0
$ docker run -it --rm 4facd3ecc339 cmake --version
cmake version 3.22.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

@kou
Copy link
Member

kou commented Oct 8, 2025

FYI: Apache Arrow installs newer CMake manually on Amazon Linux 2023: https://github.com/apache/arrow/blob/33d1f32136f950520dcca278b77acff430dc8dca/dev/tasks/linux-packages/apache-arrow/yum/amazon-linux-2023/Dockerfile#L64-L68

@dongjoon-hyun
Copy link
Member

Good. I'll borrow that code. Thank you, @kou .

@dongjoon-hyun
Copy link
Member

Here is the PR for amazonlinux:2023

dongjoon-hyun added a commit that referenced this pull request Oct 8, 2025
### What changes were proposed in this pull request?

This PR aims to upgrade `CMake` to 3.26.0 in `amazonlinux:2023`.

### Why are the changes needed?

Currently, it has 3.22.2 which is blocking #2416 .

```
$ docker run -it --rm apache/orc-dev:amazonlinux23 cmake --version
cmake version 3.22.2
```

### How was this patch tested?

Manual build and tests.

```
$ ./reinit.sh amazonlinux23
```

```
$ docker run -it --rm apache/orc-dev:amazonlinux23 cmake --version
cmake version 3.26.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).
```

```
$ ./run-one.sh local x amazonlinux23
Started local run for main on amazonlinux23 at Wed Oct  8 00:03:37 PDT 2025
...
Test project /root/build
    Start 1: orc-test
1/9 Test #1: orc-test .........................   Passed    7.77 sec
    Start 2: java-test
2/9 Test #2: java-test ........................   Passed  118.90 sec
    Start 3: java-examples-test
3/9 Test #3: java-examples-test ...............   Passed    0.43 sec
    Start 4: java-tools-test
4/9 Test #4: java-tools-test ..................   Passed    0.07 sec
    Start 5: java-bench-gen-test
5/9 Test #5: java-bench-gen-test ..............   Passed    0.77 sec
    Start 6: java-bench-scan-test
6/9 Test #6: java-bench-scan-test .............   Passed    0.71 sec
    Start 7: java-bench-hive-test
7/9 Test #7: java-bench-hive-test .............   Passed   11.41 sec
    Start 8: java-bench-spark-test
8/9 Test #8: java-bench-spark-test ............   Passed  216.61 sec
    Start 9: tool-test
9/9 Test #9: tool-test ........................   Passed    4.37 sec

100% tests passed, 0 tests failed out of 9

Total Test time (real) = 361.08 sec
Built target test-out
Finished amazonlinux23 at Wed Oct  8 00:16:38 PDT 2025
```

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

No.

Closes #2435 from dongjoon-hyun/ORC-2016.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
@dongjoon-hyun
Copy link
Member

New amazonlinux23 image is published and I re-triggered CI on this PR.

$ docker run -it --rm apache/orc-dev:amazonlinux23 cmake --version
cmake version 3.26.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

@WillAyd
Copy link
Contributor

WillAyd commented Oct 8, 2025

Thanks for doing this @wgtmac . I'm not sure if there's a way for me to test this out locally but if so I'm happy to try it. Otherwise looking forward to this making its way through conda

@wgtmac
Copy link
Member Author

wgtmac commented Oct 8, 2025

@WillAyd I created conda-forge/orc-feedstock#94 to test this. Let's see what's going on. (cc @h-vetinari)


if (DEFINED ENV{SNAPPY_HOME})
set (SNAPPY_HOME "$ENV{SNAPPY_HOME}")
elseif (Snappy_ROOT)
Copy link
Member Author

Choose a reason for hiding this comment

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

@kou I have deleted lines like these so setting XXX_ROOT will not set XXX_HOME any more and it will skip FindXXXAlt.cmake by directly jumping to the FetchContent branch.

Copy link
Member

Choose a reason for hiding this comment

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

I'm OK with removing them as an Apache Arrow developer. But controlling wheter FindXXXAlt.cmake or FetchContent by only this may not be enough... I'll comment it on the https://github.com/apache/orc/pull/2416/files#r2387031578 thread.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Feel free to merge, @wgtmac .

@dongjoon-hyun dongjoon-hyun added this to the 3.0.0 milestone Oct 8, 2025
Copy link
Contributor

@ffacs ffacs left a comment

Choose a reason for hiding this comment

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

+1, LGTM.

@wgtmac wgtmac closed this in 96afee0 Oct 9, 2025
@wgtmac
Copy link
Member Author

wgtmac commented Oct 9, 2025

Merged this. Thanks everyone!

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.

5 participants