diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index cbb448cfa07..9b2fbbc336e 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -400,8 +400,6 @@ jobs: ARROW_WITH_SNAPPY: ON ARROW_WITH_ZLIB: ON ARROW_WITH_ZSTD: ON - # Don't use preinstalled Boost by empty BOOST_ROOT - BOOST_ROOT: "" ARROW_CMAKE_ARGS: >- -DARROW_PACKAGE_PREFIX=/${{ matrix.msystem_lower}} -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 7a29d35ee7b..db8d02784f4 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -234,12 +234,8 @@ jobs: ARROW_WITH_SNAPPY: ON ARROW_WITH_ZLIB: ON ARROW_WITH_ZSTD: ON - # Don't use preinstalled Boost by empty BOOST_ROOT and - # -DBoost_NO_BOOST_CMAKE=ON - BOOST_ROOT: "" ARROW_CMAKE_ARGS: >- -DARROW_PACKAGE_PREFIX=/ucrt${{ matrix.mingw-n-bits }} - -DBoost_NO_BOOST_CMAKE=ON -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON CMAKE_UNITY_BUILD: ON steps: @@ -318,9 +314,9 @@ jobs: windows-msvc: name: AMD64 Windows MSVC GLib - runs-on: windows-2019 + runs-on: windows-2022 if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - timeout-minutes: 90 + timeout-minutes: 240 strategy: fail-fast: false env: @@ -356,10 +352,8 @@ jobs: CMAKE_CXX_STANDARD: "17" CMAKE_GENERATOR: Ninja CMAKE_INSTALL_PREFIX: "${{ github.workspace }}/dist" - CMAKE_UNITY_BUILD: ON VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' - VCPKG_ROOT: "${{ github.workspace }}/vcpkg" - VCPKG_TRIPLET: x64-windows + VCPKG_DEFAULT_TRIPLET: x64-windows permissions: packages: write steps: @@ -376,10 +370,6 @@ jobs: with: fetch-depth: 0 submodules: recursive - - name: Install vcpkg - shell: bash - run: | - ci/scripts/install_vcpkg.sh "${VCPKG_ROOT}" - name: Install meson run: | python -m pip install meson @@ -408,29 +398,23 @@ jobs: - name: Setup NuGet credentials for vcpkg caching shell: bash run: | - $(vcpkg/vcpkg.exe fetch nuget | tail -n 1) \ + $(vcpkg fetch nuget | tail -n 1) \ sources add \ -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \ -storepasswordincleartext \ -name "GitHub" \ -username "$GITHUB_REPOSITORY_OWNER" \ -password "${{ secrets.GITHUB_TOKEN }}" - $(vcpkg/vcpkg.exe fetch nuget | tail -n 1) \ + $(vcpkg fetch nuget | tail -n 1) \ setapikey "${{ secrets.GITHUB_TOKEN }}" \ -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" - - name: Build C++ vcpkg dependencies - run: | - vcpkg\vcpkg.exe install ` - --triplet $env:VCPKG_TRIPLET ` - --x-manifest-root cpp ` - --x-install-root build\cpp\vcpkg_installed - name: Build C++ shell: cmd run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" - name: Build GLib shell: cmd run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 bash -c "ci/scripts/c_glib_build.sh $(pwd) $(pwd)/build" diff --git a/c_glib/vcpkg.json b/c_glib/vcpkg.json index 5873fd9f28e..df4508d2973 100644 --- a/c_glib/vcpkg.json +++ b/c_glib/vcpkg.json @@ -5,5 +5,19 @@ "glib", "gobject-introspection", "pkgconf" + ], + "$comment": "2025.02.14", + "builtin-baseline": "d5ec528843d29e3a52d745a64b469f810b2cedbf", + "overrides": [ + { + "$comment": + "We need gobject-introspection 1.80.0 or later for GLib 2.80.0 but vcpkg doesn't provide it yet.", + "name": "glib", + "version": "2.78.4" + }, + { + "name": "vcpkg-tool-meson", + "version": "1.3.2" + } ] } diff --git a/ci/scripts/c_glib_build.sh b/ci/scripts/c_glib_build.sh index e1421f1cc29..54bd7e5645a 100755 --- a/ci/scripts/c_glib_build.sh +++ b/ci/scripts/c_glib_build.sh @@ -41,19 +41,19 @@ meson_pkg_config_path="${ARROW_HOME}/lib/pkgconfig" mkdir -p "${build_dir}" -if [ -n "${VCPKG_ROOT:-}" ] && [ -n "${VCPKG_TRIPLET:-}" ]; then +if [ -n "${VCPKG_DEFAULT_TRIPLET:-}" ]; then vcpkg_install_root="${build_root}/vcpkg_installed" - "${VCPKG_ROOT}/vcpkg" install \ + vcpkg install \ --x-manifest-root="${source_dir}" \ --x-install-root="${vcpkg_install_root}" - PKG_CONFIG="${vcpkg_install_root}/${VCPKG_TRIPLET}/tools/pkgconf/pkgconf.exe" + PKG_CONFIG="${vcpkg_install_root}/${VCPKG_DEFAULT_TRIPLET}/tools/pkgconf/pkgconf.exe" export PKG_CONFIG - meson_pkg_config_path="${vcpkg_install_root}/${VCPKG_TRIPLET}/lib/pkgconfig:${meson_pkg_config_path}" + meson_pkg_config_path="${vcpkg_install_root}/${VCPKG_DEFAULT_TRIPLET}/lib/pkgconfig:${meson_pkg_config_path}" # Configure PATH for libraries required by the gobject-introspection generated binary cpp_vcpkg_install_root="${build_root}/cpp/vcpkg_installed" - PATH="${cpp_vcpkg_install_root}/${VCPKG_TRIPLET}/debug/bin:${PATH}" - PATH="${cpp_vcpkg_install_root}/${VCPKG_TRIPLET}/bin:${PATH}" - PATH="${vcpkg_install_root}/${VCPKG_TRIPLET}/bin:${PATH}" + PATH="${cpp_vcpkg_install_root}/${VCPKG_DEFAULT_TRIPLET}/debug/bin:${PATH}" + PATH="${cpp_vcpkg_install_root}/${VCPKG_DEFAULT_TRIPLET}/bin:${PATH}" + PATH="${vcpkg_install_root}/${VCPKG_DEFAULT_TRIPLET}/bin:${PATH}" fi if [ -n "${VCToolsInstallDir:-}" ] && [ -n "${MSYSTEM:-}" ]; then diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 9405a2eecad..3c628a20c35 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -71,6 +71,13 @@ if(POLICY CMP0135) cmake_policy(SET CMP0135 NEW) endif() +# https://cmake.org/cmake/help/latest/policy/CMP0167.html +# +# Use Boost's CMake packages instead of FindBoost.cmake in CMake. +if(POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) +endif() + # https://cmake.org/cmake/help/latest/policy/CMP0170.html # # CMP0170 is for enforcing dependency populations by users with diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 1259b9453a5..f1bcb186813 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -2743,6 +2743,10 @@ if(ARROW_WITH_ZSTD) else() set(ARROW_ZSTD_LIBZSTD zstd::libzstd_static) endif() + # vcpkg uses zstd::libzstd + if(NOT TARGET ${ARROW_ZSTD_LIBZSTD} AND TARGET zstd::libzstd) + set(ARROW_ZSTD_LIBZSTD zstd::libzstd) + endif() if(NOT TARGET ${ARROW_ZSTD_LIBZSTD}) message(FATAL_ERROR "Zstandard target doesn't exist: ${ARROW_ZSTD_LIBZSTD}") endif() diff --git a/cpp/cmake_modules/Usevcpkg.cmake b/cpp/cmake_modules/Usevcpkg.cmake index b6192468da3..016cfd169e4 100644 --- a/cpp/cmake_modules/Usevcpkg.cmake +++ b/cpp/cmake_modules/Usevcpkg.cmake @@ -116,52 +116,9 @@ if(NOT DEFINED VCPKG_MANIFEST_MODE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg CACHE BOOL "Use vcpkg.json manifest") message(STATUS "vcpkg.json manifest found. Using VCPKG_MANIFEST_MODE: ON") endif() -# vcpkg can install packages in three different places -set(_INST_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/vcpkg_installed") # try here first -set(_INST_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg_installed") # try here second -set(_INST_VCPKG_ROOT "${VCPKG_ROOT}/installed") -# Iterate over the places -foreach(_INST_DIR ${_INST_BUILD_DIR} ${_INST_SOURCE_DIR} ${_INST_VCPKG_ROOT} "notfound") - if(_INST_DIR STREQUAL "notfound") - message(FATAL_ERROR "vcpkg installed libraries directory not found. " - "Install packages with vcpkg before executing cmake.") - elseif(NOT EXISTS "${_INST_DIR}") - continue() - elseif((_INST_DIR STREQUAL _INST_BUILD_DIR OR _INST_DIR STREQUAL _INST_SOURCE_DIR) - AND NOT VCPKG_MANIFEST_MODE) - # Do not look for packages in the build or source dirs if manifest mode is off - message(STATUS "Skipped looking for installed packages in ${_INST_DIR} " - "because -DVCPKG_MANIFEST_MODE=OFF") - continue() - else() - message(STATUS "Looking for installed packages in ${_INST_DIR}") - endif() - if(DEFINED VCPKG_TARGET_TRIPLET) - # Check if a subdirectory named VCPKG_TARGET_TRIPLET - # exists in the vcpkg installed directory - if(EXISTS "${_INST_DIR}/${VCPKG_TARGET_TRIPLET}") - set(_VCPKG_INSTALLED_DIR "${_INST_DIR}") - break() - endif() - else() - # Infer VCPKG_TARGET_TRIPLET from the name of the - # subdirectory in the vcpkg installed directory - list_subdirs(_VCPKG_TRIPLET_SUBDIRS "${_INST_DIR}") - list(REMOVE_ITEM _VCPKG_TRIPLET_SUBDIRS "vcpkg") - list(LENGTH _VCPKG_TRIPLET_SUBDIRS _NUM_VCPKG_TRIPLET_SUBDIRS) - if(_NUM_VCPKG_TRIPLET_SUBDIRS EQUAL 1) - list(GET _VCPKG_TRIPLET_SUBDIRS 0 VCPKG_TARGET_TRIPLET) - set(_VCPKG_INSTALLED_DIR "${_INST_DIR}") - break() - endif() - endif() -endforeach() if(NOT DEFINED VCPKG_TARGET_TRIPLET) message(FATAL_ERROR "Could not infer VCPKG_TARGET_TRIPLET. " "Specify triplet with -DVCPKG_TARGET_TRIPLET.") -elseif(NOT DEFINED _VCPKG_INSTALLED_DIR) - message(FATAL_ERROR "Could not find installed vcpkg packages for triplet ${VCPKG_TARGET_TRIPLET}. " - "Install packages with vcpkg before executing cmake.") endif() set(VCPKG_TARGET_TRIPLET @@ -201,52 +158,3 @@ set(ARROW_VCPKG set(ARROW_DEPENDENCY_SOURCE "SYSTEM" CACHE STRING "The specified value VCPKG is implemented internally as SYSTEM" FORCE) - -set(BOOST_ROOT - "${ARROW_VCPKG_PREFIX}" - CACHE STRING "") -set(BOOST_INCLUDEDIR - "${ARROW_VCPKG_PREFIX}/include/boost" - CACHE STRING "") -set(BOOST_LIBRARYDIR - "${ARROW_VCPKG_PREFIX}/lib" - CACHE STRING "") -set(OPENSSL_INCLUDE_DIR - "${ARROW_VCPKG_PREFIX}/include" - CACHE STRING "") -set(OPENSSL_LIBRARIES - "${ARROW_VCPKG_PREFIX}/lib" - CACHE STRING "") -set(OPENSSL_ROOT_DIR - "${ARROW_VCPKG_PREFIX}" - CACHE STRING "") -set(Thrift_ROOT - "${ARROW_VCPKG_PREFIX}/lib" - CACHE STRING "") -set(ZSTD_INCLUDE_DIR - "${ARROW_VCPKG_PREFIX}/include" - CACHE STRING "") -set(ZSTD_ROOT - "${ARROW_VCPKG_PREFIX}" - CACHE STRING "") -set(BROTLI_ROOT - "${ARROW_VCPKG_PREFIX}" - CACHE STRING "") -set(LZ4_ROOT - "${ARROW_VCPKG_PREFIX}" - CACHE STRING "") - -if(CMAKE_HOST_WIN32) - set(LZ4_MSVC_LIB_PREFIX - "" - CACHE STRING "") - set(LZ4_MSVC_STATIC_LIB_SUFFIX - "" - CACHE STRING "") - set(ZSTD_MSVC_LIB_PREFIX - "" - CACHE STRING "") - set(ZSTD_MSVC_STATIC_LIB_SUFFIX - "" - CACHE STRING "") -endif() diff --git a/cpp/vcpkg.json b/cpp/vcpkg.json index f67fdbf9071..6eb24ad1803 100644 --- a/cpp/vcpkg.json +++ b/cpp/vcpkg.json @@ -15,6 +15,7 @@ ] }, "benchmark", + "boost-cmake", "boost-crc", "boost-filesystem", "boost-multiprecision", @@ -51,8 +52,6 @@ "zlib", "zstd" ], - "overrides": [ - { "name": "gtest", "version": "1.10.0", "port-version": 4 } - ], - "builtin-baseline": "3d8f78171a2a37d461077bf8d063256b63e25a4f" + "$comment": "2025.02.14", + "builtin-baseline": "d5ec528843d29e3a52d745a64b469f810b2cedbf" }