wgtmac opened a new pull request, #1097: URL: https://github.com/apache/iceberg-cpp/pull/1097
## Summary Preserve the caller's `CMAKE_MODULE_PATH` when dependency discovery fails in the installed Iceberg CMake package. `iceberg_find_dependencies` currently saves and replaces the module path, then restores it after `find_dependency()` calls. However, `find_dependency()` returns from the package config on failure, skipping that restoration. The surrounding macro does not introduce a return boundary, so a non-required `find_package(iceberg)` can leave the caller's subsequent package discovery using Iceberg's module path. Replace the manual save/restore logic with `block(SCOPE_FOR VARIABLES PROPAGATE iceberg_FOUND iceberg_NOT_FOUND_MESSAGE)`. This preserves both the caller's module path (including its defined/undefined state) and the package failure diagnostic, while retaining imported dependency targets and existing per-dependency extra arguments. This is the same underlying issue addressed in apache/orc#2735 and worked around by apache/arrow#55415. The patch only changes `src/iceberg/iceberg-config.cmake.in`; no test files, CMakeLists files, or unrelated dependency-search policies are changed. ## Testing - `pre-commit run --files src/iceberg/iceberg-config.cmake.in` passed all applicable checks; file-type-inapplicable hooks were skipped. - Used temporary, out-of-tree configure projects with CMake 3.25.2 and 4.3.1. For each version, all six combinations of dependency success/failure and module path initially undefined/empty/multiple directories passed with the fix. - The same checks reproduced the leak in all three missing-dependency scenarios against the original template. They also checked package/component discovery, failure diagnostics, imported dependency targets, subsequent caller module discovery, and forwarding of AWS SDK `COMPONENTS` arguments. - No full Iceberg build or C++ tests were run for this CMake-package-only change. ## AI assistance Generated-by: OpenAI Codex (desktop app 26.1029.61003) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
