Copilot commented on code in PR #12625:
URL: https://github.com/apache/gluten/pull/12625#discussion_r4163301793
##########
dev/vcpkg/toolchain.cmake:
##########
@@ -33,11 +33,30 @@ set(VCPKG_HOST_TRIPLET $ENV{VCPKG_TRIPLET})
set(VCPKG_INSTALLED_DIR $ENV{VCPKG_MANIFEST_DIR}/vcpkg_installed)
set(VCPKG_INSTALL_OPTIONS --no-print-usage)
-# Force read CMAKE_PREFIX_PATH from env
-set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
-
include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
+if(NOT DEFINED CMAKE_FIND_PACKAGE_PREFER_CONFIG)
+ set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
+endif()
+set(CMAKE_FIND_PACKAGE_PREFER_CONFIG "${CMAKE_FIND_PACKAGE_PREFER_CONFIG}"
CACHE BOOL
+ "Prefer package configuration files." FORCE)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY CACHE STRING "Search for packages
only in root paths." FORCE)
+set(CMAKE_FIND_USE_PACKAGE_REGISTRY OFF CACHE BOOL "Disable the user package
registry." FORCE)
Review Comment:
CMake still consumes the inherited `CMAKE_PREFIX_PATH` environment variable
automatically, so removing the explicit assignment does not isolate arbitrary
host prefixes. With the current settings, a package config under an inherited
non-hard-coded prefix (for example `/tmp/poison`) can still satisfy
`find_package`, allowing host dependencies into the vcpkg graph. Disable CMake
environment-path lookup; this preserves the vcpkg-populated CMake variables
while excluding inherited prefixes.
--
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]