Repository navigation
Conversation
…endency not found
|
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change preserving Arrow’s CMake module search path during ORC discovery.
No open issues 🎉
What changed in this PR
Preserves Arrow’s CMake module search path when ORC dependency discovery fails, preventing later lookups such as AWS SDK discovery from losing access to Arrow’s find modules.
Changes:
- Saves and restores
CMAKE_MODULE_PATHaroundfind_package(orc), then removes the temporary variable. - Documents why ORC’s early return requires this workaround.
| File | Description |
|---|---|
cpp/cmake_modules/FindorcAlt.cmake |
Preserves the module search path across ORC discovery. |
Review effort: Balanced
|
Thanks a lot for debugging this. I think this is good as an intermediate fix; better would be for orc to fix this for itself. |
|
Yes, I agree this is something that should be fixed on ORC side, this seems slightly related to the following issue (eventhough not exactly the same problem): ping @wgtmac what do you think? edit: not the specific clobbing but the initial issue that created this as ORC wasn't able to find lz4 from conda due to homebrew also having lz4 and then (this new issue) not clearing |
|
Ah, indeed ORC needs to fix this: apache/orc#2735 |
…fails ### What changes were proposed in this pull request? Isolate dependency discovery in `orcConfig.cmake` with a CMake variable scope, propagating `orc_FOUND` and `orc_NOT_FOUND_MESSAGE` while keeping `CMAKE_MODULE_PATH` local even on an early return. The patch only changes `c++/orcConfig.cmake.in`; it does not modify test CMakeLists files or add test infrastructure. ### Why are the changes needed? [ORC-2235](https://issues.apache.org/jira/browse/ORC-2235) `find_dependency()` returns from the package config when a dependency cannot be found. The previous manual restoration of `CMAKE_MODULE_PATH` was therefore skipped, leaking ORC's module search path into the consuming project. This caused a misleading AWS dependency-discovery failure in Arrow after ORC's LZ4 dependency lookup failed. apache/arrow#55415 adds a caller-side workaround; this PR fixes the underlying ORC configuration leak. It does not change LZ4 dependency-selection policy. ### How was this patch tested? On macOS with CMake 4.3.1: ```sh cmake -S . -B build -DBUILD_JAVA=OFF cmake --build build --target orc-test --parallel 8 cmake --build build --target test-out ``` After removing the test-infrastructure changes, both existing CTest tests (`orc-test` and `tool-test`) passed. Separately verified six temporary, out-of-tree configure scenarios with CMake 3.25.2 and 4.3.1: successful/missing dependency discovery with `CMAKE_MODULE_PATH` initially undefined, empty, or containing multiple directories. All six passed with the scoped fix; all three missing-dependency scenarios reproduced the leak against the original template. No regression test files are included in this PR. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (desktop app 26.1029.61003) Closes #2735 from wgtmac/codex/orc-2235-cmake-module-path. Authored-by: Gang Wu <ustcwg@gmail.com> Signed-off-by: Gang Wu <ustcwg@gmail.com>
…fails ### What changes were proposed in this pull request? Isolate dependency discovery in `orcConfig.cmake` with a CMake variable scope, propagating `orc_FOUND` and `orc_NOT_FOUND_MESSAGE` while keeping `CMAKE_MODULE_PATH` local even on an early return. The patch only changes `c++/orcConfig.cmake.in`; it does not modify test CMakeLists files or add test infrastructure. ### Why are the changes needed? [ORC-2235](https://issues.apache.org/jira/browse/ORC-2235) `find_dependency()` returns from the package config when a dependency cannot be found. The previous manual restoration of `CMAKE_MODULE_PATH` was therefore skipped, leaking ORC's module search path into the consuming project. This caused a misleading AWS dependency-discovery failure in Arrow after ORC's LZ4 dependency lookup failed. apache/arrow#55415 adds a caller-side workaround; this PR fixes the underlying ORC configuration leak. It does not change LZ4 dependency-selection policy. ### How was this patch tested? On macOS with CMake 4.3.1: ```sh cmake -S . -B build -DBUILD_JAVA=OFF cmake --build build --target orc-test --parallel 8 cmake --build build --target test-out ``` After removing the test-infrastructure changes, both existing CTest tests (`orc-test` and `tool-test`) passed. Separately verified six temporary, out-of-tree configure scenarios with CMake 3.25.2 and 4.3.1: successful/missing dependency discovery with `CMAKE_MODULE_PATH` initially undefined, empty, or containing multiple directories. All six passed with the scoped fix; all three missing-dependency scenarios reproduced the leak against the original template. No regression test files are included in this PR. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (desktop app 26.1029.61003) Closes #2735 from wgtmac/codex/orc-2235-cmake-module-path. Authored-by: Gang Wu <ustcwg@gmail.com> Signed-off-by: Gang Wu <ustcwg@gmail.com> (cherry picked from commit 0c0d0f0) Signed-off-by: Gang Wu <ustcwg@gmail.com>
…fails ### What changes were proposed in this pull request? Isolate dependency discovery in `orcConfig.cmake` with a CMake variable scope, propagating `orc_FOUND` and `orc_NOT_FOUND_MESSAGE` while keeping `CMAKE_MODULE_PATH` local even on an early return. The patch only changes `c++/orcConfig.cmake.in`; it does not modify test CMakeLists files or add test infrastructure. ### Why are the changes needed? [ORC-2235](https://issues.apache.org/jira/browse/ORC-2235) `find_dependency()` returns from the package config when a dependency cannot be found. The previous manual restoration of `CMAKE_MODULE_PATH` was therefore skipped, leaking ORC's module search path into the consuming project. This caused a misleading AWS dependency-discovery failure in Arrow after ORC's LZ4 dependency lookup failed. apache/arrow#55415 adds a caller-side workaround; this PR fixes the underlying ORC configuration leak. It does not change LZ4 dependency-selection policy. ### How was this patch tested? On macOS with CMake 4.3.1: ```sh cmake -S . -B build -DBUILD_JAVA=OFF cmake --build build --target orc-test --parallel 8 cmake --build build --target test-out ``` After removing the test-infrastructure changes, both existing CTest tests (`orc-test` and `tool-test`) passed. Separately verified six temporary, out-of-tree configure scenarios with CMake 3.25.2 and 4.3.1: successful/missing dependency discovery with `CMAKE_MODULE_PATH` initially undefined, empty, or containing multiple directories. All six passed with the scoped fix; all three missing-dependency scenarios reproduced the leak against the original template. No regression test files are included in this PR. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (desktop app 26.1029.61003) Closes #2735 from wgtmac/codex/orc-2235-cmake-module-path. Authored-by: Gang Wu <ustcwg@gmail.com> Signed-off-by: Gang Wu <ustcwg@gmail.com> (cherry picked from commit 0c0d0f0) Signed-off-by: Gang Wu <ustcwg@gmail.com>
Rationale for this change
When a dependency is not found on ORC its
find_dependencyreturns without resetting previousCMAKE_MODULE_PATH:https://github.com/apache/orc/blob/32046606774da481182dce2956f336dc8e79a579/c%2B%2B/orcConfig.cmake.in#L45-L55
What changes are included in this PR?
Maintain our
CMAKE_MODULE_PATHbefore calling ORC.Are these changes tested?
Not on our CI but this has been tested on downstream arrow-cpp-feedstock here:
conda-forge/arrow-cpp-feedstock#2100
Are there any user-facing changes?
No
Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: