From 87452b1e1e308f8fefe498c662a0295162f2cc63 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Tue, 20 Jun 2023 17:09:00 +0100 Subject: [PATCH 01/93] Shefali pr rebased (#6) * ARROW-2034: [C++] Filesystem implementation for AzureBlobFileSystem * ARROW-2034: [C++] Fixed formatting issues * ARROW-2034: [C++] Fixed formatting issues * Added -DARROW_AZURE in ci * Added CXX_STANDARD and CXX_STANDARD_REQUIRED * Added mocked test file * Turned -DARROW_AZURE=OFF in appveyor-cpp-build * Changed default C++ version * Changed LibXml2 target * Fixing CMake styling issues * Enabling ARROW_AZURE flag * Added OpenSSL dependency * Disabling ARROW_AZURE in windows-mingw * Fixing lint issues * Fixing azurefs_test * Added Azurite * Added azurefs_objlib * Reverting azure object library changes * Added permissions to install_azurite.sh * chmod +x ci/scripts/install_azurite.sh * Don't specify CMAKE_CXX_STANDARD by default * Fix system detection * Fix syntax * Fix style * Fix style * Running azurite through boost::process * Fixed naming in azurefs_test.cc * Fixed naming in azurefs.cc * Fixed OpenOutputStream * Added uri.Parse() * Updated versions.txt * Fixed ARROW_AZURE_STORAGE_BLOBS_URL * Added libxml2-dev * Fixed build errors --------- Co-authored-by: shefali singh Co-authored-by: Sutou Kouhei --- ci/appveyor-cpp-build.bat | 1 + ci/docker/ubuntu-20.04-cpp.dockerfile | 1 + ci/docker/ubuntu-22.04-cpp.dockerfile | 4 + cpp/CMakeLists.txt | 5 + cpp/cmake_modules/ThirdpartyToolchain.cmake | 197 ++++++++++++++++++++ cpp/thirdparty/versions.txt | 10 + cpp/vcpkg.json | 5 + 7 files changed, 223 insertions(+) diff --git a/ci/appveyor-cpp-build.bat b/ci/appveyor-cpp-build.bat index e69c7bf2516d9..850bf6821ab84 100644 --- a/ci/appveyor-cpp-build.bat +++ b/ci/appveyor-cpp-build.bat @@ -60,6 +60,7 @@ pushd cpp\build cmake -G "%GENERATOR%" %ARROW_CMAKE_ARGS% ^ -DARROW_ACERO=ON ^ + -DARROW_AZURE=OFF ^ -DARROW_BOOST_USE_SHARED=ON ^ -DARROW_BUILD_EXAMPLES=ON ^ -DARROW_BUILD_STATIC=OFF ^ diff --git a/ci/docker/ubuntu-20.04-cpp.dockerfile b/ci/docker/ubuntu-20.04-cpp.dockerfile index 125f1f48d482e..bb487f6a5f7d8 100644 --- a/ci/docker/ubuntu-20.04-cpp.dockerfile +++ b/ci/docker/ubuntu-20.04-cpp.dockerfile @@ -99,6 +99,7 @@ RUN apt-get update -y -q && \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxml2-dev \ libzstd-dev \ make \ ninja-build \ diff --git a/ci/docker/ubuntu-22.04-cpp.dockerfile b/ci/docker/ubuntu-22.04-cpp.dockerfile index 0840b3fa5c68d..aa313bc0e8a58 100644 --- a/ci/docker/ubuntu-22.04-cpp.dockerfile +++ b/ci/docker/ubuntu-22.04-cpp.dockerfile @@ -98,6 +98,7 @@ RUN apt-get update -y -q && \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxml2-dev \ libzstd-dev \ make \ ninja-build \ @@ -160,6 +161,9 @@ RUN /arrow/ci/scripts/install_azurite.sh COPY ci/scripts/install_sccache.sh /arrow/ci/scripts/ RUN /arrow/ci/scripts/install_sccache.sh unknown-linux-musl /usr/local/bin +COPY ci/scripts/install_azurite.sh /arrow/ci/scripts/ +RUN /arrow/ci/scripts/install_azurite.sh + # Prioritize system packages and local installation # The following dependencies will be downloaded due to missing/invalid packages # provided by the distribution: diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 27d7097a2901f..5fc977cfc4acc 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -795,6 +795,11 @@ if(ARROW_WITH_OPENTELEMETRY) list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl) endif() +if(ARROW_AZURE) + list(APPEND ARROW_SHARED_LINK_LIBS ${AZURESDK_LINK_LIBRARIES}) + list(APPEND ARROW_STATIC_LINK_LIBS ${AZURESDK_LINK_LIBRARIES}) +endif() + if(ARROW_WITH_UTF8PROC) list(APPEND ARROW_SHARED_LINK_LIBS utf8proc::utf8proc) list(APPEND ARROW_STATIC_LINK_LIBS utf8proc::utf8proc) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 1767c05b5ee3a..c8238221bf0c8 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -548,6 +548,47 @@ else() "${THIRDPARTY_MIRROR_URL}/aws-sdk-cpp-${ARROW_AWSSDK_BUILD_VERSION}.tar.gz") endif() +if(DEFINED ENV{ARROW_AZURE_CORE_URL}) + set(AZURE_CORE_SOURCE_URL "$ENV{ARROW_AZURE_CORE_URL}") +else() + set_urls(AZURE_CORE_SOURCE_URL + "https://github.com/Azure/azure-sdk-for-cpp/archive/azure-core_${ARROW_AZURE_CORE_BUILD_VERSION}.tar.gz" + ) +endif() + +if(DEFINED ENV{ARROW_AZURE_IDENTITY_URL}) + set(AZURE_IDENTITY_SOURCE_URL "$ENV{ARROW_AZURE_IDENTITY_URL}") +else() + set_urls(AZURE_IDENTITY_SOURCE_URL + "https://github.com/Azure/azure-sdk-for-cpp/archive/azure-identity_${ARROW_AZURE_IDENTITY_BUILD_VERSION}.tar.gz" + ) +endif() + +if(DEFINED ENV{ARROW_AZURE_STORAGE_BLOBS_URL}) + set(AZURE_STORAGE_BLOBS_SOURCE_URL "$ENV{ARROW_AZURE_STORAGE_BLOBS_URL}") +else() + set_urls(AZURE_STORAGE_BLOBS_SOURCE_URL + "https://github.com/Azure/azure-sdk-for-cpp/archive/azure-storage-blobs_${ARROW_AZURE_STORAGE_BLOBS_BUILD_VERSION}.tar.gz" + ) +endif() + +if(DEFINED ENV{ARROW_AZURE_STORAGE_COMMON_URL}) + set(AZURE_STORAGE_COMMON_SOURCE_URL "$ENV{ARROW_AZURE_STORAGE_COMMON_URL}") +else() + set_urls(AZURE_STORAGE_COMMON_SOURCE_URL + "https://github.com/Azure/azure-sdk-for-cpp/archive/azure-storage-common_${ARROW_AZURE_STORAGE_COMMON_BUILD_VERSION}.tar.gz" + ) +endif() + +if(DEFINED ENV{ARROW_AZURE_STORAGE_FILES_DATALAKE_URL}) + set(AZURE_STORAGE_FILES_DATALAKE_SOURCE_URL + "$ENV{ARROW_AZURE_STORAGE_FILES_DATALAKE_URL}") +else() + set_urls(AZURE_STORAGE_FILES_DATALAKE_SOURCE_URL + "https://github.com/Azure/azure-sdk-for-cpp/archive/azure-storage-files-datalake_${ARROW_AZURE_STORAGE_FILES_DATALAKE_BUILD_VERSION}.tar.gz" + ) +endif() + if(DEFINED ENV{ARROW_BOOST_URL}) set(BOOST_SOURCE_URL "$ENV{ARROW_BOOST_URL}") else() @@ -5049,6 +5090,162 @@ if(ARROW_S3) endif() endif() +macro(build_azuresdk) + message(STATUS "Building Azure C++ SDK from source") + + find_curl() + find_package(LibXml2 REQUIRED) + find_package(OpenSSL ${ARROW_OPENSSL_REQUIRED_VERSION} REQUIRED) + + set(AZURESDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-install") + set(AZURESDK_INCLUDE_DIR "${AZURESDK_PREFIX}/include") + set(AZURESDK_LIB_DIR "lib") + + # provide hint for Azure SDK to link with the already located openssl + get_filename_component(OPENSSL_ROOT_HINT "${OPENSSL_INCLUDE_DIR}" DIRECTORY) + + set(AZURESDK_COMMON_CMAKE_ARGS + ${EP_COMMON_CMAKE_ARGS} + "-DCMAKE_INSTALL_PREFIX=${AZURESDK_PREFIX}" + "-DCMAKE_PREFIX_PATH=${AZURESDK_PREFIX}" + -DBUILD_SHARED_LIBS=OFF + -DCMAKE_INSTALL_LIBDIR=${AZURESDK_LIB_DIR} + -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON + -DENABLE_TESTING=OFF + -DENABLE_UNITY_BUILD=ON + -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_HINT} + -DWARNINGS_AS_ERRORS=OFF) + + file(MAKE_DIRECTORY ${AZURESDK_INCLUDE_DIR}) + + set(AZURE_CORE_STATIC_LIBRARY + "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-core${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + externalproject_add(azure_core_ep + ${EP_LOG_OPTIONS} + INSTALL_DIR ${AZURESDK_PREFIX} + URL ${AZURE_CORE_SOURCE_URL} + URL_HASH "SHA256=${ARROW_AZURE_CORE_BUILD_SHA256_CHECKSUM}" + CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS ${AZURE_CORE_STATIC_LIBRARY}) + add_library(Azure::azure-core STATIC IMPORTED) + set_target_properties(Azure::azure-core + PROPERTIES IMPORTED_LOCATION "${AZURE_CORE_STATIC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES + "${AZURESDK_INCLUDE_DIR}") + target_link_libraries(Azure::azure-core INTERFACE CURL::libcurl LibXml2::LibXml2) + add_dependencies(Azure::azure-core azure_core_ep) + + set(AZURE_IDENTITY_STATIC_LIBRARY + "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-identity${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + externalproject_add(azure_identity_ep + ${EP_LOG_OPTIONS} + INSTALL_DIR ${AZURESDK_PREFIX} + URL ${AZURE_IDENTITY_SOURCE_URL} + URL_HASH "SHA256=${ARROW_AZURE_IDENTITY_BUILD_SHA256_CHECKSUM}" + CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS ${AZURE_IDENTITY_STATIC_LIBRARY}) + add_library(Azure::azure-identity STATIC IMPORTED) + set_target_properties(Azure::azure-identity + PROPERTIES IMPORTED_LOCATION "${AZURE_IDENTITY_STATIC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES + "${AZURESDK_INCLUDE_DIR}") + target_link_libraries(Azure::azure-identity INTERFACE CURL::libcurl LibXml2::LibXml2) + add_dependencies(Azure::azure-identity azure_identity_ep) + + set(AZURE_STORAGE_BLOBS_STATIC_LIBRARY + "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-blobs${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + externalproject_add(azure_storage_blobs_ep + ${EP_LOG_OPTIONS} + INSTALL_DIR ${AZURESDK_PREFIX} + URL ${AZURE_STORAGE_BLOBS_SOURCE_URL} + URL_HASH "SHA256=${ARROW_AZURE_STORAGE_BLOBS_BUILD_SHA256_CHECKSUM}" + CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY}) + add_library(Azure::azure-storage-blobs STATIC IMPORTED) + set_target_properties(Azure::azure-storage-blobs + PROPERTIES IMPORTED_LOCATION + "${AZURE_STORAGE_BLOBS_STATIC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES + "${AZURESDK_INCLUDE_DIR}") + target_link_libraries(Azure::azure-storage-blobs + INTERFACE Azure::azure-core CURL::libcurl LibXml2::LibXml2) + add_dependencies(Azure::azure-storage-blobs azure_storage_blobs_ep) + + set(AZURE_STORAGE_COMMON_STATIC_LIBRARY + "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-common${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + externalproject_add(azure_storage_common_ep + ${EP_LOG_OPTIONS} + INSTALL_DIR ${AZURESDK_PREFIX} + URL ${AZURE_STORAGE_COMMON_SOURCE_URL} + URL_HASH "SHA256=${ARROW_AZURE_STORAGE_COMMON_BUILD_SHA256_CHECKSUM}" + CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS ${AZURE_STORAGE_COMMON_STATIC_LIBRARY}) + add_library(Azure::azure-storage-common STATIC IMPORTED) + set_target_properties(Azure::azure-storage-common + PROPERTIES IMPORTED_LOCATION + "${AZURE_STORAGE_COMMON_STATIC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES + "${AZURESDK_INCLUDE_DIR}") + target_link_libraries(Azure::azure-storage-common INTERFACE CURL::libcurl + LibXml2::LibXml2) + add_dependencies(Azure::azure-storage-common azure_storage_common_ep) + set_property(TARGET Azure::azure-storage-common PROPERTY INTERFACE_LINK_LIBRARIES + OpenSSL::Crypto) + + set(AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY + "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-files-datalake${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + externalproject_add(azure_storage_files_datalake_ep + ${EP_LOG_OPTIONS} + INSTALL_DIR ${AZURESDK_PREFIX} + URL ${AZURE_STORAGE_FILES_DATALAKE_SOURCE_URL} + URL_HASH "SHA256=${ARROW_AZURE_STORAGE_FILES_DATALAKE_BUILD_SHA256_CHECKSUM}" + CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} + BUILD_BYPRODUCTS ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY}) + add_library(Azure::azure-storage-files-datalake STATIC IMPORTED) + set_target_properties(Azure::azure-storage-files-datalake + PROPERTIES IMPORTED_LOCATION + "${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES + "${AZURESDK_INCLUDE_DIR}") + target_link_libraries(Azure::azure-storage-files-datalake + INTERFACE Azure::azure-core + Azure::azure-identity + Azure::azure-storage-blobs + Azure::azure-storage-common + CURL::libcurl + LibXml2::LibXml2) + add_dependencies(Azure::azure-storage-files-datalake azure_storage_files_datalake_ep) + + set(AZURESDK_LIBRARIES) + list(APPEND + AZURESDK_LIBRARIES + Azure::azure-core + Azure::azure-storage-blobs + Azure::azure-identity + Azure::azure-storage-common + Azure::azure-storage-files-datalake) + list(APPEND + ARROW_BUNDLED_STATIC_LIBS + Azure::azure-core + Azure::azure-storage-blobs + Azure::azure-identity + Azure::azure-storage-common + Azure::azure-storage-files-datalake) + + set(AZURESDK_LINK_LIBRARIES ${AZURESDK_LIBRARIES}) +endmacro() + +if(ARROW_AZURE) + build_azuresdk() + message(STATUS "Found Azure SDK headers: ${AZURESDK_INCLUDE_DIR}") + message(STATUS "Found Azure SDK libraries: ${AZURESDK_LINK_LIBRARIES}") +endif() + # ---------------------------------------------------------------------- # ucx - communication framework for modern, high-bandwidth and low-latency networks diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index 8edaa422b3dcf..06cf0964fe3c7 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -53,6 +53,16 @@ ARROW_AWS_LC_BUILD_VERSION=v1.3.0 ARROW_AWS_LC_BUILD_SHA256_CHECKSUM=ae96a3567161552744fc0cae8b4d68ed88b1ec0f3d3c98700070115356da5a37 ARROW_AWSSDK_BUILD_VERSION=1.10.55 ARROW_AWSSDK_BUILD_SHA256_CHECKSUM=2d552fb1a84bef4a9b65e34aa7031851ed2aef5319e02cc6e4cb735c48aa30de +ARROW_AZURE_CORE_BUILD_VERSION=1.7.1 +ARROW_AZURE_CORE_BUILD_SHA256_CHECKSUM=ae6f03e65d9773d11cf3b9619d0bc7f567272974cf31b9e1c8ca2fa0ea4fb4c6 +ARROW_AZURE_IDENTITY_BUILD_VERSION=1.3.0 +ARROW_AZURE_IDENTITY_BUILD_SHA256_CHECKSUM=46701acd8000f317d1c4b33263d5d3203924fadcfa5af4860ae9187046a72c45 +ARROW_AZURE_STORAGE_BLOBS_BUILD_VERSION=12.5.0 +ARROW_AZURE_STORAGE_BLOBS_BUILD_SHA256_CHECKSUM=12394d864144ced9fc3562ad48cfe3426604e871b5aa72853ca398e086f0c594 +ARROW_AZURE_STORAGE_COMMON_BUILD_VERSION=12.2.4 +ARROW_AZURE_STORAGE_COMMON_BUILD_SHA256_CHECKSUM=7644b4355b492ba2039236b9fd56c3e7bb80aad983d8bac6a731d74aaf64e03f +ARROW_AZURE_STORAGE_FILES_DATALAKE_BUILD_VERSION=12.3.1 +ARROW_AZURE_STORAGE_FILES_DATALAKE_BUILD_SHA256_CHECKSUM=a5b74076a751d7cfaf7c56674a40ce2792c4fab9add18758fab1fe091d00baff ARROW_BOOST_BUILD_VERSION=1.81.0 ARROW_BOOST_BUILD_SHA256_CHECKSUM=9e0ffae35528c35f90468997bc8d99500bf179cbae355415a89a600c38e13574 ARROW_BROTLI_BUILD_VERSION=v1.0.9 diff --git a/cpp/vcpkg.json b/cpp/vcpkg.json index 71855dafdea35..37afc531aba81 100644 --- a/cpp/vcpkg.json +++ b/cpp/vcpkg.json @@ -14,6 +14,11 @@ "transfer" ] }, + "azure-core-cpp", + "azure-identity-cpp", + "azure-storage-blobs-cpp", + "azure-storage-common-cpp", + "azure-storage-files-datalake-cpp", "benchmark", "boost-filesystem", "boost-multiprecision", From 39cf5e39c7412d963e2b16f01b43e2ca9ddf2819 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Tue, 20 Jun 2023 17:12:52 +0100 Subject: [PATCH 02/93] Build fixes --- ci/scripts/python_wheel_manylinux_build.sh | 4 + cpp/cmake_modules/ThirdpartyToolchain.cmake | 255 ++++++++++---------- cpp/thirdparty/versions.txt | 15 +- 3 files changed, 139 insertions(+), 135 deletions(-) diff --git a/ci/scripts/python_wheel_manylinux_build.sh b/ci/scripts/python_wheel_manylinux_build.sh index 58e42fea88088..bc1ac65269ca3 100755 --- a/ci/scripts/python_wheel_manylinux_build.sh +++ b/ci/scripts/python_wheel_manylinux_build.sh @@ -53,6 +53,7 @@ echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries ===" : ${ARROW_FLIGHT:=ON} : ${ARROW_GANDIVA:=OFF} : ${ARROW_GCS:=ON} +: ${ARROW_AZURE:=ON} : ${ARROW_HDFS:=ON} : ${ARROW_JEMALLOC:=ON} : ${ARROW_MIMALLOC:=ON} @@ -99,6 +100,7 @@ cmake \ -DARROW_FLIGHT=${ARROW_FLIGHT} \ -DARROW_GANDIVA=${ARROW_GANDIVA} \ -DARROW_GCS=${ARROW_GCS} \ + -DARROW_AZURE=${ARROW_AZURE} \ -DARROW_HDFS=${ARROW_HDFS} \ -DARROW_JEMALLOC=${ARROW_JEMALLOC} \ -DARROW_JSON=ON \ @@ -123,6 +125,7 @@ cmake \ -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} \ -DORC_PROTOBUF_EXECUTABLE=${VCPKG_ROOT}/installed/${VCPKG_TARGET_TRIPLET}/tools/protobuf/protoc \ -DORC_SOURCE=BUNDLED \ + -Dxml2_SOURCE=BUNDLED \ -DPARQUET_REQUIRE_ENCRYPTION=${PARQUET_REQUIRE_ENCRYPTION} \ -DVCPKG_MANIFEST_MODE=OFF \ -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} \ @@ -145,6 +148,7 @@ export PYARROW_WITH_DATASET=${ARROW_DATASET} export PYARROW_WITH_FLIGHT=${ARROW_FLIGHT} export PYARROW_WITH_GANDIVA=${ARROW_GANDIVA} export PYARROW_WITH_GCS=${ARROW_GCS} +export PYARROW_WITH_AZURE=${ARROW_AZURE} export PYARROW_WITH_HDFS=${ARROW_HDFS} export PYARROW_WITH_ORC=${ARROW_ORC} export PYARROW_WITH_PARQUET=${ARROW_PARQUET} diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index c8238221bf0c8..bed7327bb8e11 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -46,6 +46,7 @@ set(ARROW_RE2_LINKAGE set(ARROW_THIRDPARTY_DEPENDENCIES absl AWSSDK + AZURE_SDK benchmark Boost Brotli @@ -72,7 +73,9 @@ set(ARROW_THIRDPARTY_DEPENDENCIES utf8proc xsimd ZLIB - zstd) + zstd + xml2 +) # For backward compatibility. We use "BOOST_SOURCE" if "Boost_SOURCE" # isn't specified and "BOOST_SOURCE" is specified. @@ -211,6 +214,10 @@ macro(build_dependency DEPENDENCY_NAME) build_zlib() elseif("${DEPENDENCY_NAME}" STREQUAL "zstd") build_zstd() + elseif("${DEPENDENCY_NAME}" STREQUAL "AZURE_SDK") + build_azuresdk() + elseif("${DEPENDENCY_NAME}" STREQUAL "xml2") + build_xml2() else() message(FATAL_ERROR "Unknown thirdparty dependency to build: ${DEPENDENCY_NAME}") endif() @@ -362,12 +369,19 @@ if(ARROW_WITH_GRPC) set(ARROW_WITH_ZLIB ON) endif() +# Enable GCS if(ARROW_GCS) set(ARROW_WITH_GOOGLE_CLOUD_CPP ON) set(ARROW_WITH_NLOHMANN_JSON ON) set(ARROW_WITH_ZLIB ON) endif() +# Enable Azure +if(ARROW_AZURE) + set(ARROW_WITH_AZURE_SDK ON) + set(ARROW_WITH_XML2 ON) +endif() + if(ARROW_JSON) set(ARROW_WITH_RAPIDJSON ON) endif() @@ -548,44 +562,11 @@ else() "${THIRDPARTY_MIRROR_URL}/aws-sdk-cpp-${ARROW_AWSSDK_BUILD_VERSION}.tar.gz") endif() -if(DEFINED ENV{ARROW_AZURE_CORE_URL}) - set(AZURE_CORE_SOURCE_URL "$ENV{ARROW_AZURE_CORE_URL}") -else() - set_urls(AZURE_CORE_SOURCE_URL - "https://github.com/Azure/azure-sdk-for-cpp/archive/azure-core_${ARROW_AZURE_CORE_BUILD_VERSION}.tar.gz" - ) -endif() - -if(DEFINED ENV{ARROW_AZURE_IDENTITY_URL}) - set(AZURE_IDENTITY_SOURCE_URL "$ENV{ARROW_AZURE_IDENTITY_URL}") -else() - set_urls(AZURE_IDENTITY_SOURCE_URL - "https://github.com/Azure/azure-sdk-for-cpp/archive/azure-identity_${ARROW_AZURE_IDENTITY_BUILD_VERSION}.tar.gz" - ) -endif() - -if(DEFINED ENV{ARROW_AZURE_STORAGE_BLOBS_URL}) - set(AZURE_STORAGE_BLOBS_SOURCE_URL "$ENV{ARROW_AZURE_STORAGE_BLOBS_URL}") +if(DEFINED ENV{ARROW_AZURESDK_URL}) + set(ARROW_AZURESDK_URL "$ENV{ARROW_AZURESDK_URL}") else() - set_urls(AZURE_STORAGE_BLOBS_SOURCE_URL - "https://github.com/Azure/azure-sdk-for-cpp/archive/azure-storage-blobs_${ARROW_AZURE_STORAGE_BLOBS_BUILD_VERSION}.tar.gz" - ) -endif() - -if(DEFINED ENV{ARROW_AZURE_STORAGE_COMMON_URL}) - set(AZURE_STORAGE_COMMON_SOURCE_URL "$ENV{ARROW_AZURE_STORAGE_COMMON_URL}") -else() - set_urls(AZURE_STORAGE_COMMON_SOURCE_URL - "https://github.com/Azure/azure-sdk-for-cpp/archive/azure-storage-common_${ARROW_AZURE_STORAGE_COMMON_BUILD_VERSION}.tar.gz" - ) -endif() - -if(DEFINED ENV{ARROW_AZURE_STORAGE_FILES_DATALAKE_URL}) - set(AZURE_STORAGE_FILES_DATALAKE_SOURCE_URL - "$ENV{ARROW_AZURE_STORAGE_FILES_DATALAKE_URL}") -else() - set_urls(AZURE_STORAGE_FILES_DATALAKE_SOURCE_URL - "https://github.com/Azure/azure-sdk-for-cpp/archive/azure-storage-files-datalake_${ARROW_AZURE_STORAGE_FILES_DATALAKE_BUILD_VERSION}.tar.gz" + set_urls(ARROW_AZURESDK_URL + "https://github.com/Azure/azure-sdk-for-cpp/archive/${ARROW_AZURE_SDK_BUILD_VERSION}.tar.gz" ) endif() @@ -712,6 +693,14 @@ else() ) endif() +if(DEFINED ENV{ARROW_XML2_URL}) + set(XML2_SOURCE_URL "$ENV{ARROW_XML2_URL}") +else() + set_urls(XML2_SOURCE_URL + "https://github.com/GNOME/libxml2/archive/refs/tags/${ARROW_XML2_BUILD_VERSION}.tar.gz" + ) +endif() + if(DEFINED ENV{ARROW_LZ4_URL}) set(LZ4_SOURCE_URL "$ENV{ARROW_LZ4_URL}") else() @@ -5090,11 +5079,64 @@ if(ARROW_S3) endif() endif() +# ---------------------------------------------------------------------- +# Azure SDK and dependencies + +macro(build_xml2) + message(STATUS "Building xml2 from source") + # "Build" xml2 + set(XML2_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/xml2_ep-install") + set(XML2_INCLUDE_DIR "${XML2_PREFIX}/include") + + set(XML2_CMAKE_ARGS + ${EP_COMMON_CMAKE_ARGS} + "-DCMAKE_INSTALL_PREFIX=" + -DCMAKE_INSTALL_LIBDIR=lib + -DBUILD_TESTING=OFF + -DLIBXML2_WITH_ZLIB=OFF + -DLIBXML2_WITH_PYTHON=OFF + -DLIBXML2_WITH_LZMA=OFF + -DLIBXML2_WITH_ICONV=OFF + -DBUILD_SHARED_LIBS=OFF) + + set(_XML2_STATIC_LIBRARY + "${XML2_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}xml2${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + set(XML2_BUILD_BYPRODUCTS ${_XML2_STATIC_LIBRARY}) + + externalproject_add(xml2_ep + ${EP_LOG_OPTIONS} + INSTALL_DIR ${XML2_PREFIX} + URL ${XML2_SOURCE_URL} + URL_HASH "SHA256=${ARROW_XML2_BUILD_SHA256_CHECKSUM}" + CMAKE_ARGS ${XML2_CMAKE_ARGS} + BUILD_BYPRODUCTS ${XML2_BUILD_BYPRODUCTS}) + + # Work around https://gitlab.kitware.com/cmake/cmake/issues/15052 + file(MAKE_DIRECTORY "${XML2_INCLUDE_DIR}") + add_library(LibXml2::LibXml2 STATIC IMPORTED) + set_target_properties(LibXml2::LibXml2 + PROPERTIES IMPORTED_LOCATION ${_XML2_STATIC_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES + "${XML2_INCLUDE_DIR}") + add_dependencies(LibXml2::LibXml2 xml2_ep) + set(XML2_VENDORED TRUE) +endmacro() +if(ARROW_WITH_XML2) + resolve_dependency(xml2) + get_target_property(xml2_INCLUDE_DIR LibXml2::LibXml2 + INTERFACE_INCLUDE_DIRECTORIES) + message(STATUS "Found xml2 headers: ${xml2_INCLUDE_DIR}") +endif() + macro(build_azuresdk) message(STATUS "Building Azure C++ SDK from source") find_curl() - find_package(LibXml2 REQUIRED) + add_custom_target(azure_sdk_dependencies) + if(XML2_VENDORED) + add_dependencies(azure_sdk_dependencies xml2_ep) + endif() find_package(OpenSSL ${ARROW_OPENSSL_REQUIRED_VERSION} REQUIRED) set(AZURESDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-install") @@ -5106,7 +5148,7 @@ macro(build_azuresdk) set(AZURESDK_COMMON_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} - "-DCMAKE_INSTALL_PREFIX=${AZURESDK_PREFIX}" + "-DCMAKE_INSTALL_PREFIX=" "-DCMAKE_PREFIX_PATH=${AZURESDK_PREFIX}" -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=${AZURESDK_LIB_DIR} @@ -5117,123 +5159,86 @@ macro(build_azuresdk) -DWARNINGS_AS_ERRORS=OFF) file(MAKE_DIRECTORY ${AZURESDK_INCLUDE_DIR}) - set(AZURE_CORE_STATIC_LIBRARY "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-core${CMAKE_STATIC_LIBRARY_SUFFIX}" ) - externalproject_add(azure_core_ep - ${EP_LOG_OPTIONS} - INSTALL_DIR ${AZURESDK_PREFIX} - URL ${AZURE_CORE_SOURCE_URL} - URL_HASH "SHA256=${ARROW_AZURE_CORE_BUILD_SHA256_CHECKSUM}" - CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} - BUILD_BYPRODUCTS ${AZURE_CORE_STATIC_LIBRARY}) - add_library(Azure::azure-core STATIC IMPORTED) - set_target_properties(Azure::azure-core - PROPERTIES IMPORTED_LOCATION "${AZURE_CORE_STATIC_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES - "${AZURESDK_INCLUDE_DIR}") - target_link_libraries(Azure::azure-core INTERFACE CURL::libcurl LibXml2::LibXml2) - add_dependencies(Azure::azure-core azure_core_ep) - set(AZURE_IDENTITY_STATIC_LIBRARY "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-identity${CMAKE_STATIC_LIBRARY_SUFFIX}" ) - externalproject_add(azure_identity_ep - ${EP_LOG_OPTIONS} - INSTALL_DIR ${AZURESDK_PREFIX} - URL ${AZURE_IDENTITY_SOURCE_URL} - URL_HASH "SHA256=${ARROW_AZURE_IDENTITY_BUILD_SHA256_CHECKSUM}" - CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} - BUILD_BYPRODUCTS ${AZURE_IDENTITY_STATIC_LIBRARY}) - add_library(Azure::azure-identity STATIC IMPORTED) - set_target_properties(Azure::azure-identity - PROPERTIES IMPORTED_LOCATION "${AZURE_IDENTITY_STATIC_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES - "${AZURESDK_INCLUDE_DIR}") - target_link_libraries(Azure::azure-identity INTERFACE CURL::libcurl LibXml2::LibXml2) - add_dependencies(Azure::azure-identity azure_identity_ep) - set(AZURE_STORAGE_BLOBS_STATIC_LIBRARY "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-blobs${CMAKE_STATIC_LIBRARY_SUFFIX}" ) - externalproject_add(azure_storage_blobs_ep - ${EP_LOG_OPTIONS} - INSTALL_DIR ${AZURESDK_PREFIX} - URL ${AZURE_STORAGE_BLOBS_SOURCE_URL} - URL_HASH "SHA256=${ARROW_AZURE_STORAGE_BLOBS_BUILD_SHA256_CHECKSUM}" - CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} - BUILD_BYPRODUCTS ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY}) - add_library(Azure::azure-storage-blobs STATIC IMPORTED) - set_target_properties(Azure::azure-storage-blobs - PROPERTIES IMPORTED_LOCATION - "${AZURE_STORAGE_BLOBS_STATIC_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES - "${AZURESDK_INCLUDE_DIR}") - target_link_libraries(Azure::azure-storage-blobs - INTERFACE Azure::azure-core CURL::libcurl LibXml2::LibXml2) - add_dependencies(Azure::azure-storage-blobs azure_storage_blobs_ep) - set(AZURE_STORAGE_COMMON_STATIC_LIBRARY "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-common${CMAKE_STATIC_LIBRARY_SUFFIX}" ) - externalproject_add(azure_storage_common_ep - ${EP_LOG_OPTIONS} + set(AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY + "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-files-datalake${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + externalproject_add(azuresdk_ep + # ${EP_LOG_OPTIONS} INSTALL_DIR ${AZURESDK_PREFIX} - URL ${AZURE_STORAGE_COMMON_SOURCE_URL} - URL_HASH "SHA256=${ARROW_AZURE_STORAGE_COMMON_BUILD_SHA256_CHECKSUM}" + URL ${ARROW_AZURESDK_URL} + URL_HASH "SHA256=${ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM}" CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} - BUILD_BYPRODUCTS ${AZURE_STORAGE_COMMON_STATIC_LIBRARY}) + BUILD_BYPRODUCTS ${AZURE_CORE_STATIC_LIBRARY} + ${AZURE_IDENTITY_STATIC_LIBRARY} + ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} + ${AZURE_STORAGE_COMMON_STATIC_LIBRARY} + ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY} + DEPENDS azure_sdk_dependencies) + add_library(Azure::azure-core STATIC IMPORTED) + set_target_properties(Azure::azure-core + PROPERTIES IMPORTED_LOCATION ${AZURE_CORE_STATIC_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES + ${AZURESDK_INCLUDE_DIR}) + target_link_libraries(Azure::azure-core INTERFACE CURL::libcurl OpenSSL::Crypto OpenSSL::SSL) + add_dependencies(Azure::azure-core azuresdk_ep) + + add_library(Azure::azure-identity STATIC IMPORTED) + set_target_properties(Azure::azure-identity + PROPERTIES IMPORTED_LOCATION ${AZURE_IDENTITY_STATIC_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES + ${AZURESDK_INCLUDE_DIR}) + target_link_libraries(Azure::azure-identity INTERFACE OpenSSL::Crypto Azure::azure-core) + add_dependencies(Azure::azure-identity azuresdk_ep) + add_library(Azure::azure-storage-common STATIC IMPORTED) set_target_properties(Azure::azure-storage-common - PROPERTIES IMPORTED_LOCATION - "${AZURE_STORAGE_COMMON_STATIC_LIBRARY}" + PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_COMMON_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES - "${AZURESDK_INCLUDE_DIR}") - target_link_libraries(Azure::azure-storage-common INTERFACE CURL::libcurl - LibXml2::LibXml2) - add_dependencies(Azure::azure-storage-common azure_storage_common_ep) - set_property(TARGET Azure::azure-storage-common PROPERTY INTERFACE_LINK_LIBRARIES - OpenSSL::Crypto) + ${AZURESDK_INCLUDE_DIR}) + target_link_libraries(Azure::azure-storage-common INTERFACE OpenSSL::Crypto LibXml2::LibXml2 Azure::azure-core) + add_dependencies(Azure::azure-storage-common azuresdk_ep) + + add_library(Azure::azure-storage-blobs STATIC IMPORTED) + set_target_properties(Azure::azure-storage-blobs + PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES + ${AZURESDK_INCLUDE_DIR}) + target_link_libraries(Azure::azure-storage-blobs INTERFACE Azure::azure-core Azure::azure-storage-common) + add_dependencies(Azure::azure-storage-blobs azuresdk_ep) - set(AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY - "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-files-datalake${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - externalproject_add(azure_storage_files_datalake_ep - ${EP_LOG_OPTIONS} - INSTALL_DIR ${AZURESDK_PREFIX} - URL ${AZURE_STORAGE_FILES_DATALAKE_SOURCE_URL} - URL_HASH "SHA256=${ARROW_AZURE_STORAGE_FILES_DATALAKE_BUILD_SHA256_CHECKSUM}" - CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} - BUILD_BYPRODUCTS ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY}) add_library(Azure::azure-storage-files-datalake STATIC IMPORTED) - set_target_properties(Azure::azure-storage-files-datalake - PROPERTIES IMPORTED_LOCATION - "${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY}" + set_target_properties(Azure::azure-storage-files-datalake + PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES - "${AZURESDK_INCLUDE_DIR}") - target_link_libraries(Azure::azure-storage-files-datalake - INTERFACE Azure::azure-core - Azure::azure-identity - Azure::azure-storage-blobs - Azure::azure-storage-common - CURL::libcurl - LibXml2::LibXml2) - add_dependencies(Azure::azure-storage-files-datalake azure_storage_files_datalake_ep) + ${AZURESDK_INCLUDE_DIR}) + target_link_libraries(Azure::azure-storage-files-datalake INTERFACE Azure::azure-core Azure::azure-identity Azure::azure-storage-common Azure::azure-storage-blobs) + add_dependencies(Azure::azure-storage-files-datalake azuresdk_ep) set(AZURESDK_LIBRARIES) list(APPEND AZURESDK_LIBRARIES Azure::azure-core - Azure::azure-storage-blobs Azure::azure-identity + Azure::azure-storage-blobs Azure::azure-storage-common Azure::azure-storage-files-datalake) list(APPEND ARROW_BUNDLED_STATIC_LIBS Azure::azure-core - Azure::azure-storage-blobs Azure::azure-identity + Azure::azure-storage-blobs Azure::azure-storage-common Azure::azure-storage-files-datalake) diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index 06cf0964fe3c7..6836a84b4395d 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -53,16 +53,8 @@ ARROW_AWS_LC_BUILD_VERSION=v1.3.0 ARROW_AWS_LC_BUILD_SHA256_CHECKSUM=ae96a3567161552744fc0cae8b4d68ed88b1ec0f3d3c98700070115356da5a37 ARROW_AWSSDK_BUILD_VERSION=1.10.55 ARROW_AWSSDK_BUILD_SHA256_CHECKSUM=2d552fb1a84bef4a9b65e34aa7031851ed2aef5319e02cc6e4cb735c48aa30de -ARROW_AZURE_CORE_BUILD_VERSION=1.7.1 -ARROW_AZURE_CORE_BUILD_SHA256_CHECKSUM=ae6f03e65d9773d11cf3b9619d0bc7f567272974cf31b9e1c8ca2fa0ea4fb4c6 -ARROW_AZURE_IDENTITY_BUILD_VERSION=1.3.0 -ARROW_AZURE_IDENTITY_BUILD_SHA256_CHECKSUM=46701acd8000f317d1c4b33263d5d3203924fadcfa5af4860ae9187046a72c45 -ARROW_AZURE_STORAGE_BLOBS_BUILD_VERSION=12.5.0 -ARROW_AZURE_STORAGE_BLOBS_BUILD_SHA256_CHECKSUM=12394d864144ced9fc3562ad48cfe3426604e871b5aa72853ca398e086f0c594 -ARROW_AZURE_STORAGE_COMMON_BUILD_VERSION=12.2.4 -ARROW_AZURE_STORAGE_COMMON_BUILD_SHA256_CHECKSUM=7644b4355b492ba2039236b9fd56c3e7bb80aad983d8bac6a731d74aaf64e03f -ARROW_AZURE_STORAGE_FILES_DATALAKE_BUILD_VERSION=12.3.1 -ARROW_AZURE_STORAGE_FILES_DATALAKE_BUILD_SHA256_CHECKSUM=a5b74076a751d7cfaf7c56674a40ce2792c4fab9add18758fab1fe091d00baff +ARROW_AZURE_SDK_BUILD_VERSION=azure-core_1.10.0 +ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM=e6ae26ad30376bef6272024564764ba7bf5756063dc94cc4b74180cd004ab75e ARROW_BOOST_BUILD_VERSION=1.81.0 ARROW_BOOST_BUILD_SHA256_CHECKSUM=9e0ffae35528c35f90468997bc8d99500bf179cbae355415a89a600c38e13574 ARROW_BROTLI_BUILD_VERSION=v1.0.9 @@ -121,6 +113,8 @@ ARROW_UCX_BUILD_VERSION=1.12.1 ARROW_UCX_BUILD_SHA256_CHECKSUM=9bef31aed0e28bf1973d28d74d9ac4f8926c43ca3b7010bd22a084e164e31b71 ARROW_UTF8PROC_BUILD_VERSION=v2.7.0 ARROW_UTF8PROC_BUILD_SHA256_CHECKSUM=4bb121e297293c0fd55f08f83afab6d35d48f0af4ecc07523ad8ec99aa2b12a1 +ARROW_XML2_BUILD_VERSION=v2.11.4 +ARROW_XML2_BUILD_SHA256_CHECKSUM=2fd59eccfe277f7b7dec8836254acbebd24af33857a018dd64ddcf92d88d7f7e ARROW_XSIMD_BUILD_VERSION=9.0.1 ARROW_XSIMD_BUILD_SHA256_CHECKSUM=b1bb5f92167fd3a4f25749db0be7e61ed37e0a5d943490f3accdcd2cd2918cc0 ARROW_ZLIB_BUILD_VERSION=1.2.13 @@ -164,6 +158,7 @@ DEPENDENCIES=( "ARROW_LZ4_URL lz4-${ARROW_LZ4_BUILD_VERSION}.tar.gz https://github.com/lz4/lz4/archive/${ARROW_LZ4_BUILD_VERSION}.tar.gz" "ARROW_MIMALLOC_URL mimalloc-${ARROW_MIMALLOC_BUILD_VERSION}.tar.gz https://github.com/microsoft/mimalloc/archive/${ARROW_MIMALLOC_BUILD_VERSION}.tar.gz" "ARROW_NLOHMANN_JSON_URL nlohmann-json-${ARROW_NLOHMANN_JSON_BUILD_VERSION}.tar.gz https://github.com/nlohmann/json/archive/refs/tags/${ARROW_NLOHMANN_JSON_BUILD_VERSION}.tar.gz" + "ARROW_XML2_URL xml2-${ARROW_XML2_BUILD_VERSION}.tar.gz https://github.com/GNOME/libxml2/archive/refs/tags/${ARROW_XML2_BUILD_VERSION}.tar.gz" "ARROW_OPENTELEMETRY_URL opentelemetry-cpp-${ARROW_OPENTELEMETRY_BUILD_VERSION}.tar.gz https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/${ARROW_OPENTELEMETRY_BUILD_VERSION}.tar.gz" "ARROW_OPENTELEMETRY_PROTO_URL opentelemetry-proto-${ARROW_OPENTELEMETRY_PROTO_BUILD_VERSION}.tar.gz https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/${ARROW_OPENTELEMETRY_PROTO_BUILD_VERSION}.tar.gz" "ARROW_ORC_URL orc-${ARROW_ORC_BUILD_VERSION}.tar.gz https://archive.apache.org/dist/orc/orc-${ARROW_ORC_BUILD_VERSION}/orc-${ARROW_ORC_BUILD_VERSION}.tar.gz" From ad39f9d284cb349f23d816ee4afad078ff7541ab Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 10 Jul 2023 15:24:35 +0100 Subject: [PATCH 03/93] Azure SDK after managed identity fix --- cpp/thirdparty/versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index 6836a84b4395d..020ef9032aad7 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -53,8 +53,8 @@ ARROW_AWS_LC_BUILD_VERSION=v1.3.0 ARROW_AWS_LC_BUILD_SHA256_CHECKSUM=ae96a3567161552744fc0cae8b4d68ed88b1ec0f3d3c98700070115356da5a37 ARROW_AWSSDK_BUILD_VERSION=1.10.55 ARROW_AWSSDK_BUILD_SHA256_CHECKSUM=2d552fb1a84bef4a9b65e34aa7031851ed2aef5319e02cc6e4cb735c48aa30de -ARROW_AZURE_SDK_BUILD_VERSION=azure-core_1.10.0 -ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM=e6ae26ad30376bef6272024564764ba7bf5756063dc94cc4b74180cd004ab75e +ARROW_AZURE_SDK_BUILD_VERSION=azure-identity_1.5.1 +ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM=651a660592540c267420b7e1c8dc98428a17396e45f7f6c92a864ab9a4fa028a ARROW_BOOST_BUILD_VERSION=1.81.0 ARROW_BOOST_BUILD_SHA256_CHECKSUM=9e0ffae35528c35f90468997bc8d99500bf179cbae355415a89a600c38e13574 ARROW_BROTLI_BUILD_VERSION=v1.0.9 From 5f80cf535c42335f6e1d851698f2bc378049466c Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 22 Jul 2023 18:10:51 +0100 Subject: [PATCH 04/93] Start a minimal test that instantiates the container client --- cpp/src/arrow/filesystem/azurefs_test.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index e940c5bd1bc32..17b7e3462e516 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -45,12 +45,16 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" +#include +#include + namespace arrow { using internal::TemporaryDir; namespace fs { namespace { namespace bp = boost::process; +namespace bp = boost::process; using ::testing::IsEmpty; using ::testing::Not; using ::testing::NotNull; @@ -105,15 +109,18 @@ AzuriteEnv* GetAzuriteEnv() { return ::arrow::internal::checked_cast(azurite_env); } -// Placeholder tests for file structure +// Placeholder test for file structure // TODO: GH-18014 Remove once a proper test is added -TEST(AzureFileSystem, InitialiseAzurite) { +TEST(AzureBlobFileSystem, InitialiseClient) { const std::string& account_name = GetAzuriteEnv()->account_name(); const std::string& account_key = GetAzuriteEnv()->account_key(); - EXPECT_EQ(account_name, "devstoreaccount1"); - EXPECT_EQ(account_key, - "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/" - "K1SZFPTOtr/KBHBeksoGMGw=="); + + auto credential = std::make_shared( + account_name, account_key); + auto blockBlobClient = Azure::Storage::Blobs::BlockBlobClient( + "https://wayvedevdataset.blob.core.windows.net/databricks/" + "part-00000-540fd04c-424d-482e-b347-b0a200d36e59.c000.snappy.parquet", + credential); } TEST(AzureFileSystem, OptionsCompare) { From 141561e48c7b5fc8b051786c82927ddd03993a30 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 22 Jul 2023 22:06:15 +0100 Subject: [PATCH 05/93] Try setting openssl to link against more explicitly --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index bed7327bb8e11..cdb4dc49777d3 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5144,7 +5144,19 @@ macro(build_azuresdk) set(AZURESDK_LIB_DIR "lib") # provide hint for Azure SDK to link with the already located openssl - get_filename_component(OPENSSL_ROOT_HINT "${OPENSSL_INCLUDE_DIR}" DIRECTORY) + # get_filename_component(OPENSSL_ROOT_HINT "${OPENSSL_INCLUDE_DIR}" DIRECTORY) + + # -DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} + # -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} + # -DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} + # -Dcrypto_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} + # -Dcrypto_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) + # if(ARROW_OPENSSL_USE_SHARED) + # list(APPEND AWSSDK_COMMON_CMAKE_ARGS + # -Dcrypto_SHARED_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) + # else() + # list(APPEND AWSSDK_COMMON_CMAKE_ARGS + # -Dcrypto_STATIC_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) set(AZURESDK_COMMON_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} @@ -5155,7 +5167,11 @@ macro(build_azuresdk) -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON -DENABLE_TESTING=OFF -DENABLE_UNITY_BUILD=ON - -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_HINT} + -DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} + -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} + -DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} + -Dcrypto_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} + -Dcrypto_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} -DWARNINGS_AS_ERRORS=OFF) file(MAKE_DIRECTORY ${AZURESDK_INCLUDE_DIR}) From 97eb20894ab587e2f875b40c51eb591e5fcaef69 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 17 Jun 2023 18:14:30 +0100 Subject: [PATCH 06/93] Build Azure SDK more like GCP SDK --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index cdb4dc49777d3..26e23c9644a86 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5134,10 +5134,15 @@ macro(build_azuresdk) find_curl() add_custom_target(azure_sdk_dependencies) + + if(NOT OpenSSL_FOUND) + resolve_dependency(OpenSSL HAVE_ALT REQUIRED_VERSION + ${ARROW_OPENSSL_REQUIRED_VERSION}) + endif() + if(XML2_VENDORED) add_dependencies(azure_sdk_dependencies xml2_ep) endif() - find_package(OpenSSL ${ARROW_OPENSSL_REQUIRED_VERSION} REQUIRED) set(AZURESDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-install") set(AZURESDK_INCLUDE_DIR "${AZURESDK_PREFIX}/include") @@ -5242,6 +5247,7 @@ macro(build_azuresdk) target_link_libraries(Azure::azure-storage-files-datalake INTERFACE Azure::azure-core Azure::azure-identity Azure::azure-storage-common Azure::azure-storage-blobs) add_dependencies(Azure::azure-storage-files-datalake azuresdk_ep) + set(AZURE_SDK_VENDORED TRUE) set(AZURESDK_LIBRARIES) list(APPEND AZURESDK_LIBRARIES @@ -5262,7 +5268,8 @@ macro(build_azuresdk) endmacro() if(ARROW_AZURE) - build_azuresdk() + resolve_dependency(AZURE_SDK) + message(STATUS "Found Azure SDK headers: ${AZURESDK_INCLUDE_DIR}") message(STATUS "Found Azure SDK libraries: ${AZURESDK_LINK_LIBRARIES}") endif() From 33b0a419470391c9d98defe66a7c77515ee9671f Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 17 Jun 2023 16:19:15 +0100 Subject: [PATCH 07/93] Debugging --- cpp/build-support/ssl.patch | 16 ++++++++++++++++ cpp/cmake_modules/ThirdpartyToolchain.cmake | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 cpp/build-support/ssl.patch diff --git a/cpp/build-support/ssl.patch b/cpp/build-support/ssl.patch new file mode 100644 index 0000000000000..45d96e4bf831e --- /dev/null +++ b/cpp/build-support/ssl.patch @@ -0,0 +1,16 @@ +diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp +index 80309f89..b34c9b77 100644 +--- a/sdk/core/azure-core/src/http/curl/curl.cpp ++++ b/sdk/core/azure-core/src/http/curl/curl.cpp +@@ -39,11 +39,7 @@ + + #if defined(AZ_PLATFORM_POSIX) + #include +-#if OPENSSL_VERSION_NUMBER < 0x30000000L + #define USE_OPENSSL_1 +-#else +-#define USE_OPENSSL_3 +-#endif // OPENSSL_VERSION_NUMBER < 0x30000000L + + #include + #include diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 26e23c9644a86..f33397db96d08 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5163,6 +5163,14 @@ macro(build_azuresdk) # list(APPEND AWSSDK_COMMON_CMAKE_ARGS # -Dcrypto_STATIC_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) + set(AZURE_SDK_PATCH_COMMAND) + find_package(Patch) + if(Patch_FOUND) + set(AZURE_SDK_PATCH_COMMAND + ${Patch_EXECUTABLE} "/sdk/core/azure-core/src/http/curl/curl.cpp" + "${CMAKE_SOURCE_DIR}/build-support/ssl.patch") + endif() + set(AZURESDK_COMMON_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=" @@ -5201,6 +5209,7 @@ macro(build_azuresdk) URL ${ARROW_AZURESDK_URL} URL_HASH "SHA256=${ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM}" CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} + PATCH_COMMAND ${AZURE_SDK_PATCH_COMMAND} BUILD_BYPRODUCTS ${AZURE_CORE_STATIC_LIBRARY} ${AZURE_IDENTITY_STATIC_LIBRARY} ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} From 1b1dfef90970496dc2c87c226c79d028a51f705c Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 17 Jun 2023 17:10:41 +0100 Subject: [PATCH 08/93] Support openssl 1 --- .../openssl/install-pc-files.cmake | 32 ++ .../vcpkg-custom-ports/openssl/openssl.pc.in | 6 + .../vcpkg-custom-ports/openssl/portfile.cmake | 28 ++ .../openssl/unix/CMakeLists.txt | 284 ++++++++++++++++++ .../openssl/unix/portfile.cmake | 38 +++ .../openssl/unix/remove-deps.cmake | 7 + cpp/azure/vcpkg-custom-ports/openssl/usage | 4 + .../openssl/uwp/EnableUWPSupport.patch | 170 +++++++++++ .../openssl/uwp/make-openssl.bat | 16 + .../openssl/uwp/portfile.cmake | 163 ++++++++++ .../openssl/vcpkg-cmake-wrapper.cmake.in | 78 +++++ .../vcpkg-custom-ports/openssl/vcpkg.json | 18 ++ .../openssl/windows/portfile.cmake | 172 +++++++++++ cpp/azure/vcpkg.json | 11 + cpp/cmake_modules/ThirdpartyToolchain.cmake | 13 +- 15 files changed, 1035 insertions(+), 5 deletions(-) create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/install-pc-files.cmake create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/openssl.pc.in create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/portfile.cmake create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/unix/CMakeLists.txt create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/unix/portfile.cmake create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/unix/remove-deps.cmake create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/usage create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/uwp/EnableUWPSupport.patch create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/uwp/make-openssl.bat create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/uwp/portfile.cmake create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/vcpkg-cmake-wrapper.cmake.in create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/vcpkg.json create mode 100644 cpp/azure/vcpkg-custom-ports/openssl/windows/portfile.cmake create mode 100644 cpp/azure/vcpkg.json diff --git a/cpp/azure/vcpkg-custom-ports/openssl/install-pc-files.cmake b/cpp/azure/vcpkg-custom-ports/openssl/install-pc-files.cmake new file mode 100644 index 0000000000000..eb8d2b8c28847 --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/install-pc-files.cmake @@ -0,0 +1,32 @@ +function(install_pc_file name pc_data) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${name}.pc" @ONLY) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${name}.pc" @ONLY) + endif() +endfunction() + +install_pc_file(openssl [[ +Name: OpenSSL +Description: Secure Sockets Layer and cryptography libraries and tools +Requires: libssl libcrypto +]]) + +install_pc_file(libssl [[ +Name: OpenSSL-libssl +Description: Secure Sockets Layer and cryptography libraries +Libs: -L"${libdir}" -llibssl +Requires: libcrypto +Cflags: -I"${includedir}" +]]) + +install_pc_file(libcrypto [[ +Name: OpenSSL-libcrypto +Description: OpenSSL cryptography library +Libs: -L"${libdir}" -llibcrypto +Libs.private: -lcrypt32 -lws2_32 +Cflags: -I"${includedir}" +]]) + +vcpkg_fixup_pkgconfig() diff --git a/cpp/azure/vcpkg-custom-ports/openssl/openssl.pc.in b/cpp/azure/vcpkg-custom-ports/openssl/openssl.pc.in new file mode 100644 index 0000000000000..3033e1804da0f --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/openssl.pc.in @@ -0,0 +1,6 @@ +prefix=${pcfiledir}/../.. +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include +Version: @OPENSSL_VERSION@ +@pc_data@ diff --git a/cpp/azure/vcpkg-custom-ports/openssl/portfile.cmake b/cpp/azure/vcpkg-custom-ports/openssl/portfile.cmake new file mode 100644 index 0000000000000..e94e7a83f02d3 --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/portfile.cmake @@ -0,0 +1,28 @@ +if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") + message(FATAL_ERROR "Can't build openssl if libressl/boringssl is installed. Please remove libressl/boringssl, and try install openssl again if you need it.") +endif() + +set(OPENSSL_VERSION 1.1.1n) +vcpkg_download_distfile( + ARCHIVE + URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz" + FILENAME "openssl-${OPENSSL_VERSION}.tar.gz" + SHA512 1937796736613dcf4105a54e42ecb61f95a1cea74677156f9459aea0f2c95159359e766089632bf364ee6b0d28d661eb9957bce8fecc9d2436378d8d79e8d0a4 +) + +vcpkg_find_acquire_program(PERL) +get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) +vcpkg_add_to_path("${PERL_EXE_PATH}") + +if(VCPKG_TARGET_IS_UWP) + include("${CMAKE_CURRENT_LIST_DIR}/uwp/portfile.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake") +elseif(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + include("${CMAKE_CURRENT_LIST_DIR}/windows/portfile.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake") +else() + include("${CMAKE_CURRENT_LIST_DIR}/unix/portfile.cmake") +endif() + +configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/cpp/azure/vcpkg-custom-ports/openssl/unix/CMakeLists.txt b/cpp/azure/vcpkg-custom-ports/openssl/unix/CMakeLists.txt new file mode 100644 index 0000000000000..52bfcfff3c5e0 --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/unix/CMakeLists.txt @@ -0,0 +1,284 @@ +cmake_minimum_required(VERSION 3.9) +project(openssl C) + +if(NOT SOURCE_PATH) + message(FATAL_ERROR "Requires SOURCE_PATH") +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "Android" OR CMAKE_SYSTEM_NAME STREQUAL "Linux") + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(PLATFORM linux-x86_64) + else() + set(PLATFORM linux-generic32) + endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") + if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") + set(PLATFORM ios64-xcrun) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm") + set(PLATFORM ios-xcrun) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" OR + VCPKG_TARGET_ARCHITECTURE MATCHES "x64") + set(PLATFORM iossimulator-xcrun) + else() + message(FATAL_ERROR "Unknown iOS target architecture: ${VCPKG_TARGET_ARCHITECTURE}") + endif() + # disable that makes linkage error (e.g. require stderr usage) + list(APPEND DISABLES no-stdio no-ui no-asm) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") + set(PLATFORM darwin64-arm64-cc) + else() + set(PLATFORM darwin64-x86_64-cc) + endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + set(PLATFORM BSD-generic64) +elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + set(PLATFORM BSD-generic64) +elseif(MINGW) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(PLATFORM mingw64) + else() + set(PLATFORM mingw) + endif() +elseif(EMSCRIPTEN) + set(MAKE $ENV{EMSDK}/upstream/emscripten/emmake) + set(ENV{MAKE} $ENV{EMSDK}/upstream/emscripten/emmake) +else() + message(FATAL_ERROR "Unknown platform") +endif() + +get_filename_component(COMPILER_ROOT "${CMAKE_C_COMPILER}" DIRECTORY) + +message("CMAKE_C_COMPILER=${CMAKE_C_COMPILER}") +message("COMPILER_ROOT=${COMPILER_ROOT}") +message("CMAKE_SYSROOT=${CMAKE_SYSROOT}") +message("CMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}") +message("CMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}") +message("CMAKE_C_FLAGS=${CMAKE_C_FLAGS}") +message("CMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}") +message("CMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}") +message("CMAKE_INCLUDE_SYSTEM_FLAG_C=${CMAKE_INCLUDE_SYSTEM_FLAG_C}") +message("CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG=${CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG}") + +string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE) +set(CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BUILD_TYPE}}") +if(CMAKE_C_COMPILER_ID STREQUAL "Clang") + set(CFLAGS "${CFLAGS} -Wno-error=unused-command-line-argument") +endif() +if(CMAKE_C_COMPILER_TARGET AND CMAKE_C_COMPILE_OPTIONS_TARGET) + set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}") +endif() +if(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN AND CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN) + set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN}") +endif() +if(CMAKE_SYSROOT AND CMAKE_C_COMPILE_OPTIONS_SYSROOT) + set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}") +elseif(CMAKE_OSX_SYSROOT AND CMAKE_C_COMPILE_OPTIONS_SYSROOT) + set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_OSX_SYSROOT}") +endif() +if (CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG) + set(CFLAGS "${CFLAGS} ${CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG}${CMAKE_OSX_DEPLOYMENT_TARGET}") +elseif((CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND (VCPKG_TARGET_ARCHITECTURE MATCHES "arm64")) + set(CFLAGS "${CFLAGS} -mmacosx-version-min=11.0") +endif() + +string(REGEX REPLACE "^ " "" CFLAGS "${CFLAGS}") + +if(CMAKE_HOST_WIN32) + file(TO_NATIVE_PATH ENV_PATH "${COMPILER_ROOT};$ENV{PATH}") +else() + file(TO_NATIVE_PATH ENV_PATH "${COMPILER_ROOT}:$ENV{PATH}") +endif() +set(ENV{ANDROID_DEV} "${CMAKE_SYSROOT}/usr") + +if(NOT IOS) + set(ENV{CC} "${CMAKE_C_COMPILER}") +endif() + +message("ENV{ANDROID_DEV}=$ENV{ANDROID_DEV}") + +get_filename_component(SOURCE_PATH_NAME "${SOURCE_PATH}" NAME) +set(BUILDDIR "${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_PATH_NAME}") + +if(NOT EXISTS "${BUILDDIR}") + file(COPY ${SOURCE_PATH} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +endif() + +get_filename_component(MSYS_BIN_DIR "${MAKE}" DIRECTORY) + +if(BUILD_SHARED_LIBS) + set(SHARED shared) + file(STRINGS "${BUILDDIR}/include/openssl/opensslv.h" SHLIB_VERSION + REGEX "^#[\t ]*define[\t ]+SHLIB_VERSION_NUMBER[\t ]+\".*\".*") + string(REGEX REPLACE "^.*SHLIB_VERSION_NUMBER[\t ]+\"([^\"]*)\".*$" "\\1" + SHLIB_VERSION "${SHLIB_VERSION}") + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(LIB_EXT dylib) + set(LIB_EXTS ${SHLIB_VERSION}.${LIB_EXT}) + elseif(MINGW) + string(REPLACE "." "_" SHLIB_VERSION "${SHLIB_VERSION}") + set(BIN_EXT dll) + set(LIB_EXT dll.a) + else() + set(LIB_EXT so) + set(LIB_EXTS ${LIB_EXT}.${SHLIB_VERSION}) + endif() + list(APPEND BIN_EXTS ${BIN_EXT}) + list(APPEND LIB_EXTS ${LIB_EXT}) +else() + set(SHARED no-shared) + set(LIB_EXTS a) +endif() +set(INSTALL_PKG_CONFIGS "${BUILDDIR}/openssl.pc") +foreach(lib ssl crypto) + foreach(ext ${LIB_EXTS}) + list(APPEND INSTALL_LIBS "${BUILDDIR}/lib${lib}.${ext}") + list(APPEND INSTALL_PKG_CONFIGS "${BUILDDIR}/lib${lib}.pc") + endforeach() + foreach(ext ${BIN_EXTS}) + # This might be wrong for targets which don't follow this naming scheme, but I'm not aware of any + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}-x64.${ext}") + else() + list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}.${ext}") + endif() + endforeach() +endforeach() + +if(CMAKE_HOST_WIN32) + set(ENV_COMMAND set) + set(PATH_VAR ";%PATH%") +else() + set(ENV_COMMAND export) + set(PATH_VAR ":$ENV{PATH}") +endif() + +add_custom_command( + OUTPUT "${BUILDDIR}/Makefile" + COMMAND ${ENV_COMMAND} "PATH=${MSYS_BIN_DIR}${PATH_VAR}" + VERBATIM + WORKING_DIRECTORY "${BUILDDIR}" +) + +if(NOT IOS) + add_custom_command( + OUTPUT "${BUILDDIR}/Makefile" + COMMAND ${ENV_COMMAND} CC=${CMAKE_C_COMPILER} + COMMAND ${ENV_COMMAND} AR=${CMAKE_AR} + COMMAND ${ENV_COMMAND} LD=${CMAKE_LINKER} + COMMAND ${ENV_COMMAND} RANLIB=${CMAKE_RANLIB} + COMMAND ${ENV_COMMAND} MAKE=${MAKE} + COMMAND ${ENV_COMMAND} MAKEDEPPROG=${CMAKE_C_COMPILER} + COMMAND ${ENV_COMMAND} WINDRES=${CMAKE_RC_COMPILER} + VERBATIM + APPEND + ) + if(EMSCRIPTEN) + list(APPEND DISABLES + threads + no-engine + no-dso + no-asm + no-shared + no-sse2 + no-srtp + ) + else() + list(APPEND DISABLES + enable-static-engine + no-zlib + no-ssl2 + no-idea + no-cast + no-seed + no-md2 + no-tests) + endif() +endif() + +if(EMSCRIPTEN) + add_custom_command( + OUTPUT "${BUILDDIR}/Makefile" + COMMAND "$ENV{EMSDK}/upstream/emscripten/emconfigure" ./config + ${SHARED} + ${DISABLES} + "--prefix=${CMAKE_INSTALL_PREFIX}" + "--openssldir=/etc/ssl" + "--cross-compile-prefix=\"/\"" + VERBATIM + APPEND + ) + + add_custom_target(build_libs ALL + COMMAND ${ENV_COMMAND} "PATH=${MSYS_BIN_DIR}${PATH_VAR}" + COMMAND "${CMAKE_COMMAND}" -E touch "${BUILDDIR}/krb5.h" + COMMAND "${MAKE}" make build_libs + VERBATIM + WORKING_DIRECTORY "${BUILDDIR}" + DEPENDS "${BUILDDIR}/Makefile" + BYPRODUCTS ${INSTALL_LIBS} + ) +else() + add_custom_command( + OUTPUT "${BUILDDIR}/Makefile" + COMMAND "${PERL}" Configure + ${SHARED} + ${DISABLES} + ${PLATFORM} + "--prefix=${CMAKE_INSTALL_PREFIX}" + "--openssldir=/etc/ssl" + ${CFLAGS} + VERBATIM + APPEND + ) + + add_custom_target(build_libs ALL + COMMAND ${ENV_COMMAND} "PATH=${MSYS_BIN_DIR}${PATH_VAR}" + COMMAND "${CMAKE_COMMAND}" -E touch "${BUILDDIR}/krb5.h" + COMMAND "${MAKE}" -j ${VCPKG_CONCURRENCY} build_libs + VERBATIM + WORKING_DIRECTORY "${BUILDDIR}" + DEPENDS "${BUILDDIR}/Makefile" + BYPRODUCTS ${INSTALL_LIBS} + ) +endif() + +add_custom_command( + OUTPUT "${BUILDDIR}/Makefile" + COMMAND "${CMAKE_COMMAND}" "-DDIR=${BUILDDIR}" -P "${CMAKE_CURRENT_LIST_DIR}/remove-deps.cmake" + VERBATIM + APPEND +) + +if((CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS") AND BUILD_SHARED_LIBS) + if(DEFINED CMAKE_INSTALL_NAME_DIR) + set(ID_PREFIX "${CMAKE_INSTALL_NAME_DIR}") + else() + set(ID_PREFIX "@rpath") + endif() + + add_custom_command( + TARGET build_libs + COMMAND /usr/bin/install_name_tool -id "${ID_PREFIX}/libssl.${SHLIB_VERSION}.dylib" + "${BUILDDIR}/libssl.${SHLIB_VERSION}.dylib" + COMMAND /usr/bin/install_name_tool -id "${ID_PREFIX}/libcrypto.${SHLIB_VERSION}.dylib" + "${BUILDDIR}/libcrypto.1.1.dylib" + COMMAND /usr/bin/install_name_tool -change "${CMAKE_INSTALL_PREFIX}/lib/libcrypto.${SHLIB_VERSION}.dylib" + "${ID_PREFIX}/libcrypto.${SHLIB_VERSION}.dylib" + "${BUILDDIR}/libssl.${SHLIB_VERSION}.dylib" + VERBATIM + ) +endif() + +install( + FILES ${INSTALL_LIBS} + DESTINATION lib +) +install( + FILES ${INSTALL_BINS} + DESTINATION bin +) +install( + FILES ${INSTALL_PKG_CONFIGS} + DESTINATION lib/pkgconfig +) diff --git a/cpp/azure/vcpkg-custom-ports/openssl/unix/portfile.cmake b/cpp/azure/vcpkg-custom-ports/openssl/unix/portfile.cmake new file mode 100644 index 0000000000000..7a04ae7c9dc3d --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/unix/portfile.cmake @@ -0,0 +1,38 @@ +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH MASTER_COPY_SOURCE_PATH + ARCHIVE "${ARCHIVE}" + REF ${OPENSSL_VERSION} +) + +if(CMAKE_HOST_WIN32) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES make perl) + set(MAKE ${MSYS_ROOT}/usr/bin/make.exe) + set(PERL ${MSYS_ROOT}/usr/bin/perl.exe) +else() + find_program(MAKE make) + if(NOT MAKE) + message(FATAL_ERROR "Could not find make. Please install it through your package manager.") + endif() +endif() + +vcpkg_cmake_configure( + SOURCE_PATH ${CMAKE_CURRENT_LIST_DIR} + OPTIONS + -DSOURCE_PATH=${MASTER_COPY_SOURCE_PATH} + -DPERL=${PERL} + -DMAKE=${MAKE} + -DVCPKG_CONCURRENCY=${VCPKG_CONCURRENCY} +) + +vcpkg_cmake_install() +vcpkg_fixup_pkgconfig() + +file(GLOB HEADERS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/include/openssl/*.h) +set(RESOLVED_HEADERS) +foreach(HEADER ${HEADERS}) + get_filename_component(X "${HEADER}" REALPATH) + list(APPEND RESOLVED_HEADERS "${X}") +endforeach() + +file(INSTALL ${RESOLVED_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include/openssl) +file(INSTALL ${MASTER_COPY_SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/cpp/azure/vcpkg-custom-ports/openssl/unix/remove-deps.cmake b/cpp/azure/vcpkg-custom-ports/openssl/unix/remove-deps.cmake new file mode 100644 index 0000000000000..a57c70fe91e94 --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/unix/remove-deps.cmake @@ -0,0 +1,7 @@ +file(GLOB_RECURSE MAKEFILES ${DIR}/*/Makefile) +foreach(MAKEFILE ${MAKEFILES}) + message("removing deps from ${MAKEFILE}") + file(READ "${MAKEFILE}" _contents) + string(REGEX REPLACE "\n# DO NOT DELETE THIS LINE.*" "" _contents "${_contents}") + file(WRITE "${MAKEFILE}" "${_contents}") +endforeach() diff --git a/cpp/azure/vcpkg-custom-ports/openssl/usage b/cpp/azure/vcpkg-custom-ports/openssl/usage new file mode 100644 index 0000000000000..f535cb6a401cc --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/usage @@ -0,0 +1,4 @@ +The package openssl is compatible with built-in CMake targets: + + find_package(OpenSSL REQUIRED) + target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto) diff --git a/cpp/azure/vcpkg-custom-ports/openssl/uwp/EnableUWPSupport.patch b/cpp/azure/vcpkg-custom-ports/openssl/uwp/EnableUWPSupport.patch new file mode 100644 index 0000000000000..fe7837445985c --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/uwp/EnableUWPSupport.patch @@ -0,0 +1,170 @@ +diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf +index 3c4299d264..99fcb1f713 100644 +--- a/Configurations/10-main.conf ++++ b/Configurations/10-main.conf +@@ -1287,7 +1287,7 @@ my %targets = ( + }, + "VC-WIN64I" => { + inherit_from => [ "VC-WIN64-common", asm("ia64_asm"), +- sub { $disabled{shared} ? () : "ia64_uplink" } ], ++ sub { $disabled{uplink} ? () : "ia64_uplink" } ], + AS => "ias", + ASFLAGS => "-d debug", + asoutflag => "-o ", +@@ -1299,7 +1299,7 @@ my %targets = ( + }, + "VC-WIN64A" => { + inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"), +- sub { $disabled{shared} ? () : "x86_64_uplink" } ], ++ sub { $disabled{uplink} ? () : "x86_64_uplink" } ], + AS => sub { vc_win64a_info()->{AS} }, + ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} }, + asoutflag => sub { vc_win64a_info()->{asoutflag} }, +@@ -1312,7 +1312,7 @@ my %targets = ( + }, + "VC-WIN32" => { + inherit_from => [ "VC-noCE-common", asm("x86_asm"), +- sub { $disabled{shared} ? () : "uplink_common" } ], ++ sub { $disabled{uplink} ? () : "uplink_common" } ], + AS => sub { vc_win32_info()->{AS} }, + ASFLAGS => sub { vc_win32_info()->{ASFLAGS} }, + asoutflag => sub { vc_win32_info()->{asoutflag} }, +@@ -1374,7 +1374,7 @@ my %targets = ( + #### MinGW + "mingw" => { + inherit_from => [ "BASE_unix", asm("x86_asm"), +- sub { $disabled{shared} ? () : "x86_uplink" } ], ++ sub { $disabled{uplink} ? () : "x86_uplink" } ], + CC => "gcc", + CFLAGS => picker(default => "-Wall", + debug => "-g -O0", +diff --git a/Configurations/50-win-onecore.conf b/Configurations/50-win-onecore.conf +index d478f42b0f..e0fb70daca 100644 +--- a/Configurations/50-win-onecore.conf ++++ b/Configurations/50-win-onecore.conf +@@ -1,3 +1,4 @@ ++## -*- mode: perl; -*- + # Windows OneCore targets. + # + # OneCore is new API stability "contract" that transcends Desktop, IoT and +@@ -10,6 +11,25 @@ + # TODO: extend error handling to use ETW based eventing + # (Or rework whole error messaging) + ++my $UWP_info = {}; ++sub UWP_info { ++ unless (%$UWP_info) { ++ my $SDKver = `pwsh.exe -Command \"& {\$(Get-Item \\\"hklm:\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\\").GetValue(\\\"CurrentVersion\\\")}\"`; ++ $SDKver =~ s|\R$||; ++ my @SDKver_split = split(/\./, $SDKver); ++ # SDK version older than 10.0.17763 don't support our ASM builds ++ if ($SDKver_split[0] < 10 ++ || ($SDKver_split[0] == 10 ++ && $SDKver_split[1] == 0 ++ && $SDKver_split[2] < 17763)) { ++ $UWP_info->{disable} = [ 'asm' ]; ++ } else { ++ $UWP_info->{disable} = [ ]; ++ } ++ } ++ return $UWP_info; ++} ++ + my %targets = ( + "VC-WIN32-ONECORE" => { + inherit_from => [ "VC-WIN32" ], +@@ -61,4 +81,57 @@ my %targets = ( + ex_libs => "onecore.lib", + multilib => "-arm64", + }, ++ ++ # Universal Windows Platform (UWP) App Support ++ ++ # TODO ++ # ++ # The 'disable' attribute should have 'uplink'. ++ # however, these are checked in some 'inherit_from', which is processed ++ # very early, before the 'disable' attributes are seen. ++ # This is a problem that needs to be resolved in Configure first. ++ # ++ # But if you want to build library with Windows 10 Version 1809 SDK or ++ # earlier, the 'disable' attribute should also have 'asm'. ++ ++ "VC-WIN32-UWP" => { ++ inherit_from => [ "VC-WIN32-ONECORE" ], ++ lflags => add("/APPCONTAINER"), ++ defines => add("WINAPI_FAMILY=WINAPI_FAMILY_APP", ++ "_WIN32_WINNT=0x0A00"), ++ dso_scheme => "", ++ disable => sub { [ 'ui-console', 'stdio', 'async', 'uplink', ++ @{ UWP_info()->{disable} } ] }, ++ ex_libs => "WindowsApp.lib", ++ }, ++ "VC-WIN64A-UWP" => { ++ inherit_from => [ "VC-WIN64A-ONECORE" ], ++ lflags => add("/APPCONTAINER"), ++ defines => add("WINAPI_FAMILY=WINAPI_FAMILY_APP", ++ "_WIN32_WINNT=0x0A00"), ++ dso_scheme => "", ++ disable => sub { [ 'ui-console', 'stdio', 'async', 'uplink', ++ @{ UWP_info()->{disable} } ] }, ++ ex_libs => "WindowsApp.lib", ++ }, ++ "VC-WIN32-ARM-UWP" => { ++ inherit_from => [ "VC-WIN32-ARM" ], ++ lflags => add("/APPCONTAINER"), ++ defines => add("WINAPI_FAMILY=WINAPI_FAMILY_APP", ++ "_WIN32_WINNT=0x0A00"), ++ dso_scheme => "", ++ disable => sub { [ 'ui-console', 'stdio', 'async', 'uplink', ++ @{ UWP_info()->{disable} } ] }, ++ ex_libs => "WindowsApp.lib", ++ }, ++ "VC-WIN64-ARM-UWP" => { ++ inherit_from => [ "VC-WIN64-ARM" ], ++ lflags => add("/APPCONTAINER"), ++ defines => add("WINAPI_FAMILY=WINAPI_FAMILY_APP", ++ "_WIN32_WINNT=0x0A00"), ++ dso_scheme => "", ++ disable => sub { [ 'ui-console', 'stdio', 'async', 'uplink', ++ @{ UWP_info()->{disable} } ] }, ++ ex_libs => "WindowsApp.lib", ++ }, + ); +diff --git a/Configure b/Configure +index 5a699836f3..de45f1e299 100755 +--- a/Configure ++++ b/Configure +@@ -407,6 +408,7 @@ my @disablables = ( + "ubsan", + "ui-console", + "unit-test", ++ "uplink", + "whirlpool", + "weak-ssl-ciphers", + "zlib", +@@ -491,8 +493,8 @@ my @disable_cascades = ( + + # Without position independent code, there can be no shared libraries or DSOs + "pic" => [ "shared" ], +- "shared" => [ "dynamic-engine" ], ++ "shared" => [ "dynamic-engine", "uplink" ], + "dso" => [ "dynamic-engine" ], + "engine" => [ "afalgeng", "devcryptoeng" ], + + # no-autoalginit is only useful when building non-shared +diff --git a/INSTALL b/INSTALL +index 2119cbae9e..ee54e8c215 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -560,6 +560,10 @@ + likely to complement configuration command line with + suitable compiler-specific option. + ++ no-uplink ++ Don't build support for UPLINK interface. ++ ++ + no- + Don't build support for negotiating the specified SSL/TLS + protocol (one of ssl, ssl3, tls, tls1, tls1_1, tls1_2, diff --git a/cpp/azure/vcpkg-custom-ports/openssl/uwp/make-openssl.bat b/cpp/azure/vcpkg-custom-ports/openssl/uwp/make-openssl.bat new file mode 100644 index 0000000000000..6f6166a24e980 --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/uwp/make-openssl.bat @@ -0,0 +1,16 @@ +set build=%1 + +perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL -FS -FIWindows.h + +for /D %%f in ("%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.FoundationContract\*") do set LibPath=%LibPath%;%%f\ +for /D %%f in ("%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.UniversalApiContract\*") do set LibPath=%LibPath%;%%f\ +for /D %%f in ("%WindowsSdkDir%References\Windows.Foundation.FoundationContract\*") do set LibPath=%LibPath%;%%f\ +for /D %%f in ("%WindowsSdkDir%References\Windows.Foundation.UniversalApiContract\*") do set LibPath=%LibPath%;%%f\ + +call ms\do_winuniversal.bat + +mkdir inc32\openssl + +jom -j %NUMBER_OF_PROCESSORS% -k -f ms\ntdll.mak +REM due to a race condition in the build, we need to have a second single-threaded pass. +nmake -f ms\ntdll.mak diff --git a/cpp/azure/vcpkg-custom-ports/openssl/uwp/portfile.cmake b/cpp/azure/vcpkg-custom-ports/openssl/uwp/portfile.cmake new file mode 100644 index 0000000000000..9414634fe2057 --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/uwp/portfile.cmake @@ -0,0 +1,163 @@ +vcpkg_find_acquire_program(JOM) +get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) +vcpkg_add_to_path("${PERL_EXE_PATH}") + +set(OPENSSL_SHARED no-shared) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(OPENSSL_SHARED shared) +endif() + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES + uwp/EnableUWPSupport.patch +) + +vcpkg_find_acquire_program(NASM) +get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) +vcpkg_add_to_path(PREPEND "${NASM_EXE_PATH}") + +set(CONFIGURE_COMMAND ${PERL} Configure + enable-static-engine + enable-capieng + no-unit-test + no-ssl2 + no-asm + no-uplink + no-tests + -utf-8 + ${OPENSSL_SHARED} +) + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(OPENSSL_ARCH VC-WIN32-UWP) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(OPENSSL_ARCH VC-WIN64A-UWP) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(OPENSSL_ARCH VC-WIN32-ARM-UWP) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(OPENSSL_ARCH VC-WIN64-ARM-UWP) +else() + message(FATAL_ERROR "Unsupported target architecture: ${VCPKG_TARGET_ARCHITECTURE}") +endif() + +set(OPENSSL_MAKEFILE "makefile") + +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + + # Copy openssl sources. + message(STATUS "Copying openssl release source files...") + file(GLOB OPENSSL_SOURCE_FILES "${SOURCE_PATH}/*") + foreach(SOURCE_FILE ${OPENSSL_SOURCE_FILES}) + file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + endforeach() + message(STATUS "Copying openssl release source files... done") + set(SOURCE_PATH_RELEASE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + + set(OPENSSLDIR_RELEASE "${CURRENT_PACKAGES_DIR}") + + message(STATUS "Configure ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${CONFIGURE_COMMAND} ${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_RELEASE}" "--openssldir=${OPENSSLDIR_RELEASE}" -FS + WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" + LOGNAME configure-perl-${TARGET_TRIPLET}-${VCPKG_BUILD_TYPE}-rel + ) + message(STATUS "Configure ${TARGET_TRIPLET}-rel done") + + message(STATUS "Build ${TARGET_TRIPLET}-rel") + # Openssl's buildsystem has a race condition which will cause JOM to fail at some point. + # This is ok; we just do as much work as we can in parallel first, then follow up with a single-threaded build. + make_directory(${SOURCE_PATH_RELEASE}/inc32/openssl) + execute_process( + COMMAND "${JOM}" -k -j ${VCPKG_CONCURRENCY} -f "${OPENSSL_MAKEFILE}" build_libs + WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" + OUTPUT_FILE "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-out.log" + ERROR_FILE "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-err.log" + ) + vcpkg_execute_required_process( + COMMAND nmake -f "${OPENSSL_MAKEFILE}" install_dev + WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" + LOGNAME build-${TARGET_TRIPLET}-rel-1) + + message(STATUS "Build ${TARGET_TRIPLET}-rel done") +endif() + + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + # Copy openssl sources. + message(STATUS "Copying openssl debug source files...") + file(GLOB OPENSSL_SOURCE_FILES ${SOURCE_PATH}/*) + foreach(SOURCE_FILE ${OPENSSL_SOURCE_FILES}) + file(COPY "${SOURCE_FILE}" DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + endforeach() + message(STATUS "Copying openssl debug source files... done") + set(SOURCE_PATH_DEBUG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + + set(OPENSSLDIR_DEBUG "${CURRENT_PACKAGES_DIR}/debug") + + message(STATUS "Configure ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND ${CONFIGURE_COMMAND} debug-${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_DEBUG}" "--openssldir=${OPENSSLDIR_DEBUG}" -FS + WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" + LOGNAME configure-perl-${TARGET_TRIPLET}-${VCPKG_BUILD_TYPE}-dbg + ) + message(STATUS "Configure ${TARGET_TRIPLET}-dbg done") + + message(STATUS "Build ${TARGET_TRIPLET}-dbg") + make_directory("${SOURCE_PATH_DEBUG}/inc32/openssl") + execute_process( + COMMAND "${JOM}" -k -j ${VCPKG_CONCURRENCY} -f "${OPENSSL_MAKEFILE}" build_libs + WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" + OUTPUT_FILE "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-out.log" + ERROR_FILE "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-err.log" + ) + vcpkg_execute_required_process( + COMMAND nmake -f "${OPENSSL_MAKEFILE}" install_dev + WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" + LOGNAME build-${TARGET_TRIPLET}-dbg-1) + + message(STATUS "Build ${TARGET_TRIPLET}-dbg done") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/certs") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/private") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/engines-1_1") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/certs") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/engines-1_1") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/private") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(REMOVE + "${CURRENT_PACKAGES_DIR}/bin/openssl.exe" + "${CURRENT_PACKAGES_DIR}/debug/bin/openssl.exe" + "${CURRENT_PACKAGES_DIR}/debug/openssl.cnf" + "${CURRENT_PACKAGES_DIR}/openssl.cnf" + "${CURRENT_PACKAGES_DIR}/ct_log_list.cnf" + "${CURRENT_PACKAGES_DIR}/ct_log_list.cnf.dist" + "${CURRENT_PACKAGES_DIR}/openssl.cnf.dist" + "${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf" + "${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf.dist" + "${CURRENT_PACKAGES_DIR}/debug/openssl.cnf.dist" +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + # They should be empty, only the exes deleted above were in these directories + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin/") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin/") +endif() + +file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" _contents) +string(REPLACE "" "" _contents "${_contents}") +file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" "${_contents}") + +file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" _contents) +string(REPLACE "# include " "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include " _contents "${_contents}") +file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" "${_contents}") + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/cpp/azure/vcpkg-custom-ports/openssl/vcpkg-cmake-wrapper.cmake.in b/cpp/azure/vcpkg-custom-ports/openssl/vcpkg-cmake-wrapper.cmake.in new file mode 100644 index 0000000000000..4a5ee893a2fe2 --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/vcpkg-cmake-wrapper.cmake.in @@ -0,0 +1,78 @@ +cmake_policy(PUSH) +cmake_policy(SET CMP0012 NEW) +cmake_policy(SET CMP0054 NEW) +cmake_policy(SET CMP0057 NEW) + +if(OPENSSL_USE_STATIC_LIBS) + if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "dynamic") + message(WARNING "OPENSSL_USE_STATIC_LIBS is set, but vcpkg port openssl was built with dynamic linkage") + endif() + set(OPENSSL_USE_STATIC_LIBS_BAK "${OPENSSL_USE_STATIC_LIBS}") + set(OPENSSL_USE_STATIC_LIBS FALSE) +endif() + +if(DEFINED OPENSSL_ROOT_DIR) + set(OPENSSL_ROOT_DIR_BAK "${OPENSSL_ROOT_DIR}") +endif() +get_filename_component(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) +get_filename_component(OPENSSL_ROOT_DIR "${OPENSSL_ROOT_DIR}" DIRECTORY) +find_path(OPENSSL_INCLUDE_DIR NAMES openssl/ssl.h PATH "${OPENSSL_ROOT_DIR}/include" NO_DEFAULT_PATH) +if(MSVC) + find_library(LIB_EAY_DEBUG NAMES libcrypto PATHS "${OPENSSL_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH) + find_library(LIB_EAY_RELEASE NAMES libcrypto PATHS "${OPENSSL_ROOT_DIR}/lib" NO_DEFAULT_PATH) + find_library(SSL_EAY_DEBUG NAMES libssl PATHS "${OPENSSL_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH) + find_library(SSL_EAY_RELEASE NAMES libssl PATHS "${OPENSSL_ROOT_DIR}/lib" NO_DEFAULT_PATH) +elseif(WIN32) + find_library(LIB_EAY NAMES libcrypto crypto NAMES_PER_DIR) + find_library(SSL_EAY NAMES libssl ssl NAMES_PER_DIR) +else() + find_library(OPENSSL_CRYPTO_LIBRARY NAMES crypto) + find_library(OPENSSL_SSL_LIBRARY NAMES ssl) +endif() + +_find_package(${ARGS}) + +unset(OPENSSL_ROOT_DIR) +if(DEFINED OPENSSL_ROOT_DIR_BAK) + set(OPENSSL_ROOT_DIR "${OPENSSL_ROOT_DIR_BAK}") + unset(OPENSSL_ROOT_DIR_BAK) +endif() + +if(DEFINED OPENSSL_USE_STATIC_LIBS_BAK) + set(OPENSSL_USE_STATIC_LIBS "${OPENSSL_USE_STATIC_LIBS_BAK}") + unset(OPENSSL_USE_STATIC_LIBS_BAK) +endif() + +if(OPENSSL_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") + if(WIN32) + list(APPEND OPENSSL_LIBRARIES crypt32 ws2_32) + if(TARGET OpenSSL::Crypto) + set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "crypt32;ws2_32") + endif() + if(TARGET OpenSSL::SSL) + set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "crypt32;ws2_32") + endif() + else() + find_library(OPENSSL_DL_LIBRARY NAMES dl) + if(OPENSSL_DL_LIBRARY) + list(APPEND OPENSSL_LIBRARIES "dl") + if(TARGET OpenSSL::Crypto) + set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "dl") + endif() + endif() + + if("REQUIRED" IN_LIST ARGS) + find_package(Threads REQUIRED) + else() + find_package(Threads) + endif() + list(APPEND OPENSSL_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + if(TARGET OpenSSL::Crypto) + set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads") + endif() + if(TARGET OpenSSL::SSL) + set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads") + endif() + endif() +endif() +cmake_policy(POP) diff --git a/cpp/azure/vcpkg-custom-ports/openssl/vcpkg.json b/cpp/azure/vcpkg-custom-ports/openssl/vcpkg.json new file mode 100644 index 0000000000000..beb5807743e1a --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "openssl", + "version-string": "1.1.1n", + "port-version": 1, + "description": "OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.", + "homepage": "https://www.openssl.org", + "license": "OpenSSL", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/cpp/azure/vcpkg-custom-ports/openssl/windows/portfile.cmake b/cpp/azure/vcpkg-custom-ports/openssl/windows/portfile.cmake new file mode 100644 index 0000000000000..5a0dec0b730ac --- /dev/null +++ b/cpp/azure/vcpkg-custom-ports/openssl/windows/portfile.cmake @@ -0,0 +1,172 @@ +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} +) + +vcpkg_find_acquire_program(NASM) +get_filename_component(NASM_EXE_PATH "${NASM}" DIRECTORY) +vcpkg_add_to_path(PREPEND "${NASM_EXE_PATH}") + +vcpkg_find_acquire_program(JOM) + +set(OPENSSL_SHARED no-shared) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OPENSSL_SHARED shared) +endif() + +set(CONFIGURE_OPTIONS + enable-static-engine + enable-capieng + no-ssl2 + no-tests + -utf-8 + ${OPENSSL_SHARED} +) + +if(DEFINED OPENSSL_USE_NOPINSHARED) + set(CONFIGURE_OPTIONS ${CONFIGURE_OPTIONS} no-pinshared) +endif() + +if(OPENSSL_NO_AUTOLOAD_CONFIG) + set(CONFIGURE_OPTIONS ${CONFIGURE_OPTIONS} no-autoload-config) +endif() + +set(CONFIGURE_COMMAND "${PERL}" Configure ${CONFIGURE_OPTIONS}) + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(OPENSSL_ARCH VC-WIN32) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(OPENSSL_ARCH VC-WIN64A) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(OPENSSL_ARCH VC-WIN32-ARM) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(OPENSSL_ARCH VC-WIN64-ARM) +else() + message(FATAL_ERROR "Unsupported target architecture: ${VCPKG_TARGET_ARCHITECTURE}") +endif() + +set(OPENSSL_MAKEFILE "makefile") + +file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + + # Copy openssl sources. + message(STATUS "Copying openssl release source files...") + file(GLOB OPENSSL_SOURCE_FILES ${SOURCE_PATH}/*) + foreach(SOURCE_FILE ${OPENSSL_SOURCE_FILES}) + file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + endforeach() + message(STATUS "Copying openssl release source files... done") + set(SOURCE_PATH_RELEASE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + + set(OPENSSLDIR_RELEASE ${CURRENT_PACKAGES_DIR}) + + message(STATUS "Configure ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${CONFIGURE_COMMAND} ${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_RELEASE}" "--openssldir=${OPENSSLDIR_RELEASE}" -FS + WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} + LOGNAME configure-perl-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configure ${TARGET_TRIPLET}-rel done") + + message(STATUS "Build ${TARGET_TRIPLET}-rel") + # Openssl's buildsystem has a race condition which will cause JOM to fail at some point. + # This is ok; we just do as much work as we can in parallel first, then follow up with a single-threaded build. + make_directory(${SOURCE_PATH_RELEASE}/inc32/openssl) + execute_process( + COMMAND "${JOM}" -k -j "${VCPKG_CONCURRENCY}" -f "${OPENSSL_MAKEFILE}" + WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} + OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-out.log + ERROR_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-err.log + ) + vcpkg_execute_required_process( + COMMAND "${JOM}" -j 1 -f "${OPENSSL_MAKEFILE}" install_sw install_ssldirs + WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} + LOGNAME build-${TARGET_TRIPLET}-rel-1) + + message(STATUS "Build ${TARGET_TRIPLET}-rel done") +endif() + + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + # Copy openssl sources. + message(STATUS "Copying openssl debug source files...") + file(GLOB OPENSSL_SOURCE_FILES ${SOURCE_PATH}/*) + foreach(SOURCE_FILE ${OPENSSL_SOURCE_FILES}) + file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + endforeach() + message(STATUS "Copying openssl debug source files... done") + set(SOURCE_PATH_DEBUG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + + set(OPENSSLDIR_DEBUG ${CURRENT_PACKAGES_DIR}/debug) + + message(STATUS "Configure ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND ${CONFIGURE_COMMAND} debug-${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_DEBUG}" "--openssldir=${OPENSSLDIR_DEBUG}" -FS + WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} + LOGNAME configure-perl-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configure ${TARGET_TRIPLET}-dbg done") + + message(STATUS "Build ${TARGET_TRIPLET}-dbg") + make_directory(${SOURCE_PATH_DEBUG}/inc32/openssl) + execute_process( + COMMAND "${JOM}" -k -j "${VCPKG_CONCURRENCY}" -f "${OPENSSL_MAKEFILE}" + WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} + OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-out.log + ERROR_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-err.log + ) + vcpkg_execute_required_process( + COMMAND "${JOM}" -j 1 -f "${OPENSSL_MAKEFILE}" install_sw install_ssldirs + WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} + LOGNAME build-${TARGET_TRIPLET}-dbg-1) + + message(STATUS "Build ${TARGET_TRIPLET}-dbg done") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/certs") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/private") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/engines-1_1") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/certs") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/engines-1_1") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/private") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(REMOVE + "${CURRENT_PACKAGES_DIR}/ct_log_list.cnf" + "${CURRENT_PACKAGES_DIR}/ct_log_list.cnf.dist" + "${CURRENT_PACKAGES_DIR}/openssl.cnf.dist" + "${CURRENT_PACKAGES_DIR}/debug/bin/openssl.exe" + "${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf" + "${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf.dist" + "${CURRENT_PACKAGES_DIR}/debug/openssl.cnf" + "${CURRENT_PACKAGES_DIR}/debug/openssl.cnf.dist" +) + +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/openssl/") +file(RENAME "${CURRENT_PACKAGES_DIR}/bin/openssl.exe" "${CURRENT_PACKAGES_DIR}/tools/openssl/openssl.exe") +file(RENAME "${CURRENT_PACKAGES_DIR}/openssl.cnf" "${CURRENT_PACKAGES_DIR}/tools/openssl/openssl.cnf") + +vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/openssl") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + # They should be empty, only the exes deleted above were in these directories + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin/") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin/") +endif() + +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" + "" + "" +) + +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" + "# include " + "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include " +) + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/cpp/azure/vcpkg.json b/cpp/azure/vcpkg.json new file mode 100644 index 0000000000000..fabc3ef0d0803 --- /dev/null +++ b/cpp/azure/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "arrow", + "version-string": "10.0.0-SNAPSHOT", + "dependencies": [ + "azure-core-cpp", + "azure-identity-cpp", + "azure-storage-blobs-cpp", + "azure-storage-common-cpp", + "azure-storage-files-datalake-cpp" + ] +} diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index f33397db96d08..e67f794af864d 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5180,12 +5180,15 @@ macro(build_azuresdk) -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON -DENABLE_TESTING=OFF -DENABLE_UNITY_BUILD=ON - -DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} - -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} - -DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} - -Dcrypto_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} - -Dcrypto_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} -DWARNINGS_AS_ERRORS=OFF) + + if("${OPENSSL_VERSION}" LESS 3) + list(APPEND + AZURESDK_COMMON_CMAKE_ARGS + -DVCPKG_MANIFEST_MODE=ON + -DVCPKG_OVERLAY_PORTS=${PROJECT_SOURCE_DIR}/azure/vcpkg-custom-ports + -DVCPKG_MANIFEST_DIR=${PROJECT_SOURCE_DIR}/azure) + endif() file(MAKE_DIRECTORY ${AZURESDK_INCLUDE_DIR}) set(AZURE_CORE_STATIC_LIBRARY From 25b043774debb0200f38aefcff3a9411a8397d85 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 19 Jun 2023 22:11:56 +0100 Subject: [PATCH 09/93] Tidy link libraries --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 24 +++++++++------------ 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index e67f794af864d..4274c64f4ea62 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5163,14 +5163,6 @@ macro(build_azuresdk) # list(APPEND AWSSDK_COMMON_CMAKE_ARGS # -Dcrypto_STATIC_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) - set(AZURE_SDK_PATCH_COMMAND) - find_package(Patch) - if(Patch_FOUND) - set(AZURE_SDK_PATCH_COMMAND - ${Patch_EXECUTABLE} "/sdk/core/azure-core/src/http/curl/curl.cpp" - "${CMAKE_SOURCE_DIR}/build-support/ssl.patch") - endif() - set(AZURESDK_COMMON_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=" @@ -5212,7 +5204,6 @@ macro(build_azuresdk) URL ${ARROW_AZURESDK_URL} URL_HASH "SHA256=${ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM}" CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} - PATCH_COMMAND ${AZURE_SDK_PATCH_COMMAND} BUILD_BYPRODUCTS ${AZURE_CORE_STATIC_LIBRARY} ${AZURE_IDENTITY_STATIC_LIBRARY} ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} @@ -5224,7 +5215,8 @@ macro(build_azuresdk) PROPERTIES IMPORTED_LOCATION ${AZURE_CORE_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES ${AZURESDK_INCLUDE_DIR}) - target_link_libraries(Azure::azure-core INTERFACE CURL::libcurl OpenSSL::Crypto OpenSSL::SSL) + set_property(TARGET Azure::azure-core + PROPERTY INTERFACE_LINK_LIBRARIES CURL::libcurl OpenSSL::Crypto OpenSSL::SSL) add_dependencies(Azure::azure-core azuresdk_ep) add_library(Azure::azure-identity STATIC IMPORTED) @@ -5232,7 +5224,8 @@ macro(build_azuresdk) PROPERTIES IMPORTED_LOCATION ${AZURE_IDENTITY_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES ${AZURESDK_INCLUDE_DIR}) - target_link_libraries(Azure::azure-identity INTERFACE OpenSSL::Crypto Azure::azure-core) + set_property(TARGET Azure::azure-identity + PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::Crypto Azure::azure-core) add_dependencies(Azure::azure-identity azuresdk_ep) add_library(Azure::azure-storage-common STATIC IMPORTED) @@ -5240,7 +5233,8 @@ macro(build_azuresdk) PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_COMMON_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES ${AZURESDK_INCLUDE_DIR}) - target_link_libraries(Azure::azure-storage-common INTERFACE OpenSSL::Crypto LibXml2::LibXml2 Azure::azure-core) + set_property(TARGET Azure::azure-storage-common + PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::Crypto LibXml2::LibXml2 Azure::azure-core) add_dependencies(Azure::azure-storage-common azuresdk_ep) add_library(Azure::azure-storage-blobs STATIC IMPORTED) @@ -5248,7 +5242,8 @@ macro(build_azuresdk) PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES ${AZURESDK_INCLUDE_DIR}) - target_link_libraries(Azure::azure-storage-blobs INTERFACE Azure::azure-core Azure::azure-storage-common) + set_property(TARGET Azure::azure-identity + PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-core Azure::azure-storage-common) add_dependencies(Azure::azure-storage-blobs azuresdk_ep) add_library(Azure::azure-storage-files-datalake STATIC IMPORTED) @@ -5256,7 +5251,8 @@ macro(build_azuresdk) PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES ${AZURESDK_INCLUDE_DIR}) - target_link_libraries(Azure::azure-storage-files-datalake INTERFACE Azure::azure-core Azure::azure-identity Azure::azure-storage-common Azure::azure-storage-blobs) + set_property(TARGET Azure::azure-storage-files-datalake + PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-core Azure::azure-identity Azure::azure-storage-common Azure::azure-storage-blobs) add_dependencies(Azure::azure-storage-files-datalake azuresdk_ep) set(AZURE_SDK_VENDORED TRUE) From f3161924c7849f27bb97ff5019ddeb8ab5adaea3 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 22 Jul 2023 20:47:00 +0100 Subject: [PATCH 10/93] Hack to avoid uamqp build failure --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 4274c64f4ea62..77205e4c9b037 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5170,6 +5170,7 @@ macro(build_azuresdk) -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=${AZURESDK_LIB_DIR} -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON + -DBUILD_WINDOWS_UWP=ON # Hack to disable azure-core-amqp which fails to build -DENABLE_TESTING=OFF -DENABLE_UNITY_BUILD=ON -DWARNINGS_AS_ERRORS=OFF) From db117bc35fad7e5400e2810876e42dbfd233d57a Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 22 Jul 2023 23:21:37 +0100 Subject: [PATCH 11/93] I think its working --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 77205e4c9b037..1e49bbeaf755f 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5170,7 +5170,6 @@ macro(build_azuresdk) -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=${AZURESDK_LIB_DIR} -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON - -DBUILD_WINDOWS_UWP=ON # Hack to disable azure-core-amqp which fails to build -DENABLE_TESTING=OFF -DENABLE_UNITY_BUILD=ON -DWARNINGS_AS_ERRORS=OFF) @@ -5178,9 +5177,7 @@ macro(build_azuresdk) if("${OPENSSL_VERSION}" LESS 3) list(APPEND AZURESDK_COMMON_CMAKE_ARGS - -DVCPKG_MANIFEST_MODE=ON - -DVCPKG_OVERLAY_PORTS=${PROJECT_SOURCE_DIR}/azure/vcpkg-custom-ports - -DVCPKG_MANIFEST_DIR=${PROJECT_SOURCE_DIR}/azure) + -DVCPKG_OVERLAY_PORTS=${PROJECT_SOURCE_DIR}/azure/vcpkg-custom-ports) endif() file(MAKE_DIRECTORY ${AZURESDK_INCLUDE_DIR}) From c6ee215a30c8f0253b30f8ca1fa158ca82f69e99 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 22 Jul 2023 23:53:43 +0100 Subject: [PATCH 12/93] Revert unnecessary changes --- cpp/azure/vcpkg.json | 11 ----------- cpp/build-support/ssl.patch | 16 ---------------- 2 files changed, 27 deletions(-) delete mode 100644 cpp/azure/vcpkg.json delete mode 100644 cpp/build-support/ssl.patch diff --git a/cpp/azure/vcpkg.json b/cpp/azure/vcpkg.json deleted file mode 100644 index fabc3ef0d0803..0000000000000 --- a/cpp/azure/vcpkg.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "arrow", - "version-string": "10.0.0-SNAPSHOT", - "dependencies": [ - "azure-core-cpp", - "azure-identity-cpp", - "azure-storage-blobs-cpp", - "azure-storage-common-cpp", - "azure-storage-files-datalake-cpp" - ] -} diff --git a/cpp/build-support/ssl.patch b/cpp/build-support/ssl.patch deleted file mode 100644 index 45d96e4bf831e..0000000000000 --- a/cpp/build-support/ssl.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp -index 80309f89..b34c9b77 100644 ---- a/sdk/core/azure-core/src/http/curl/curl.cpp -+++ b/sdk/core/azure-core/src/http/curl/curl.cpp -@@ -39,11 +39,7 @@ - - #if defined(AZ_PLATFORM_POSIX) - #include --#if OPENSSL_VERSION_NUMBER < 0x30000000L - #define USE_OPENSSL_1 --#else --#define USE_OPENSSL_3 --#endif // OPENSSL_VERSION_NUMBER < 0x30000000L - - #include - #include From 1d736a8c14c21ead0182404cb47d4dca73cd6176 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 22 Jul 2023 23:54:00 +0100 Subject: [PATCH 13/93] Somewhat functional azurite test --- cpp/src/arrow/filesystem/azurefs_test.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index 17b7e3462e516..594bf4004376e 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -41,12 +41,13 @@ #include #include +#include #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" -#include #include +#include namespace arrow { using internal::TemporaryDir; @@ -62,6 +63,7 @@ using ::testing::NotNull; class AzuriteEnv : public ::testing::Environment { public: AzuriteEnv() { + std::cout << "Starting Azurite emulator..." << std::endl; account_name_ = "devstoreaccount1"; account_key_ = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/" @@ -83,6 +85,7 @@ class AzuriteEnv : public ::testing::Environment { status_ = Status::Invalid(error); return; } + std::cout << "Azurite emulator started." << std::endl; status_ = Status::OK(); } @@ -111,16 +114,17 @@ AzuriteEnv* GetAzuriteEnv() { // Placeholder test for file structure // TODO: GH-18014 Remove once a proper test is added -TEST(AzureBlobFileSystem, InitialiseClient) { +TEST(AzureFileSystem, InitialiseClient) { const std::string& account_name = GetAzuriteEnv()->account_name(); const std::string& account_key = GetAzuriteEnv()->account_key(); auto credential = std::make_shared( account_name, account_key); auto blockBlobClient = Azure::Storage::Blobs::BlockBlobClient( - "https://wayvedevdataset.blob.core.windows.net/databricks/" - "part-00000-540fd04c-424d-482e-b347-b0a200d36e59.c000.snappy.parquet", - credential); + "http://127.0.0.1:10000/devstoreaccount1/container/file.parquet", credential); + + blockBlobClient.DownloadTo("test.parquet"); + EXPECT_FALSE(true); } TEST(AzureFileSystem, OptionsCompare) { From e1fb4719047887f6d1fdd4648bf45e2df9ae1490 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sun, 23 Jul 2023 00:47:44 +0100 Subject: [PATCH 14/93] Avoid checking in vcpkg-custom-ports --- .../openssl/install-pc-files.cmake | 32 -- .../vcpkg-custom-ports/openssl/openssl.pc.in | 6 - .../vcpkg-custom-ports/openssl/portfile.cmake | 28 -- .../openssl/unix/CMakeLists.txt | 284 ------------------ .../openssl/unix/portfile.cmake | 38 --- .../openssl/unix/remove-deps.cmake | 7 - cpp/azure/vcpkg-custom-ports/openssl/usage | 4 - .../openssl/uwp/EnableUWPSupport.patch | 170 ----------- .../openssl/uwp/make-openssl.bat | 16 - .../openssl/uwp/portfile.cmake | 163 ---------- .../openssl/vcpkg-cmake-wrapper.cmake.in | 78 ----- .../vcpkg-custom-ports/openssl/vcpkg.json | 18 -- .../openssl/windows/portfile.cmake | 172 ----------- cpp/cmake_modules/ThirdpartyToolchain.cmake | 22 +- 14 files changed, 5 insertions(+), 1033 deletions(-) delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/install-pc-files.cmake delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/openssl.pc.in delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/portfile.cmake delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/unix/CMakeLists.txt delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/unix/portfile.cmake delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/unix/remove-deps.cmake delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/usage delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/uwp/EnableUWPSupport.patch delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/uwp/make-openssl.bat delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/uwp/portfile.cmake delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/vcpkg-cmake-wrapper.cmake.in delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/vcpkg.json delete mode 100644 cpp/azure/vcpkg-custom-ports/openssl/windows/portfile.cmake diff --git a/cpp/azure/vcpkg-custom-ports/openssl/install-pc-files.cmake b/cpp/azure/vcpkg-custom-ports/openssl/install-pc-files.cmake deleted file mode 100644 index eb8d2b8c28847..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/install-pc-files.cmake +++ /dev/null @@ -1,32 +0,0 @@ -function(install_pc_file name pc_data) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${name}.pc" @ONLY) - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${name}.pc" @ONLY) - endif() -endfunction() - -install_pc_file(openssl [[ -Name: OpenSSL -Description: Secure Sockets Layer and cryptography libraries and tools -Requires: libssl libcrypto -]]) - -install_pc_file(libssl [[ -Name: OpenSSL-libssl -Description: Secure Sockets Layer and cryptography libraries -Libs: -L"${libdir}" -llibssl -Requires: libcrypto -Cflags: -I"${includedir}" -]]) - -install_pc_file(libcrypto [[ -Name: OpenSSL-libcrypto -Description: OpenSSL cryptography library -Libs: -L"${libdir}" -llibcrypto -Libs.private: -lcrypt32 -lws2_32 -Cflags: -I"${includedir}" -]]) - -vcpkg_fixup_pkgconfig() diff --git a/cpp/azure/vcpkg-custom-ports/openssl/openssl.pc.in b/cpp/azure/vcpkg-custom-ports/openssl/openssl.pc.in deleted file mode 100644 index 3033e1804da0f..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/openssl.pc.in +++ /dev/null @@ -1,6 +0,0 @@ -prefix=${pcfiledir}/../.. -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include -Version: @OPENSSL_VERSION@ -@pc_data@ diff --git a/cpp/azure/vcpkg-custom-ports/openssl/portfile.cmake b/cpp/azure/vcpkg-custom-ports/openssl/portfile.cmake deleted file mode 100644 index e94e7a83f02d3..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/portfile.cmake +++ /dev/null @@ -1,28 +0,0 @@ -if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") - message(FATAL_ERROR "Can't build openssl if libressl/boringssl is installed. Please remove libressl/boringssl, and try install openssl again if you need it.") -endif() - -set(OPENSSL_VERSION 1.1.1n) -vcpkg_download_distfile( - ARCHIVE - URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz" - FILENAME "openssl-${OPENSSL_VERSION}.tar.gz" - SHA512 1937796736613dcf4105a54e42ecb61f95a1cea74677156f9459aea0f2c95159359e766089632bf364ee6b0d28d661eb9957bce8fecc9d2436378d8d79e8d0a4 -) - -vcpkg_find_acquire_program(PERL) -get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -vcpkg_add_to_path("${PERL_EXE_PATH}") - -if(VCPKG_TARGET_IS_UWP) - include("${CMAKE_CURRENT_LIST_DIR}/uwp/portfile.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake") -elseif(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - include("${CMAKE_CURRENT_LIST_DIR}/windows/portfile.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake") -else() - include("${CMAKE_CURRENT_LIST_DIR}/unix/portfile.cmake") -endif() - -configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) -file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/cpp/azure/vcpkg-custom-ports/openssl/unix/CMakeLists.txt b/cpp/azure/vcpkg-custom-ports/openssl/unix/CMakeLists.txt deleted file mode 100644 index 52bfcfff3c5e0..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/unix/CMakeLists.txt +++ /dev/null @@ -1,284 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(openssl C) - -if(NOT SOURCE_PATH) - message(FATAL_ERROR "Requires SOURCE_PATH") -endif() - -if(CMAKE_SYSTEM_NAME STREQUAL "Android" OR CMAKE_SYSTEM_NAME STREQUAL "Linux") - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - set(PLATFORM linux-x86_64) - else() - set(PLATFORM linux-generic32) - endif() -elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") - if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") - set(PLATFORM ios64-xcrun) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm") - set(PLATFORM ios-xcrun) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" OR - VCPKG_TARGET_ARCHITECTURE MATCHES "x64") - set(PLATFORM iossimulator-xcrun) - else() - message(FATAL_ERROR "Unknown iOS target architecture: ${VCPKG_TARGET_ARCHITECTURE}") - endif() - # disable that makes linkage error (e.g. require stderr usage) - list(APPEND DISABLES no-stdio no-ui no-asm) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") - set(PLATFORM darwin64-arm64-cc) - else() - set(PLATFORM darwin64-x86_64-cc) - endif() -elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - set(PLATFORM BSD-generic64) -elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") - set(PLATFORM BSD-generic64) -elseif(MINGW) - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - set(PLATFORM mingw64) - else() - set(PLATFORM mingw) - endif() -elseif(EMSCRIPTEN) - set(MAKE $ENV{EMSDK}/upstream/emscripten/emmake) - set(ENV{MAKE} $ENV{EMSDK}/upstream/emscripten/emmake) -else() - message(FATAL_ERROR "Unknown platform") -endif() - -get_filename_component(COMPILER_ROOT "${CMAKE_C_COMPILER}" DIRECTORY) - -message("CMAKE_C_COMPILER=${CMAKE_C_COMPILER}") -message("COMPILER_ROOT=${COMPILER_ROOT}") -message("CMAKE_SYSROOT=${CMAKE_SYSROOT}") -message("CMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}") -message("CMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}") -message("CMAKE_C_FLAGS=${CMAKE_C_FLAGS}") -message("CMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}") -message("CMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}") -message("CMAKE_INCLUDE_SYSTEM_FLAG_C=${CMAKE_INCLUDE_SYSTEM_FLAG_C}") -message("CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG=${CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG}") - -string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE) -set(CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BUILD_TYPE}}") -if(CMAKE_C_COMPILER_ID STREQUAL "Clang") - set(CFLAGS "${CFLAGS} -Wno-error=unused-command-line-argument") -endif() -if(CMAKE_C_COMPILER_TARGET AND CMAKE_C_COMPILE_OPTIONS_TARGET) - set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}") -endif() -if(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN AND CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN) - set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN}") -endif() -if(CMAKE_SYSROOT AND CMAKE_C_COMPILE_OPTIONS_SYSROOT) - set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}") -elseif(CMAKE_OSX_SYSROOT AND CMAKE_C_COMPILE_OPTIONS_SYSROOT) - set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_OSX_SYSROOT}") -endif() -if (CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG) - set(CFLAGS "${CFLAGS} ${CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG}${CMAKE_OSX_DEPLOYMENT_TARGET}") -elseif((CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND (VCPKG_TARGET_ARCHITECTURE MATCHES "arm64")) - set(CFLAGS "${CFLAGS} -mmacosx-version-min=11.0") -endif() - -string(REGEX REPLACE "^ " "" CFLAGS "${CFLAGS}") - -if(CMAKE_HOST_WIN32) - file(TO_NATIVE_PATH ENV_PATH "${COMPILER_ROOT};$ENV{PATH}") -else() - file(TO_NATIVE_PATH ENV_PATH "${COMPILER_ROOT}:$ENV{PATH}") -endif() -set(ENV{ANDROID_DEV} "${CMAKE_SYSROOT}/usr") - -if(NOT IOS) - set(ENV{CC} "${CMAKE_C_COMPILER}") -endif() - -message("ENV{ANDROID_DEV}=$ENV{ANDROID_DEV}") - -get_filename_component(SOURCE_PATH_NAME "${SOURCE_PATH}" NAME) -set(BUILDDIR "${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_PATH_NAME}") - -if(NOT EXISTS "${BUILDDIR}") - file(COPY ${SOURCE_PATH} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -endif() - -get_filename_component(MSYS_BIN_DIR "${MAKE}" DIRECTORY) - -if(BUILD_SHARED_LIBS) - set(SHARED shared) - file(STRINGS "${BUILDDIR}/include/openssl/opensslv.h" SHLIB_VERSION - REGEX "^#[\t ]*define[\t ]+SHLIB_VERSION_NUMBER[\t ]+\".*\".*") - string(REGEX REPLACE "^.*SHLIB_VERSION_NUMBER[\t ]+\"([^\"]*)\".*$" "\\1" - SHLIB_VERSION "${SHLIB_VERSION}") - if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS") - set(LIB_EXT dylib) - set(LIB_EXTS ${SHLIB_VERSION}.${LIB_EXT}) - elseif(MINGW) - string(REPLACE "." "_" SHLIB_VERSION "${SHLIB_VERSION}") - set(BIN_EXT dll) - set(LIB_EXT dll.a) - else() - set(LIB_EXT so) - set(LIB_EXTS ${LIB_EXT}.${SHLIB_VERSION}) - endif() - list(APPEND BIN_EXTS ${BIN_EXT}) - list(APPEND LIB_EXTS ${LIB_EXT}) -else() - set(SHARED no-shared) - set(LIB_EXTS a) -endif() -set(INSTALL_PKG_CONFIGS "${BUILDDIR}/openssl.pc") -foreach(lib ssl crypto) - foreach(ext ${LIB_EXTS}) - list(APPEND INSTALL_LIBS "${BUILDDIR}/lib${lib}.${ext}") - list(APPEND INSTALL_PKG_CONFIGS "${BUILDDIR}/lib${lib}.pc") - endforeach() - foreach(ext ${BIN_EXTS}) - # This might be wrong for targets which don't follow this naming scheme, but I'm not aware of any - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}-x64.${ext}") - else() - list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}.${ext}") - endif() - endforeach() -endforeach() - -if(CMAKE_HOST_WIN32) - set(ENV_COMMAND set) - set(PATH_VAR ";%PATH%") -else() - set(ENV_COMMAND export) - set(PATH_VAR ":$ENV{PATH}") -endif() - -add_custom_command( - OUTPUT "${BUILDDIR}/Makefile" - COMMAND ${ENV_COMMAND} "PATH=${MSYS_BIN_DIR}${PATH_VAR}" - VERBATIM - WORKING_DIRECTORY "${BUILDDIR}" -) - -if(NOT IOS) - add_custom_command( - OUTPUT "${BUILDDIR}/Makefile" - COMMAND ${ENV_COMMAND} CC=${CMAKE_C_COMPILER} - COMMAND ${ENV_COMMAND} AR=${CMAKE_AR} - COMMAND ${ENV_COMMAND} LD=${CMAKE_LINKER} - COMMAND ${ENV_COMMAND} RANLIB=${CMAKE_RANLIB} - COMMAND ${ENV_COMMAND} MAKE=${MAKE} - COMMAND ${ENV_COMMAND} MAKEDEPPROG=${CMAKE_C_COMPILER} - COMMAND ${ENV_COMMAND} WINDRES=${CMAKE_RC_COMPILER} - VERBATIM - APPEND - ) - if(EMSCRIPTEN) - list(APPEND DISABLES - threads - no-engine - no-dso - no-asm - no-shared - no-sse2 - no-srtp - ) - else() - list(APPEND DISABLES - enable-static-engine - no-zlib - no-ssl2 - no-idea - no-cast - no-seed - no-md2 - no-tests) - endif() -endif() - -if(EMSCRIPTEN) - add_custom_command( - OUTPUT "${BUILDDIR}/Makefile" - COMMAND "$ENV{EMSDK}/upstream/emscripten/emconfigure" ./config - ${SHARED} - ${DISABLES} - "--prefix=${CMAKE_INSTALL_PREFIX}" - "--openssldir=/etc/ssl" - "--cross-compile-prefix=\"/\"" - VERBATIM - APPEND - ) - - add_custom_target(build_libs ALL - COMMAND ${ENV_COMMAND} "PATH=${MSYS_BIN_DIR}${PATH_VAR}" - COMMAND "${CMAKE_COMMAND}" -E touch "${BUILDDIR}/krb5.h" - COMMAND "${MAKE}" make build_libs - VERBATIM - WORKING_DIRECTORY "${BUILDDIR}" - DEPENDS "${BUILDDIR}/Makefile" - BYPRODUCTS ${INSTALL_LIBS} - ) -else() - add_custom_command( - OUTPUT "${BUILDDIR}/Makefile" - COMMAND "${PERL}" Configure - ${SHARED} - ${DISABLES} - ${PLATFORM} - "--prefix=${CMAKE_INSTALL_PREFIX}" - "--openssldir=/etc/ssl" - ${CFLAGS} - VERBATIM - APPEND - ) - - add_custom_target(build_libs ALL - COMMAND ${ENV_COMMAND} "PATH=${MSYS_BIN_DIR}${PATH_VAR}" - COMMAND "${CMAKE_COMMAND}" -E touch "${BUILDDIR}/krb5.h" - COMMAND "${MAKE}" -j ${VCPKG_CONCURRENCY} build_libs - VERBATIM - WORKING_DIRECTORY "${BUILDDIR}" - DEPENDS "${BUILDDIR}/Makefile" - BYPRODUCTS ${INSTALL_LIBS} - ) -endif() - -add_custom_command( - OUTPUT "${BUILDDIR}/Makefile" - COMMAND "${CMAKE_COMMAND}" "-DDIR=${BUILDDIR}" -P "${CMAKE_CURRENT_LIST_DIR}/remove-deps.cmake" - VERBATIM - APPEND -) - -if((CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS") AND BUILD_SHARED_LIBS) - if(DEFINED CMAKE_INSTALL_NAME_DIR) - set(ID_PREFIX "${CMAKE_INSTALL_NAME_DIR}") - else() - set(ID_PREFIX "@rpath") - endif() - - add_custom_command( - TARGET build_libs - COMMAND /usr/bin/install_name_tool -id "${ID_PREFIX}/libssl.${SHLIB_VERSION}.dylib" - "${BUILDDIR}/libssl.${SHLIB_VERSION}.dylib" - COMMAND /usr/bin/install_name_tool -id "${ID_PREFIX}/libcrypto.${SHLIB_VERSION}.dylib" - "${BUILDDIR}/libcrypto.1.1.dylib" - COMMAND /usr/bin/install_name_tool -change "${CMAKE_INSTALL_PREFIX}/lib/libcrypto.${SHLIB_VERSION}.dylib" - "${ID_PREFIX}/libcrypto.${SHLIB_VERSION}.dylib" - "${BUILDDIR}/libssl.${SHLIB_VERSION}.dylib" - VERBATIM - ) -endif() - -install( - FILES ${INSTALL_LIBS} - DESTINATION lib -) -install( - FILES ${INSTALL_BINS} - DESTINATION bin -) -install( - FILES ${INSTALL_PKG_CONFIGS} - DESTINATION lib/pkgconfig -) diff --git a/cpp/azure/vcpkg-custom-ports/openssl/unix/portfile.cmake b/cpp/azure/vcpkg-custom-ports/openssl/unix/portfile.cmake deleted file mode 100644 index 7a04ae7c9dc3d..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/unix/portfile.cmake +++ /dev/null @@ -1,38 +0,0 @@ -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH MASTER_COPY_SOURCE_PATH - ARCHIVE "${ARCHIVE}" - REF ${OPENSSL_VERSION} -) - -if(CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES make perl) - set(MAKE ${MSYS_ROOT}/usr/bin/make.exe) - set(PERL ${MSYS_ROOT}/usr/bin/perl.exe) -else() - find_program(MAKE make) - if(NOT MAKE) - message(FATAL_ERROR "Could not find make. Please install it through your package manager.") - endif() -endif() - -vcpkg_cmake_configure( - SOURCE_PATH ${CMAKE_CURRENT_LIST_DIR} - OPTIONS - -DSOURCE_PATH=${MASTER_COPY_SOURCE_PATH} - -DPERL=${PERL} - -DMAKE=${MAKE} - -DVCPKG_CONCURRENCY=${VCPKG_CONCURRENCY} -) - -vcpkg_cmake_install() -vcpkg_fixup_pkgconfig() - -file(GLOB HEADERS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/include/openssl/*.h) -set(RESOLVED_HEADERS) -foreach(HEADER ${HEADERS}) - get_filename_component(X "${HEADER}" REALPATH) - list(APPEND RESOLVED_HEADERS "${X}") -endforeach() - -file(INSTALL ${RESOLVED_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include/openssl) -file(INSTALL ${MASTER_COPY_SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/cpp/azure/vcpkg-custom-ports/openssl/unix/remove-deps.cmake b/cpp/azure/vcpkg-custom-ports/openssl/unix/remove-deps.cmake deleted file mode 100644 index a57c70fe91e94..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/unix/remove-deps.cmake +++ /dev/null @@ -1,7 +0,0 @@ -file(GLOB_RECURSE MAKEFILES ${DIR}/*/Makefile) -foreach(MAKEFILE ${MAKEFILES}) - message("removing deps from ${MAKEFILE}") - file(READ "${MAKEFILE}" _contents) - string(REGEX REPLACE "\n# DO NOT DELETE THIS LINE.*" "" _contents "${_contents}") - file(WRITE "${MAKEFILE}" "${_contents}") -endforeach() diff --git a/cpp/azure/vcpkg-custom-ports/openssl/usage b/cpp/azure/vcpkg-custom-ports/openssl/usage deleted file mode 100644 index f535cb6a401cc..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package openssl is compatible with built-in CMake targets: - - find_package(OpenSSL REQUIRED) - target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto) diff --git a/cpp/azure/vcpkg-custom-ports/openssl/uwp/EnableUWPSupport.patch b/cpp/azure/vcpkg-custom-ports/openssl/uwp/EnableUWPSupport.patch deleted file mode 100644 index fe7837445985c..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/uwp/EnableUWPSupport.patch +++ /dev/null @@ -1,170 +0,0 @@ -diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf -index 3c4299d264..99fcb1f713 100644 ---- a/Configurations/10-main.conf -+++ b/Configurations/10-main.conf -@@ -1287,7 +1287,7 @@ my %targets = ( - }, - "VC-WIN64I" => { - inherit_from => [ "VC-WIN64-common", asm("ia64_asm"), -- sub { $disabled{shared} ? () : "ia64_uplink" } ], -+ sub { $disabled{uplink} ? () : "ia64_uplink" } ], - AS => "ias", - ASFLAGS => "-d debug", - asoutflag => "-o ", -@@ -1299,7 +1299,7 @@ my %targets = ( - }, - "VC-WIN64A" => { - inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"), -- sub { $disabled{shared} ? () : "x86_64_uplink" } ], -+ sub { $disabled{uplink} ? () : "x86_64_uplink" } ], - AS => sub { vc_win64a_info()->{AS} }, - ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} }, - asoutflag => sub { vc_win64a_info()->{asoutflag} }, -@@ -1312,7 +1312,7 @@ my %targets = ( - }, - "VC-WIN32" => { - inherit_from => [ "VC-noCE-common", asm("x86_asm"), -- sub { $disabled{shared} ? () : "uplink_common" } ], -+ sub { $disabled{uplink} ? () : "uplink_common" } ], - AS => sub { vc_win32_info()->{AS} }, - ASFLAGS => sub { vc_win32_info()->{ASFLAGS} }, - asoutflag => sub { vc_win32_info()->{asoutflag} }, -@@ -1374,7 +1374,7 @@ my %targets = ( - #### MinGW - "mingw" => { - inherit_from => [ "BASE_unix", asm("x86_asm"), -- sub { $disabled{shared} ? () : "x86_uplink" } ], -+ sub { $disabled{uplink} ? () : "x86_uplink" } ], - CC => "gcc", - CFLAGS => picker(default => "-Wall", - debug => "-g -O0", -diff --git a/Configurations/50-win-onecore.conf b/Configurations/50-win-onecore.conf -index d478f42b0f..e0fb70daca 100644 ---- a/Configurations/50-win-onecore.conf -+++ b/Configurations/50-win-onecore.conf -@@ -1,3 +1,4 @@ -+## -*- mode: perl; -*- - # Windows OneCore targets. - # - # OneCore is new API stability "contract" that transcends Desktop, IoT and -@@ -10,6 +11,25 @@ - # TODO: extend error handling to use ETW based eventing - # (Or rework whole error messaging) - -+my $UWP_info = {}; -+sub UWP_info { -+ unless (%$UWP_info) { -+ my $SDKver = `pwsh.exe -Command \"& {\$(Get-Item \\\"hklm:\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\\").GetValue(\\\"CurrentVersion\\\")}\"`; -+ $SDKver =~ s|\R$||; -+ my @SDKver_split = split(/\./, $SDKver); -+ # SDK version older than 10.0.17763 don't support our ASM builds -+ if ($SDKver_split[0] < 10 -+ || ($SDKver_split[0] == 10 -+ && $SDKver_split[1] == 0 -+ && $SDKver_split[2] < 17763)) { -+ $UWP_info->{disable} = [ 'asm' ]; -+ } else { -+ $UWP_info->{disable} = [ ]; -+ } -+ } -+ return $UWP_info; -+} -+ - my %targets = ( - "VC-WIN32-ONECORE" => { - inherit_from => [ "VC-WIN32" ], -@@ -61,4 +81,57 @@ my %targets = ( - ex_libs => "onecore.lib", - multilib => "-arm64", - }, -+ -+ # Universal Windows Platform (UWP) App Support -+ -+ # TODO -+ # -+ # The 'disable' attribute should have 'uplink'. -+ # however, these are checked in some 'inherit_from', which is processed -+ # very early, before the 'disable' attributes are seen. -+ # This is a problem that needs to be resolved in Configure first. -+ # -+ # But if you want to build library with Windows 10 Version 1809 SDK or -+ # earlier, the 'disable' attribute should also have 'asm'. -+ -+ "VC-WIN32-UWP" => { -+ inherit_from => [ "VC-WIN32-ONECORE" ], -+ lflags => add("/APPCONTAINER"), -+ defines => add("WINAPI_FAMILY=WINAPI_FAMILY_APP", -+ "_WIN32_WINNT=0x0A00"), -+ dso_scheme => "", -+ disable => sub { [ 'ui-console', 'stdio', 'async', 'uplink', -+ @{ UWP_info()->{disable} } ] }, -+ ex_libs => "WindowsApp.lib", -+ }, -+ "VC-WIN64A-UWP" => { -+ inherit_from => [ "VC-WIN64A-ONECORE" ], -+ lflags => add("/APPCONTAINER"), -+ defines => add("WINAPI_FAMILY=WINAPI_FAMILY_APP", -+ "_WIN32_WINNT=0x0A00"), -+ dso_scheme => "", -+ disable => sub { [ 'ui-console', 'stdio', 'async', 'uplink', -+ @{ UWP_info()->{disable} } ] }, -+ ex_libs => "WindowsApp.lib", -+ }, -+ "VC-WIN32-ARM-UWP" => { -+ inherit_from => [ "VC-WIN32-ARM" ], -+ lflags => add("/APPCONTAINER"), -+ defines => add("WINAPI_FAMILY=WINAPI_FAMILY_APP", -+ "_WIN32_WINNT=0x0A00"), -+ dso_scheme => "", -+ disable => sub { [ 'ui-console', 'stdio', 'async', 'uplink', -+ @{ UWP_info()->{disable} } ] }, -+ ex_libs => "WindowsApp.lib", -+ }, -+ "VC-WIN64-ARM-UWP" => { -+ inherit_from => [ "VC-WIN64-ARM" ], -+ lflags => add("/APPCONTAINER"), -+ defines => add("WINAPI_FAMILY=WINAPI_FAMILY_APP", -+ "_WIN32_WINNT=0x0A00"), -+ dso_scheme => "", -+ disable => sub { [ 'ui-console', 'stdio', 'async', 'uplink', -+ @{ UWP_info()->{disable} } ] }, -+ ex_libs => "WindowsApp.lib", -+ }, - ); -diff --git a/Configure b/Configure -index 5a699836f3..de45f1e299 100755 ---- a/Configure -+++ b/Configure -@@ -407,6 +408,7 @@ my @disablables = ( - "ubsan", - "ui-console", - "unit-test", -+ "uplink", - "whirlpool", - "weak-ssl-ciphers", - "zlib", -@@ -491,8 +493,8 @@ my @disable_cascades = ( - - # Without position independent code, there can be no shared libraries or DSOs - "pic" => [ "shared" ], -- "shared" => [ "dynamic-engine" ], -+ "shared" => [ "dynamic-engine", "uplink" ], - "dso" => [ "dynamic-engine" ], - "engine" => [ "afalgeng", "devcryptoeng" ], - - # no-autoalginit is only useful when building non-shared -diff --git a/INSTALL b/INSTALL -index 2119cbae9e..ee54e8c215 100644 ---- a/INSTALL -+++ b/INSTALL -@@ -560,6 +560,10 @@ - likely to complement configuration command line with - suitable compiler-specific option. - -+ no-uplink -+ Don't build support for UPLINK interface. -+ -+ - no- - Don't build support for negotiating the specified SSL/TLS - protocol (one of ssl, ssl3, tls, tls1, tls1_1, tls1_2, diff --git a/cpp/azure/vcpkg-custom-ports/openssl/uwp/make-openssl.bat b/cpp/azure/vcpkg-custom-ports/openssl/uwp/make-openssl.bat deleted file mode 100644 index 6f6166a24e980..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/uwp/make-openssl.bat +++ /dev/null @@ -1,16 +0,0 @@ -set build=%1 - -perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL -FS -FIWindows.h - -for /D %%f in ("%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.FoundationContract\*") do set LibPath=%LibPath%;%%f\ -for /D %%f in ("%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.UniversalApiContract\*") do set LibPath=%LibPath%;%%f\ -for /D %%f in ("%WindowsSdkDir%References\Windows.Foundation.FoundationContract\*") do set LibPath=%LibPath%;%%f\ -for /D %%f in ("%WindowsSdkDir%References\Windows.Foundation.UniversalApiContract\*") do set LibPath=%LibPath%;%%f\ - -call ms\do_winuniversal.bat - -mkdir inc32\openssl - -jom -j %NUMBER_OF_PROCESSORS% -k -f ms\ntdll.mak -REM due to a race condition in the build, we need to have a second single-threaded pass. -nmake -f ms\ntdll.mak diff --git a/cpp/azure/vcpkg-custom-ports/openssl/uwp/portfile.cmake b/cpp/azure/vcpkg-custom-ports/openssl/uwp/portfile.cmake deleted file mode 100644 index 9414634fe2057..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/uwp/portfile.cmake +++ /dev/null @@ -1,163 +0,0 @@ -vcpkg_find_acquire_program(JOM) -get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) -vcpkg_add_to_path("${PERL_EXE_PATH}") - -set(OPENSSL_SHARED no-shared) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(OPENSSL_SHARED shared) -endif() - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES - uwp/EnableUWPSupport.patch -) - -vcpkg_find_acquire_program(NASM) -get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) -vcpkg_add_to_path(PREPEND "${NASM_EXE_PATH}") - -set(CONFIGURE_COMMAND ${PERL} Configure - enable-static-engine - enable-capieng - no-unit-test - no-ssl2 - no-asm - no-uplink - no-tests - -utf-8 - ${OPENSSL_SHARED} -) - -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(OPENSSL_ARCH VC-WIN32-UWP) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(OPENSSL_ARCH VC-WIN64A-UWP) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(OPENSSL_ARCH VC-WIN32-ARM-UWP) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(OPENSSL_ARCH VC-WIN64-ARM-UWP) -else() - message(FATAL_ERROR "Unsupported target architecture: ${VCPKG_TARGET_ARCHITECTURE}") -endif() - -set(OPENSSL_MAKEFILE "makefile") - -file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - - -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - - # Copy openssl sources. - message(STATUS "Copying openssl release source files...") - file(GLOB OPENSSL_SOURCE_FILES "${SOURCE_PATH}/*") - foreach(SOURCE_FILE ${OPENSSL_SOURCE_FILES}) - file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - endforeach() - message(STATUS "Copying openssl release source files... done") - set(SOURCE_PATH_RELEASE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - - set(OPENSSLDIR_RELEASE "${CURRENT_PACKAGES_DIR}") - - message(STATUS "Configure ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND ${CONFIGURE_COMMAND} ${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_RELEASE}" "--openssldir=${OPENSSLDIR_RELEASE}" -FS - WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" - LOGNAME configure-perl-${TARGET_TRIPLET}-${VCPKG_BUILD_TYPE}-rel - ) - message(STATUS "Configure ${TARGET_TRIPLET}-rel done") - - message(STATUS "Build ${TARGET_TRIPLET}-rel") - # Openssl's buildsystem has a race condition which will cause JOM to fail at some point. - # This is ok; we just do as much work as we can in parallel first, then follow up with a single-threaded build. - make_directory(${SOURCE_PATH_RELEASE}/inc32/openssl) - execute_process( - COMMAND "${JOM}" -k -j ${VCPKG_CONCURRENCY} -f "${OPENSSL_MAKEFILE}" build_libs - WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" - OUTPUT_FILE "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-out.log" - ERROR_FILE "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-err.log" - ) - vcpkg_execute_required_process( - COMMAND nmake -f "${OPENSSL_MAKEFILE}" install_dev - WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" - LOGNAME build-${TARGET_TRIPLET}-rel-1) - - message(STATUS "Build ${TARGET_TRIPLET}-rel done") -endif() - - -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - # Copy openssl sources. - message(STATUS "Copying openssl debug source files...") - file(GLOB OPENSSL_SOURCE_FILES ${SOURCE_PATH}/*) - foreach(SOURCE_FILE ${OPENSSL_SOURCE_FILES}) - file(COPY "${SOURCE_FILE}" DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - endforeach() - message(STATUS "Copying openssl debug source files... done") - set(SOURCE_PATH_DEBUG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - - set(OPENSSLDIR_DEBUG "${CURRENT_PACKAGES_DIR}/debug") - - message(STATUS "Configure ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND ${CONFIGURE_COMMAND} debug-${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_DEBUG}" "--openssldir=${OPENSSLDIR_DEBUG}" -FS - WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" - LOGNAME configure-perl-${TARGET_TRIPLET}-${VCPKG_BUILD_TYPE}-dbg - ) - message(STATUS "Configure ${TARGET_TRIPLET}-dbg done") - - message(STATUS "Build ${TARGET_TRIPLET}-dbg") - make_directory("${SOURCE_PATH_DEBUG}/inc32/openssl") - execute_process( - COMMAND "${JOM}" -k -j ${VCPKG_CONCURRENCY} -f "${OPENSSL_MAKEFILE}" build_libs - WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" - OUTPUT_FILE "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-out.log" - ERROR_FILE "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-err.log" - ) - vcpkg_execute_required_process( - COMMAND nmake -f "${OPENSSL_MAKEFILE}" install_dev - WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" - LOGNAME build-${TARGET_TRIPLET}-dbg-1) - - message(STATUS "Build ${TARGET_TRIPLET}-dbg done") -endif() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/certs") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/private") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/engines-1_1") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/certs") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/engines-1_1") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/private") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -file(REMOVE - "${CURRENT_PACKAGES_DIR}/bin/openssl.exe" - "${CURRENT_PACKAGES_DIR}/debug/bin/openssl.exe" - "${CURRENT_PACKAGES_DIR}/debug/openssl.cnf" - "${CURRENT_PACKAGES_DIR}/openssl.cnf" - "${CURRENT_PACKAGES_DIR}/ct_log_list.cnf" - "${CURRENT_PACKAGES_DIR}/ct_log_list.cnf.dist" - "${CURRENT_PACKAGES_DIR}/openssl.cnf.dist" - "${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf" - "${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf.dist" - "${CURRENT_PACKAGES_DIR}/debug/openssl.cnf.dist" -) - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - # They should be empty, only the exes deleted above were in these directories - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin/") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin/") -endif() - -file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" _contents) -string(REPLACE "" "" _contents "${_contents}") -file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" "${_contents}") - -file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" _contents) -string(REPLACE "# include " "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include " _contents "${_contents}") -file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" "${_contents}") - -vcpkg_copy_pdbs() - -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/cpp/azure/vcpkg-custom-ports/openssl/vcpkg-cmake-wrapper.cmake.in b/cpp/azure/vcpkg-custom-ports/openssl/vcpkg-cmake-wrapper.cmake.in deleted file mode 100644 index 4a5ee893a2fe2..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/vcpkg-cmake-wrapper.cmake.in +++ /dev/null @@ -1,78 +0,0 @@ -cmake_policy(PUSH) -cmake_policy(SET CMP0012 NEW) -cmake_policy(SET CMP0054 NEW) -cmake_policy(SET CMP0057 NEW) - -if(OPENSSL_USE_STATIC_LIBS) - if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "dynamic") - message(WARNING "OPENSSL_USE_STATIC_LIBS is set, but vcpkg port openssl was built with dynamic linkage") - endif() - set(OPENSSL_USE_STATIC_LIBS_BAK "${OPENSSL_USE_STATIC_LIBS}") - set(OPENSSL_USE_STATIC_LIBS FALSE) -endif() - -if(DEFINED OPENSSL_ROOT_DIR) - set(OPENSSL_ROOT_DIR_BAK "${OPENSSL_ROOT_DIR}") -endif() -get_filename_component(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) -get_filename_component(OPENSSL_ROOT_DIR "${OPENSSL_ROOT_DIR}" DIRECTORY) -find_path(OPENSSL_INCLUDE_DIR NAMES openssl/ssl.h PATH "${OPENSSL_ROOT_DIR}/include" NO_DEFAULT_PATH) -if(MSVC) - find_library(LIB_EAY_DEBUG NAMES libcrypto PATHS "${OPENSSL_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH) - find_library(LIB_EAY_RELEASE NAMES libcrypto PATHS "${OPENSSL_ROOT_DIR}/lib" NO_DEFAULT_PATH) - find_library(SSL_EAY_DEBUG NAMES libssl PATHS "${OPENSSL_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH) - find_library(SSL_EAY_RELEASE NAMES libssl PATHS "${OPENSSL_ROOT_DIR}/lib" NO_DEFAULT_PATH) -elseif(WIN32) - find_library(LIB_EAY NAMES libcrypto crypto NAMES_PER_DIR) - find_library(SSL_EAY NAMES libssl ssl NAMES_PER_DIR) -else() - find_library(OPENSSL_CRYPTO_LIBRARY NAMES crypto) - find_library(OPENSSL_SSL_LIBRARY NAMES ssl) -endif() - -_find_package(${ARGS}) - -unset(OPENSSL_ROOT_DIR) -if(DEFINED OPENSSL_ROOT_DIR_BAK) - set(OPENSSL_ROOT_DIR "${OPENSSL_ROOT_DIR_BAK}") - unset(OPENSSL_ROOT_DIR_BAK) -endif() - -if(DEFINED OPENSSL_USE_STATIC_LIBS_BAK) - set(OPENSSL_USE_STATIC_LIBS "${OPENSSL_USE_STATIC_LIBS_BAK}") - unset(OPENSSL_USE_STATIC_LIBS_BAK) -endif() - -if(OPENSSL_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") - if(WIN32) - list(APPEND OPENSSL_LIBRARIES crypt32 ws2_32) - if(TARGET OpenSSL::Crypto) - set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "crypt32;ws2_32") - endif() - if(TARGET OpenSSL::SSL) - set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "crypt32;ws2_32") - endif() - else() - find_library(OPENSSL_DL_LIBRARY NAMES dl) - if(OPENSSL_DL_LIBRARY) - list(APPEND OPENSSL_LIBRARIES "dl") - if(TARGET OpenSSL::Crypto) - set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "dl") - endif() - endif() - - if("REQUIRED" IN_LIST ARGS) - find_package(Threads REQUIRED) - else() - find_package(Threads) - endif() - list(APPEND OPENSSL_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) - if(TARGET OpenSSL::Crypto) - set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads") - endif() - if(TARGET OpenSSL::SSL) - set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads") - endif() - endif() -endif() -cmake_policy(POP) diff --git a/cpp/azure/vcpkg-custom-ports/openssl/vcpkg.json b/cpp/azure/vcpkg-custom-ports/openssl/vcpkg.json deleted file mode 100644 index beb5807743e1a..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/vcpkg.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "openssl", - "version-string": "1.1.1n", - "port-version": 1, - "description": "OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.", - "homepage": "https://www.openssl.org", - "license": "OpenSSL", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] -} diff --git a/cpp/azure/vcpkg-custom-ports/openssl/windows/portfile.cmake b/cpp/azure/vcpkg-custom-ports/openssl/windows/portfile.cmake deleted file mode 100644 index 5a0dec0b730ac..0000000000000 --- a/cpp/azure/vcpkg-custom-ports/openssl/windows/portfile.cmake +++ /dev/null @@ -1,172 +0,0 @@ -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} -) - -vcpkg_find_acquire_program(NASM) -get_filename_component(NASM_EXE_PATH "${NASM}" DIRECTORY) -vcpkg_add_to_path(PREPEND "${NASM_EXE_PATH}") - -vcpkg_find_acquire_program(JOM) - -set(OPENSSL_SHARED no-shared) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(OPENSSL_SHARED shared) -endif() - -set(CONFIGURE_OPTIONS - enable-static-engine - enable-capieng - no-ssl2 - no-tests - -utf-8 - ${OPENSSL_SHARED} -) - -if(DEFINED OPENSSL_USE_NOPINSHARED) - set(CONFIGURE_OPTIONS ${CONFIGURE_OPTIONS} no-pinshared) -endif() - -if(OPENSSL_NO_AUTOLOAD_CONFIG) - set(CONFIGURE_OPTIONS ${CONFIGURE_OPTIONS} no-autoload-config) -endif() - -set(CONFIGURE_COMMAND "${PERL}" Configure ${CONFIGURE_OPTIONS}) - -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(OPENSSL_ARCH VC-WIN32) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(OPENSSL_ARCH VC-WIN64A) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(OPENSSL_ARCH VC-WIN32-ARM) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(OPENSSL_ARCH VC-WIN64-ARM) -else() - message(FATAL_ERROR "Unsupported target architecture: ${VCPKG_TARGET_ARCHITECTURE}") -endif() - -set(OPENSSL_MAKEFILE "makefile") - -file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - - # Copy openssl sources. - message(STATUS "Copying openssl release source files...") - file(GLOB OPENSSL_SOURCE_FILES ${SOURCE_PATH}/*) - foreach(SOURCE_FILE ${OPENSSL_SOURCE_FILES}) - file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - endforeach() - message(STATUS "Copying openssl release source files... done") - set(SOURCE_PATH_RELEASE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - - set(OPENSSLDIR_RELEASE ${CURRENT_PACKAGES_DIR}) - - message(STATUS "Configure ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND ${CONFIGURE_COMMAND} ${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_RELEASE}" "--openssldir=${OPENSSLDIR_RELEASE}" -FS - WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} - LOGNAME configure-perl-${TARGET_TRIPLET}-rel - ) - message(STATUS "Configure ${TARGET_TRIPLET}-rel done") - - message(STATUS "Build ${TARGET_TRIPLET}-rel") - # Openssl's buildsystem has a race condition which will cause JOM to fail at some point. - # This is ok; we just do as much work as we can in parallel first, then follow up with a single-threaded build. - make_directory(${SOURCE_PATH_RELEASE}/inc32/openssl) - execute_process( - COMMAND "${JOM}" -k -j "${VCPKG_CONCURRENCY}" -f "${OPENSSL_MAKEFILE}" - WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} - OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-out.log - ERROR_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-0-err.log - ) - vcpkg_execute_required_process( - COMMAND "${JOM}" -j 1 -f "${OPENSSL_MAKEFILE}" install_sw install_ssldirs - WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} - LOGNAME build-${TARGET_TRIPLET}-rel-1) - - message(STATUS "Build ${TARGET_TRIPLET}-rel done") -endif() - - -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - # Copy openssl sources. - message(STATUS "Copying openssl debug source files...") - file(GLOB OPENSSL_SOURCE_FILES ${SOURCE_PATH}/*) - foreach(SOURCE_FILE ${OPENSSL_SOURCE_FILES}) - file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - endforeach() - message(STATUS "Copying openssl debug source files... done") - set(SOURCE_PATH_DEBUG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - - set(OPENSSLDIR_DEBUG ${CURRENT_PACKAGES_DIR}/debug) - - message(STATUS "Configure ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND ${CONFIGURE_COMMAND} debug-${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_DEBUG}" "--openssldir=${OPENSSLDIR_DEBUG}" -FS - WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} - LOGNAME configure-perl-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Configure ${TARGET_TRIPLET}-dbg done") - - message(STATUS "Build ${TARGET_TRIPLET}-dbg") - make_directory(${SOURCE_PATH_DEBUG}/inc32/openssl) - execute_process( - COMMAND "${JOM}" -k -j "${VCPKG_CONCURRENCY}" -f "${OPENSSL_MAKEFILE}" - WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} - OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-out.log - ERROR_FILE ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-dbg-0-err.log - ) - vcpkg_execute_required_process( - COMMAND "${JOM}" -j 1 -f "${OPENSSL_MAKEFILE}" install_sw install_ssldirs - WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} - LOGNAME build-${TARGET_TRIPLET}-dbg-1) - - message(STATUS "Build ${TARGET_TRIPLET}-dbg done") -endif() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/certs") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/private") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/engines-1_1") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/certs") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/engines-1_1") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/private") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -file(REMOVE - "${CURRENT_PACKAGES_DIR}/ct_log_list.cnf" - "${CURRENT_PACKAGES_DIR}/ct_log_list.cnf.dist" - "${CURRENT_PACKAGES_DIR}/openssl.cnf.dist" - "${CURRENT_PACKAGES_DIR}/debug/bin/openssl.exe" - "${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf" - "${CURRENT_PACKAGES_DIR}/debug/ct_log_list.cnf.dist" - "${CURRENT_PACKAGES_DIR}/debug/openssl.cnf" - "${CURRENT_PACKAGES_DIR}/debug/openssl.cnf.dist" -) - -file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/openssl/") -file(RENAME "${CURRENT_PACKAGES_DIR}/bin/openssl.exe" "${CURRENT_PACKAGES_DIR}/tools/openssl/openssl.exe") -file(RENAME "${CURRENT_PACKAGES_DIR}/openssl.cnf" "${CURRENT_PACKAGES_DIR}/tools/openssl/openssl.cnf") - -vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/openssl") - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - # They should be empty, only the exes deleted above were in these directories - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin/") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin/") -endif() - -vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" - "" - "" -) - -vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" - "# include " - "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include " -) - -vcpkg_copy_pdbs() - -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 1e49bbeaf755f..1b1703d6d20ac 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5148,21 +5148,6 @@ macro(build_azuresdk) set(AZURESDK_INCLUDE_DIR "${AZURESDK_PREFIX}/include") set(AZURESDK_LIB_DIR "lib") - # provide hint for Azure SDK to link with the already located openssl - # get_filename_component(OPENSSL_ROOT_HINT "${OPENSSL_INCLUDE_DIR}" DIRECTORY) - - # -DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} - # -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} - # -DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} - # -Dcrypto_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} - # -Dcrypto_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) - # if(ARROW_OPENSSL_USE_SHARED) - # list(APPEND AWSSDK_COMMON_CMAKE_ARGS - # -Dcrypto_SHARED_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) - # else() - # list(APPEND AWSSDK_COMMON_CMAKE_ARGS - # -Dcrypto_STATIC_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) - set(AZURESDK_COMMON_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=" @@ -5174,10 +5159,13 @@ macro(build_azuresdk) -DENABLE_UNITY_BUILD=ON -DWARNINGS_AS_ERRORS=OFF) - if("${OPENSSL_VERSION}" LESS 3) + if(OPENSSL_VERSION_MAJOR EQUAL 1) list(APPEND AZURESDK_COMMON_CMAKE_ARGS - -DVCPKG_OVERLAY_PORTS=${PROJECT_SOURCE_DIR}/azure/vcpkg-custom-ports) + -DVCPKG_OVERLAY_PORTS=${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-prefix/src/azuresdk_ep/vcpkg-custom-ports) + elseif(OPENSSL_VERSION_MAJOR EQUAL 3) + else() + message(FATAL_ERROR "Unknown OpenSSL version: ${OPENSSL_VERSION}") endif() file(MAKE_DIRECTORY ${AZURESDK_INCLUDE_DIR}) From 322f48ad3382f3cb12b96a9f49f5195387c3a599 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sun, 23 Jul 2023 00:54:52 +0100 Subject: [PATCH 15/93] Working test that writes then reads back from azurite --- cpp/src/arrow/filesystem/azurefs_test.cc | 25 ++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index 594bf4004376e..44992e7837144 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -40,8 +40,8 @@ #include #include -#include #include +#include #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" @@ -112,19 +112,32 @@ AzuriteEnv* GetAzuriteEnv() { return ::arrow::internal::checked_cast(azurite_env); } -// Placeholder test for file structure +// Placeholder tests for file structure // TODO: GH-18014 Remove once a proper test is added TEST(AzureFileSystem, InitialiseClient) { + const std::string containerName = "sample-container"; + const std::string blobName = "sample-blob.txt"; + const std::string blobContent = "Hello Azure!"; + const std::string& account_name = GetAzuriteEnv()->account_name(); const std::string& account_key = GetAzuriteEnv()->account_key(); auto credential = std::make_shared( account_name, account_key); - auto blockBlobClient = Azure::Storage::Blobs::BlockBlobClient( - "http://127.0.0.1:10000/devstoreaccount1/container/file.parquet", credential); - blockBlobClient.DownloadTo("test.parquet"); - EXPECT_FALSE(true); + auto serviceClient = Azure::Storage::Blobs::BlobServiceClient( + "http://127.0.0.1:10000/devstoreaccount1", credential); + auto containerClient = serviceClient.GetBlobContainerClient(containerName); + containerClient.CreateIfNotExists(); + auto blobClient = containerClient.GetBlockBlobClient(blobName); + + std::vector buffer(blobContent.begin(), blobContent.end()); + blobClient.UploadFrom(buffer.data(), buffer.size()); + + std::vector buffer2(blobContent.size()); + blobClient.DownloadTo(buffer2.data(), buffer2.size()); + + EXPECT_EQ(std::string(buffer2.begin(), buffer2.end()), blobContent); } TEST(AzureFileSystem, OptionsCompare) { From 8fad9c09881cd65730088645767d50b90cb0e53e Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sun, 23 Jul 2023 13:46:51 +0100 Subject: [PATCH 16/93] Add a test that initialises different credentials --- cpp/src/arrow/filesystem/azurefs_test.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index 44992e7837144..58694cf2fa39c 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -46,6 +46,9 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" +#include +#include +#include #include #include @@ -63,7 +66,6 @@ using ::testing::NotNull; class AzuriteEnv : public ::testing::Environment { public: AzuriteEnv() { - std::cout << "Starting Azurite emulator..." << std::endl; account_name_ = "devstoreaccount1"; account_key_ = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/" @@ -85,7 +87,6 @@ class AzuriteEnv : public ::testing::Environment { status_ = Status::Invalid(error); return; } - std::cout << "Azurite emulator started." << std::endl; status_ = Status::OK(); } @@ -114,7 +115,7 @@ AzuriteEnv* GetAzuriteEnv() { // Placeholder tests for file structure // TODO: GH-18014 Remove once a proper test is added -TEST(AzureFileSystem, InitialiseClient) { +TEST(AzureFileSystem, UploadThenDownload) { const std::string containerName = "sample-container"; const std::string blobName = "sample-blob.txt"; const std::string blobContent = "Hello Azure!"; @@ -140,6 +141,15 @@ TEST(AzureFileSystem, InitialiseClient) { EXPECT_EQ(std::string(buffer2.begin(), buffer2.end()), blobContent); } +TEST(AzureFileSystem, InitialiseCredentials) { + auto defaultCredential = std::make_shared(); + auto managedIdentityCredential = + std::make_shared(); + auto servicePrincipalCredential = + std::make_shared("tenant_id", "client_id", + "client_secret"); +} + TEST(AzureFileSystem, OptionsCompare) { AzureOptions options; EXPECT_TRUE(options.Equals(options)); From 4704d059d9b8ed59cb5b411052b23c1be743e04f Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sun, 23 Jul 2023 15:42:23 +0100 Subject: [PATCH 17/93] Fix finding the system xml2 --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 58 ++++++++++++--------- cpp/thirdparty/versions.txt | 6 +-- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 1b1703d6d20ac..22aff2acf683c 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -74,7 +74,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES xsimd ZLIB zstd - xml2 + LibXml2 ) # For backward compatibility. We use "BOOST_SOURCE" if "Boost_SOURCE" @@ -216,8 +216,8 @@ macro(build_dependency DEPENDENCY_NAME) build_zstd() elseif("${DEPENDENCY_NAME}" STREQUAL "AZURE_SDK") build_azuresdk() - elseif("${DEPENDENCY_NAME}" STREQUAL "xml2") - build_xml2() + elseif("${DEPENDENCY_NAME}" STREQUAL "LibXml2") + build_libxml2() else() message(FATAL_ERROR "Unknown thirdparty dependency to build: ${DEPENDENCY_NAME}") endif() @@ -237,6 +237,7 @@ macro(provide_find_module PACKAGE_NAME ARROW_CMAKE_PACKAGE_NAME) endmacro() macro(resolve_dependency DEPENDENCY_NAME) + message(STATUS "Resolving dependency ${DEPENDENCY_NAME}") set(options) set(one_value_args ARROW_CMAKE_PACKAGE_NAME @@ -287,12 +288,15 @@ macro(resolve_dependency DEPENDENCY_NAME) if(COMPATIBLE) set(${DEPENDENCY_NAME}_SOURCE "SYSTEM") else() + message(STATUS "Using bundled ${DEPENDENCY_NAME}") build_dependency(${DEPENDENCY_NAME}) set(${DEPENDENCY_NAME}_SOURCE "BUNDLED") endif() elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "BUNDLED") + message(STATUS "Using bundled2 ${DEPENDENCY_NAME}") build_dependency(${DEPENDENCY_NAME}) elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM") + message(STATUS "Using system ${DEPENDENCY_NAME}, ${FIND_PACKAGE_ARGUMENTS}") find_package(${FIND_PACKAGE_ARGUMENTS} REQUIRED) if(ARG_FORCE_ANY_NEWER_VERSION AND ARG_REQUIRED_VERSION) if(${${PACKAGE_NAME}_VERSION} VERSION_LESS ${ARG_REQUIRED_VERSION}) @@ -379,7 +383,7 @@ endif() # Enable Azure if(ARROW_AZURE) set(ARROW_WITH_AZURE_SDK ON) - set(ARROW_WITH_XML2 ON) + set(ARROW_WITH_LIBXML2 ON) endif() if(ARROW_JSON) @@ -693,11 +697,11 @@ else() ) endif() -if(DEFINED ENV{ARROW_XML2_URL}) - set(XML2_SOURCE_URL "$ENV{ARROW_XML2_URL}") +if(DEFINED ENV{ARROW_LIBXML2_URL}) + set(LIBXML2_SOURCE_URL "$ENV{ARROW_LIBXML2_URL}") else() - set_urls(XML2_SOURCE_URL - "https://github.com/GNOME/libxml2/archive/refs/tags/${ARROW_XML2_BUILD_VERSION}.tar.gz" + set_urls(LIBXML2_SOURCE_URL + "https://github.com/GNOME/libxml2/archive/refs/tags/${ARROW_LIBXML2_BUILD_VERSION}.tar.gz" ) endif() @@ -5082,11 +5086,11 @@ endif() # ---------------------------------------------------------------------- # Azure SDK and dependencies -macro(build_xml2) +macro(build_libxml2) message(STATUS "Building xml2 from source") - # "Build" xml2 - set(XML2_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/xml2_ep-install") - set(XML2_INCLUDE_DIR "${XML2_PREFIX}/include") + # "Build" LibXml2 + set(LIBXML2_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/xml2_ep-install") + set(LIBXML2_INCLUDE_DIR "${LIBXML2_PREFIX}/include") set(XML2_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} @@ -5100,33 +5104,35 @@ macro(build_xml2) -DBUILD_SHARED_LIBS=OFF) set(_XML2_STATIC_LIBRARY - "${XML2_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}xml2${CMAKE_STATIC_LIBRARY_SUFFIX}" + "${LIBXML2_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}xml2${CMAKE_STATIC_LIBRARY_SUFFIX}" ) set(XML2_BUILD_BYPRODUCTS ${_XML2_STATIC_LIBRARY}) - externalproject_add(xml2_ep + externalproject_add(libxml2_ep ${EP_LOG_OPTIONS} - INSTALL_DIR ${XML2_PREFIX} - URL ${XML2_SOURCE_URL} - URL_HASH "SHA256=${ARROW_XML2_BUILD_SHA256_CHECKSUM}" + INSTALL_DIR ${LIBXML2_PREFIX} + URL ${LIBXML2_SOURCE_URL} + URL_HASH "SHA256=${ARROW_LIBXML2_BUILD_SHA256_CHECKSUM}" CMAKE_ARGS ${XML2_CMAKE_ARGS} BUILD_BYPRODUCTS ${XML2_BUILD_BYPRODUCTS}) # Work around https://gitlab.kitware.com/cmake/cmake/issues/15052 - file(MAKE_DIRECTORY "${XML2_INCLUDE_DIR}") + file(MAKE_DIRECTORY "${LIBXML2_INCLUDE_DIR}") add_library(LibXml2::LibXml2 STATIC IMPORTED) set_target_properties(LibXml2::LibXml2 PROPERTIES IMPORTED_LOCATION ${_XML2_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES - "${XML2_INCLUDE_DIR}") + "${LIBXML2_INCLUDE_DIR}") add_dependencies(LibXml2::LibXml2 xml2_ep) - set(XML2_VENDORED TRUE) + set(LIBXML2_VENDORED TRUE) endmacro() -if(ARROW_WITH_XML2) - resolve_dependency(xml2) - get_target_property(xml2_INCLUDE_DIR LibXml2::LibXml2 +if(ARROW_WITH_LIBXML2) + message(STATUS "Building LibXml2 from source") + resolve_dependency(LibXml2) + message(STATUS "Resolved LibXml2") + get_target_property(LIBXML2_INCLUDE_DIR LibXml2::LibXml2 INTERFACE_INCLUDE_DIRECTORIES) - message(STATUS "Found xml2 headers: ${xml2_INCLUDE_DIR}") + message(STATUS "Found xml2 headers: ${LIBXML2_INCLUDE_DIR}") endif() macro(build_azuresdk) @@ -5140,8 +5146,8 @@ macro(build_azuresdk) ${ARROW_OPENSSL_REQUIRED_VERSION}) endif() - if(XML2_VENDORED) - add_dependencies(azure_sdk_dependencies xml2_ep) + if(LIBXML2_VENDORED) + add_dependencies(azure_sdk_dependencies libxml2_ep) endif() set(AZURESDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-install") diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index 020ef9032aad7..8bc1894fe45a0 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -113,8 +113,8 @@ ARROW_UCX_BUILD_VERSION=1.12.1 ARROW_UCX_BUILD_SHA256_CHECKSUM=9bef31aed0e28bf1973d28d74d9ac4f8926c43ca3b7010bd22a084e164e31b71 ARROW_UTF8PROC_BUILD_VERSION=v2.7.0 ARROW_UTF8PROC_BUILD_SHA256_CHECKSUM=4bb121e297293c0fd55f08f83afab6d35d48f0af4ecc07523ad8ec99aa2b12a1 -ARROW_XML2_BUILD_VERSION=v2.11.4 -ARROW_XML2_BUILD_SHA256_CHECKSUM=2fd59eccfe277f7b7dec8836254acbebd24af33857a018dd64ddcf92d88d7f7e +ARROW_LIBXML2_BUILD_VERSION=v2.11.4 +ARROW_LIBXML2_BUILD_SHA256_CHECKSUM=2fd59eccfe277f7b7dec8836254acbebd24af33857a018dd64ddcf92d88d7f7e ARROW_XSIMD_BUILD_VERSION=9.0.1 ARROW_XSIMD_BUILD_SHA256_CHECKSUM=b1bb5f92167fd3a4f25749db0be7e61ed37e0a5d943490f3accdcd2cd2918cc0 ARROW_ZLIB_BUILD_VERSION=1.2.13 @@ -158,7 +158,7 @@ DEPENDENCIES=( "ARROW_LZ4_URL lz4-${ARROW_LZ4_BUILD_VERSION}.tar.gz https://github.com/lz4/lz4/archive/${ARROW_LZ4_BUILD_VERSION}.tar.gz" "ARROW_MIMALLOC_URL mimalloc-${ARROW_MIMALLOC_BUILD_VERSION}.tar.gz https://github.com/microsoft/mimalloc/archive/${ARROW_MIMALLOC_BUILD_VERSION}.tar.gz" "ARROW_NLOHMANN_JSON_URL nlohmann-json-${ARROW_NLOHMANN_JSON_BUILD_VERSION}.tar.gz https://github.com/nlohmann/json/archive/refs/tags/${ARROW_NLOHMANN_JSON_BUILD_VERSION}.tar.gz" - "ARROW_XML2_URL xml2-${ARROW_XML2_BUILD_VERSION}.tar.gz https://github.com/GNOME/libxml2/archive/refs/tags/${ARROW_XML2_BUILD_VERSION}.tar.gz" + "ARROW_LIBXML2_URL xml2-${ARROW_LIBXML2_BUILD_VERSION}.tar.gz https://github.com/GNOME/libxml2/archive/refs/tags/${ARROW_LIBXML2_BUILD_VERSION}.tar.gz" "ARROW_OPENTELEMETRY_URL opentelemetry-cpp-${ARROW_OPENTELEMETRY_BUILD_VERSION}.tar.gz https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/${ARROW_OPENTELEMETRY_BUILD_VERSION}.tar.gz" "ARROW_OPENTELEMETRY_PROTO_URL opentelemetry-proto-${ARROW_OPENTELEMETRY_PROTO_BUILD_VERSION}.tar.gz https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/${ARROW_OPENTELEMETRY_PROTO_BUILD_VERSION}.tar.gz" "ARROW_ORC_URL orc-${ARROW_ORC_BUILD_VERSION}.tar.gz https://archive.apache.org/dist/orc/orc-${ARROW_ORC_BUILD_VERSION}/orc-${ARROW_ORC_BUILD_VERSION}.tar.gz" From ef1b63833e3cac8452c87fb94883b1a612a6a50d Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 24 Jul 2023 08:42:48 +0100 Subject: [PATCH 18/93] Use bundled Azure SDK --- ci/docker/alpine-linux-3.16-cpp.dockerfile | 1 + ci/docker/debian-11-cpp.dockerfile | 1 + ci/docker/fedora-35-cpp.dockerfile | 1 + ci/docker/ubuntu-20.04-cpp.dockerfile | 1 + ci/docker/ubuntu-22.04-cpp.dockerfile | 1 + ci/scripts/cpp_build.sh | 1 + 6 files changed, 6 insertions(+) diff --git a/ci/docker/alpine-linux-3.16-cpp.dockerfile b/ci/docker/alpine-linux-3.16-cpp.dockerfile index f269fa548c141..cf63acfb249b6 100644 --- a/ci/docker/alpine-linux-3.16-cpp.dockerfile +++ b/ci/docker/alpine-linux-3.16-cpp.dockerfile @@ -95,6 +95,7 @@ ENV ARROW_ACERO=ON \ ARROW_WITH_ZLIB=ON \ ARROW_WITH_ZSTD=ON \ AWSSDK_SOURCE=BUNDLED \ + AZURE_SDK_SOURCE=BUNDLED \ google_cloud_cpp_storage_SOURCE=BUNDLED \ ORC_SOURCE=BUNDLED \ PATH=/usr/lib/ccache/:$PATH \ diff --git a/ci/docker/debian-11-cpp.dockerfile b/ci/docker/debian-11-cpp.dockerfile index 00adc6bd6b3c9..a94922a051910 100644 --- a/ci/docker/debian-11-cpp.dockerfile +++ b/ci/docker/debian-11-cpp.dockerfile @@ -117,6 +117,7 @@ ENV absl_SOURCE=BUNDLED \ ARROW_WITH_ZLIB=ON \ ARROW_WITH_ZSTD=ON \ AWSSDK_SOURCE=BUNDLED \ + AZURE_SDK_SOURCE=BUNDLED \ CC=gcc \ CXX=g++ \ google_cloud_cpp_storage_SOURCE=BUNDLED \ diff --git a/ci/docker/fedora-35-cpp.dockerfile b/ci/docker/fedora-35-cpp.dockerfile index 668e35b4435ba..53ce2a5e12aac 100644 --- a/ci/docker/fedora-35-cpp.dockerfile +++ b/ci/docker/fedora-35-cpp.dockerfile @@ -96,6 +96,7 @@ ENV absl_SOURCE=BUNDLED \ ARROW_WITH_ZLIB=ON \ ARROW_WITH_ZSTD=ON \ AWSSDK_SOURCE=BUNDLED \ + AZURE_SDK_SOURCE=BUNDLED \ CC=gcc \ CXX=g++ \ google_cloud_cpp_storage_SOURCE=BUNDLED \ diff --git a/ci/docker/ubuntu-20.04-cpp.dockerfile b/ci/docker/ubuntu-20.04-cpp.dockerfile index bb487f6a5f7d8..2b1f11f43adf4 100644 --- a/ci/docker/ubuntu-20.04-cpp.dockerfile +++ b/ci/docker/ubuntu-20.04-cpp.dockerfile @@ -173,6 +173,7 @@ ENV absl_SOURCE=BUNDLED \ ARROW_WITH_ZSTD=ON \ ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-${llvm}/bin/llvm-symbolizer \ AWSSDK_SOURCE=BUNDLED \ + AZURE_SDK_SOURCE=BUNDLED \ google_cloud_cpp_storage_SOURCE=BUNDLED \ gRPC_SOURCE=BUNDLED \ GTest_SOURCE=BUNDLED \ diff --git a/ci/docker/ubuntu-22.04-cpp.dockerfile b/ci/docker/ubuntu-22.04-cpp.dockerfile index aa313bc0e8a58..cb169afb4d109 100644 --- a/ci/docker/ubuntu-22.04-cpp.dockerfile +++ b/ci/docker/ubuntu-22.04-cpp.dockerfile @@ -200,6 +200,7 @@ ENV absl_SOURCE=BUNDLED \ ARROW_WITH_ZSTD=ON \ ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-${llvm}/bin/llvm-symbolizer \ AWSSDK_SOURCE=BUNDLED \ + AZURE_SDK_SOURCE=BUNDLED \ google_cloud_cpp_storage_SOURCE=BUNDLED \ GTest_SOURCE=BUNDLED \ ORC_SOURCE=BUNDLED \ diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh index 5a89fafc6015e..9f89cef521d69 100755 --- a/ci/scripts/cpp_build.sh +++ b/ci/scripts/cpp_build.sh @@ -152,6 +152,7 @@ cmake \ -DARROW_WITH_ZLIB=${ARROW_WITH_ZLIB:-OFF} \ -DARROW_WITH_ZSTD=${ARROW_WITH_ZSTD:-OFF} \ -DAWSSDK_SOURCE=${AWSSDK_SOURCE:-} \ + -DAZURE_SDK_SOURCE=${AZURE_SDK_SOURCE:-} \ -Dbenchmark_SOURCE=${benchmark_SOURCE:-} \ -DBOOST_SOURCE=${BOOST_SOURCE:-} \ -DBrotli_SOURCE=${Brotli_SOURCE:-} \ From 9244da35215f71f30541c8dabf22da37b892d5a1 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sun, 23 Jul 2023 17:33:05 +0100 Subject: [PATCH 19/93] manylinux build fixes --- ci/scripts/python_wheel_manylinux_build.sh | 2 +- cpp/CMakeLists.txt | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ci/scripts/python_wheel_manylinux_build.sh b/ci/scripts/python_wheel_manylinux_build.sh index bc1ac65269ca3..3cd5145df709e 100755 --- a/ci/scripts/python_wheel_manylinux_build.sh +++ b/ci/scripts/python_wheel_manylinux_build.sh @@ -125,7 +125,7 @@ cmake \ -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} \ -DORC_PROTOBUF_EXECUTABLE=${VCPKG_ROOT}/installed/${VCPKG_TARGET_TRIPLET}/tools/protobuf/protoc \ -DORC_SOURCE=BUNDLED \ - -Dxml2_SOURCE=BUNDLED \ + -DLibXml2_SOURCE=BUNDLED \ -DPARQUET_REQUIRE_ENCRYPTION=${PARQUET_REQUIRE_ENCRYPTION} \ -DVCPKG_MANIFEST_MODE=OFF \ -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} \ diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 5fc977cfc4acc..4859a3763c1c2 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -798,6 +798,14 @@ endif() if(ARROW_AZURE) list(APPEND ARROW_SHARED_LINK_LIBS ${AZURESDK_LINK_LIBRARIES}) list(APPEND ARROW_STATIC_LINK_LIBS ${AZURESDK_LINK_LIBRARIES}) + if(AZURE_SDK_SOURCE STREQUAL "SYSTEM") + list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS + Azure::azure-core + Azure::azure-identity + Azure::azure-storage-blobs + Azure::azure-storage-common + Azure::azure-storage-files-datalake) + endif() endif() if(ARROW_WITH_UTF8PROC) From 23c06a4d14b926d3d24a3b5e113f7d033f170264 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Tue, 8 Aug 2023 08:46:23 +0100 Subject: [PATCH 20/93] Remove Azure SDK bundled on alpine, fedora, debian --- ci/docker/alpine-linux-3.16-cpp.dockerfile | 1 - ci/docker/debian-11-cpp.dockerfile | 1 - ci/docker/fedora-35-cpp.dockerfile | 1 - 3 files changed, 3 deletions(-) diff --git a/ci/docker/alpine-linux-3.16-cpp.dockerfile b/ci/docker/alpine-linux-3.16-cpp.dockerfile index cf63acfb249b6..f269fa548c141 100644 --- a/ci/docker/alpine-linux-3.16-cpp.dockerfile +++ b/ci/docker/alpine-linux-3.16-cpp.dockerfile @@ -95,7 +95,6 @@ ENV ARROW_ACERO=ON \ ARROW_WITH_ZLIB=ON \ ARROW_WITH_ZSTD=ON \ AWSSDK_SOURCE=BUNDLED \ - AZURE_SDK_SOURCE=BUNDLED \ google_cloud_cpp_storage_SOURCE=BUNDLED \ ORC_SOURCE=BUNDLED \ PATH=/usr/lib/ccache/:$PATH \ diff --git a/ci/docker/debian-11-cpp.dockerfile b/ci/docker/debian-11-cpp.dockerfile index a94922a051910..00adc6bd6b3c9 100644 --- a/ci/docker/debian-11-cpp.dockerfile +++ b/ci/docker/debian-11-cpp.dockerfile @@ -117,7 +117,6 @@ ENV absl_SOURCE=BUNDLED \ ARROW_WITH_ZLIB=ON \ ARROW_WITH_ZSTD=ON \ AWSSDK_SOURCE=BUNDLED \ - AZURE_SDK_SOURCE=BUNDLED \ CC=gcc \ CXX=g++ \ google_cloud_cpp_storage_SOURCE=BUNDLED \ diff --git a/ci/docker/fedora-35-cpp.dockerfile b/ci/docker/fedora-35-cpp.dockerfile index 53ce2a5e12aac..668e35b4435ba 100644 --- a/ci/docker/fedora-35-cpp.dockerfile +++ b/ci/docker/fedora-35-cpp.dockerfile @@ -96,7 +96,6 @@ ENV absl_SOURCE=BUNDLED \ ARROW_WITH_ZLIB=ON \ ARROW_WITH_ZSTD=ON \ AWSSDK_SOURCE=BUNDLED \ - AZURE_SDK_SOURCE=BUNDLED \ CC=gcc \ CXX=g++ \ google_cloud_cpp_storage_SOURCE=BUNDLED \ From 658dc78bd83eda67bbfddef4a6e07d326f40ea38 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 9 Aug 2023 21:09:53 +0100 Subject: [PATCH 21/93] Fix merge --- ci/docker/ubuntu-22.04-cpp.dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci/docker/ubuntu-22.04-cpp.dockerfile b/ci/docker/ubuntu-22.04-cpp.dockerfile index cb169afb4d109..e4c8334701584 100644 --- a/ci/docker/ubuntu-22.04-cpp.dockerfile +++ b/ci/docker/ubuntu-22.04-cpp.dockerfile @@ -161,9 +161,6 @@ RUN /arrow/ci/scripts/install_azurite.sh COPY ci/scripts/install_sccache.sh /arrow/ci/scripts/ RUN /arrow/ci/scripts/install_sccache.sh unknown-linux-musl /usr/local/bin -COPY ci/scripts/install_azurite.sh /arrow/ci/scripts/ -RUN /arrow/ci/scripts/install_azurite.sh - # Prioritize system packages and local installation # The following dependencies will be downloaded due to missing/invalid packages # provided by the distribution: From 8e0df483e9bb9e1f2a0ecb2ef1c9b8ae7680eb9e Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 9 Aug 2023 21:28:39 +0100 Subject: [PATCH 22/93] Install zip and unzip so vcpkg can be bootstrapped --- ci/docker/ubuntu-20.04-cpp.dockerfile | 4 +++- ci/docker/ubuntu-22.04-cpp.dockerfile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ci/docker/ubuntu-20.04-cpp.dockerfile b/ci/docker/ubuntu-20.04-cpp.dockerfile index 2b1f11f43adf4..d66aaad4494db 100644 --- a/ci/docker/ubuntu-20.04-cpp.dockerfile +++ b/ci/docker/ubuntu-20.04-cpp.dockerfile @@ -115,7 +115,9 @@ RUN apt-get update -y -q && \ rapidjson-dev \ rsync \ tzdata \ - wget && \ + wget \ + zip \ + unzip && \ apt-get clean && \ rm -rf /var/lib/apt/lists* diff --git a/ci/docker/ubuntu-22.04-cpp.dockerfile b/ci/docker/ubuntu-22.04-cpp.dockerfile index e4c8334701584..134bc5fe8a60a 100644 --- a/ci/docker/ubuntu-22.04-cpp.dockerfile +++ b/ci/docker/ubuntu-22.04-cpp.dockerfile @@ -113,7 +113,9 @@ RUN apt-get update -y -q && \ rapidjson-dev \ rsync \ tzdata \ - wget && \ + wget \ + zip \ + unzip && \ apt-get clean && \ rm -rf /var/lib/apt/lists* From 259b771b7c3d6f8639afb3685bcc1b0cbec08783 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 9 Aug 2023 21:36:39 +0100 Subject: [PATCH 23/93] Fix detecting openssl major version --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 22aff2acf683c..591fa06cefa38 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -238,6 +238,7 @@ endmacro() macro(resolve_dependency DEPENDENCY_NAME) message(STATUS "Resolving dependency ${DEPENDENCY_NAME}") + message(STATUS "source ${${DEPENDENCY_NAME}_SOURCE}") set(options) set(one_value_args ARROW_CMAKE_PACKAGE_NAME @@ -5165,6 +5166,8 @@ macro(build_azuresdk) -DENABLE_UNITY_BUILD=ON -DWARNINGS_AS_ERRORS=OFF) + STRING(REPLACE "." ";" OPENSSL_VERSION_ELEMENTS_LIST ${OPENSSL_VERSION}) + list(GET OPENSSL_VERSION_ELEMENTS_LIST 0 OPENSSL_VERSION_MAJOR) if(OPENSSL_VERSION_MAJOR EQUAL 1) list(APPEND AZURESDK_COMMON_CMAKE_ARGS From 14d753001eddb0b3b6c89ba2e8120227420d3db7 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 9 Aug 2023 21:49:11 +0100 Subject: [PATCH 24/93] Fix rebase --- cpp/src/arrow/filesystem/azurefs_test.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index 58694cf2fa39c..fd1e65d8a4b5e 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -40,7 +40,6 @@ #include #include -#include #include #include "arrow/testing/gtest_util.h" @@ -58,7 +57,6 @@ namespace fs { namespace { namespace bp = boost::process; -namespace bp = boost::process; using ::testing::IsEmpty; using ::testing::Not; using ::testing::NotNull; @@ -113,7 +111,7 @@ AzuriteEnv* GetAzuriteEnv() { return ::arrow::internal::checked_cast(azurite_env); } -// Placeholder tests for file structure +// Placeholder tests // TODO: GH-18014 Remove once a proper test is added TEST(AzureFileSystem, UploadThenDownload) { const std::string containerName = "sample-container"; From 518cea4d559062954bd7d38acf8953f154b95739 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 9 Aug 2023 21:55:22 +0100 Subject: [PATCH 25/93] Tidy --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 591fa06cefa38..8175786547a1c 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -58,6 +58,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES gRPC GTest jemalloc + LibXml2 LLVM lz4 nlohmann_json @@ -74,7 +75,6 @@ set(ARROW_THIRDPARTY_DEPENDENCIES xsimd ZLIB zstd - LibXml2 ) # For backward compatibility. We use "BOOST_SOURCE" if "Boost_SOURCE" @@ -162,6 +162,8 @@ macro(build_dependency DEPENDENCY_NAME) build_absl() elseif("${DEPENDENCY_NAME}" STREQUAL "AWSSDK") build_awssdk() + elseif("${DEPENDENCY_NAME}" STREQUAL "AZURE_SDK") + build_azuresdk() elseif("${DEPENDENCY_NAME}" STREQUAL "benchmark") build_benchmark() elseif("${DEPENDENCY_NAME}" STREQUAL "Boost") @@ -184,6 +186,8 @@ macro(build_dependency DEPENDENCY_NAME) build_gtest() elseif("${DEPENDENCY_NAME}" STREQUAL "jemalloc") build_jemalloc() + elseif("${DEPENDENCY_NAME}" STREQUAL "LibXml2") + build_libxml2() elseif("${DEPENDENCY_NAME}" STREQUAL "lz4") build_lz4() elseif("${DEPENDENCY_NAME}" STREQUAL "nlohmann_json") @@ -214,10 +218,6 @@ macro(build_dependency DEPENDENCY_NAME) build_zlib() elseif("${DEPENDENCY_NAME}" STREQUAL "zstd") build_zstd() - elseif("${DEPENDENCY_NAME}" STREQUAL "AZURE_SDK") - build_azuresdk() - elseif("${DEPENDENCY_NAME}" STREQUAL "LibXml2") - build_libxml2() else() message(FATAL_ERROR "Unknown thirdparty dependency to build: ${DEPENDENCY_NAME}") endif() @@ -237,8 +237,6 @@ macro(provide_find_module PACKAGE_NAME ARROW_CMAKE_PACKAGE_NAME) endmacro() macro(resolve_dependency DEPENDENCY_NAME) - message(STATUS "Resolving dependency ${DEPENDENCY_NAME}") - message(STATUS "source ${${DEPENDENCY_NAME}_SOURCE}") set(options) set(one_value_args ARROW_CMAKE_PACKAGE_NAME @@ -289,15 +287,12 @@ macro(resolve_dependency DEPENDENCY_NAME) if(COMPATIBLE) set(${DEPENDENCY_NAME}_SOURCE "SYSTEM") else() - message(STATUS "Using bundled ${DEPENDENCY_NAME}") build_dependency(${DEPENDENCY_NAME}) set(${DEPENDENCY_NAME}_SOURCE "BUNDLED") endif() elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "BUNDLED") - message(STATUS "Using bundled2 ${DEPENDENCY_NAME}") build_dependency(${DEPENDENCY_NAME}) elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM") - message(STATUS "Using system ${DEPENDENCY_NAME}, ${FIND_PACKAGE_ARGUMENTS}") find_package(${FIND_PACKAGE_ARGUMENTS} REQUIRED) if(ARG_FORCE_ANY_NEWER_VERSION AND ARG_REQUIRED_VERSION) if(${${PACKAGE_NAME}_VERSION} VERSION_LESS ${ARG_REQUIRED_VERSION}) @@ -5194,7 +5189,7 @@ macro(build_azuresdk) "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-files-datalake${CMAKE_STATIC_LIBRARY_SUFFIX}" ) externalproject_add(azuresdk_ep - # ${EP_LOG_OPTIONS} + ${EP_LOG_OPTIONS} INSTALL_DIR ${AZURESDK_PREFIX} URL ${ARROW_AZURESDK_URL} URL_HASH "SHA256=${ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM}" From 37dd76aa547f75a108dcc8172a664e78c9fee832 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Thu, 10 Aug 2023 21:42:43 +0100 Subject: [PATCH 26/93] Small fix and improve naming consistency --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 8175786547a1c..662090c93d736 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5083,12 +5083,11 @@ endif() # Azure SDK and dependencies macro(build_libxml2) - message(STATUS "Building xml2 from source") - # "Build" LibXml2 + message(STATUS "Building libxml2 from source") set(LIBXML2_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/xml2_ep-install") set(LIBXML2_INCLUDE_DIR "${LIBXML2_PREFIX}/include") - set(XML2_CMAKE_ARGS + set(LIBXML2_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=" -DCMAKE_INSTALL_LIBDIR=lib @@ -5099,29 +5098,30 @@ macro(build_libxml2) -DLIBXML2_WITH_ICONV=OFF -DBUILD_SHARED_LIBS=OFF) - set(_XML2_STATIC_LIBRARY + set(LIBXML2_STATIC_LIBRARY "${LIBXML2_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}xml2${CMAKE_STATIC_LIBRARY_SUFFIX}" ) - set(XML2_BUILD_BYPRODUCTS ${_XML2_STATIC_LIBRARY}) + set(LIBXML2_BUILD_BYPRODUCTS ${LIBXML2_STATIC_LIBRARY}) externalproject_add(libxml2_ep ${EP_LOG_OPTIONS} INSTALL_DIR ${LIBXML2_PREFIX} URL ${LIBXML2_SOURCE_URL} URL_HASH "SHA256=${ARROW_LIBXML2_BUILD_SHA256_CHECKSUM}" - CMAKE_ARGS ${XML2_CMAKE_ARGS} - BUILD_BYPRODUCTS ${XML2_BUILD_BYPRODUCTS}) + CMAKE_ARGS ${LIBXML2_CMAKE_ARGS} + BUILD_BYPRODUCTS ${LIBXML2_BUILD_BYPRODUCTS}) # Work around https://gitlab.kitware.com/cmake/cmake/issues/15052 file(MAKE_DIRECTORY "${LIBXML2_INCLUDE_DIR}") add_library(LibXml2::LibXml2 STATIC IMPORTED) set_target_properties(LibXml2::LibXml2 - PROPERTIES IMPORTED_LOCATION ${_XML2_STATIC_LIBRARY} + PROPERTIES IMPORTED_LOCATION ${LIBXML2_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIR}") - add_dependencies(LibXml2::LibXml2 xml2_ep) + add_dependencies(LibXml2::LibXml2 libxml2_ep) set(LIBXML2_VENDORED TRUE) endmacro() + if(ARROW_WITH_LIBXML2) message(STATUS "Building LibXml2 from source") resolve_dependency(LibXml2) From 2fb35729facf45308d565245803c505b2f4b713a Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Thu, 10 Aug 2023 22:37:16 +0100 Subject: [PATCH 27/93] vcpkg libxml2 --- ci/scripts/python_wheel_manylinux_build.sh | 1 - cpp/CMakeLists.txt | 8 -------- cpp/cmake_modules/ThirdpartyToolchain.cmake | 16 ++++++++++++---- cpp/vcpkg.json | 1 + 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ci/scripts/python_wheel_manylinux_build.sh b/ci/scripts/python_wheel_manylinux_build.sh index 3cd5145df709e..a6e729622c1ae 100755 --- a/ci/scripts/python_wheel_manylinux_build.sh +++ b/ci/scripts/python_wheel_manylinux_build.sh @@ -125,7 +125,6 @@ cmake \ -DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD} \ -DORC_PROTOBUF_EXECUTABLE=${VCPKG_ROOT}/installed/${VCPKG_TARGET_TRIPLET}/tools/protobuf/protoc \ -DORC_SOURCE=BUNDLED \ - -DLibXml2_SOURCE=BUNDLED \ -DPARQUET_REQUIRE_ENCRYPTION=${PARQUET_REQUIRE_ENCRYPTION} \ -DVCPKG_MANIFEST_MODE=OFF \ -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} \ diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 4859a3763c1c2..5fc977cfc4acc 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -798,14 +798,6 @@ endif() if(ARROW_AZURE) list(APPEND ARROW_SHARED_LINK_LIBS ${AZURESDK_LINK_LIBRARIES}) list(APPEND ARROW_STATIC_LINK_LIBS ${AZURESDK_LINK_LIBRARIES}) - if(AZURE_SDK_SOURCE STREQUAL "SYSTEM") - list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS - Azure::azure-core - Azure::azure-identity - Azure::azure-storage-blobs - Azure::azure-storage-common - Azure::azure-storage-files-datalake) - endif() endif() if(ARROW_WITH_UTF8PROC) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 662090c93d736..3811c4ba2a075 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5266,10 +5266,18 @@ macro(build_azuresdk) endmacro() if(ARROW_AZURE) - resolve_dependency(AZURE_SDK) - - message(STATUS "Found Azure SDK headers: ${AZURESDK_INCLUDE_DIR}") - message(STATUS "Found Azure SDK libraries: ${AZURESDK_LINK_LIBRARIES}") + if(AZURE_SDK_SOURCE STREQUAL "SYSTEM") + list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS + Azure::azure-core + Azure::azure-identity + Azure::azure-storage-blobs + Azure::azure-storage-common + Azure::azure-storage-files-datalake) + else() + resolve_dependency(AZURE_SDK) + message(STATUS "Found Azure SDK headers: ${AZURESDK_INCLUDE_DIR}") + message(STATUS "Found Azure SDK libraries: ${AZURESDK_LINK_LIBRARIES}") + endif() endif() # ---------------------------------------------------------------------- diff --git a/cpp/vcpkg.json b/cpp/vcpkg.json index 37afc531aba81..8a3df79d963be 100644 --- a/cpp/vcpkg.json +++ b/cpp/vcpkg.json @@ -42,6 +42,7 @@ }, "grpc", "gtest", + "libxml2", "lz4", "openssl", "orc", From 37e7239e2af6faedc4d4bdc478f83aee16d4cce8 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Thu, 10 Aug 2023 23:18:56 +0100 Subject: [PATCH 28/93] Add libxml2 dep to the correct vcpkg.json --- ci/vcpkg/vcpkg.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/vcpkg/vcpkg.json b/ci/vcpkg/vcpkg.json index 71c23165e61f0..f7760ebab7554 100644 --- a/ci/vcpkg/vcpkg.json +++ b/ci/vcpkg/vcpkg.json @@ -20,6 +20,7 @@ "flatbuffers", "gflags", "glog", + "libxml2", "lz4", "openssl", "re2", From 508eb4f61cd99d627d084a71d02edd978339cbf3 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Thu, 10 Aug 2023 23:41:26 +0100 Subject: [PATCH 29/93] Remove unneeded bundled libxml2 build --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 65 --------------------- cpp/thirdparty/versions.txt | 3 - 2 files changed, 68 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 3811c4ba2a075..9ee6c541790d6 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -58,7 +58,6 @@ set(ARROW_THIRDPARTY_DEPENDENCIES gRPC GTest jemalloc - LibXml2 LLVM lz4 nlohmann_json @@ -186,8 +185,6 @@ macro(build_dependency DEPENDENCY_NAME) build_gtest() elseif("${DEPENDENCY_NAME}" STREQUAL "jemalloc") build_jemalloc() - elseif("${DEPENDENCY_NAME}" STREQUAL "LibXml2") - build_libxml2() elseif("${DEPENDENCY_NAME}" STREQUAL "lz4") build_lz4() elseif("${DEPENDENCY_NAME}" STREQUAL "nlohmann_json") @@ -379,7 +376,6 @@ endif() # Enable Azure if(ARROW_AZURE) set(ARROW_WITH_AZURE_SDK ON) - set(ARROW_WITH_LIBXML2 ON) endif() if(ARROW_JSON) @@ -693,14 +689,6 @@ else() ) endif() -if(DEFINED ENV{ARROW_LIBXML2_URL}) - set(LIBXML2_SOURCE_URL "$ENV{ARROW_LIBXML2_URL}") -else() - set_urls(LIBXML2_SOURCE_URL - "https://github.com/GNOME/libxml2/archive/refs/tags/${ARROW_LIBXML2_BUILD_VERSION}.tar.gz" - ) -endif() - if(DEFINED ENV{ARROW_LZ4_URL}) set(LZ4_SOURCE_URL "$ENV{ARROW_LZ4_URL}") else() @@ -5082,55 +5070,6 @@ endif() # ---------------------------------------------------------------------- # Azure SDK and dependencies -macro(build_libxml2) - message(STATUS "Building libxml2 from source") - set(LIBXML2_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/xml2_ep-install") - set(LIBXML2_INCLUDE_DIR "${LIBXML2_PREFIX}/include") - - set(LIBXML2_CMAKE_ARGS - ${EP_COMMON_CMAKE_ARGS} - "-DCMAKE_INSTALL_PREFIX=" - -DCMAKE_INSTALL_LIBDIR=lib - -DBUILD_TESTING=OFF - -DLIBXML2_WITH_ZLIB=OFF - -DLIBXML2_WITH_PYTHON=OFF - -DLIBXML2_WITH_LZMA=OFF - -DLIBXML2_WITH_ICONV=OFF - -DBUILD_SHARED_LIBS=OFF) - - set(LIBXML2_STATIC_LIBRARY - "${LIBXML2_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}xml2${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - set(LIBXML2_BUILD_BYPRODUCTS ${LIBXML2_STATIC_LIBRARY}) - - externalproject_add(libxml2_ep - ${EP_LOG_OPTIONS} - INSTALL_DIR ${LIBXML2_PREFIX} - URL ${LIBXML2_SOURCE_URL} - URL_HASH "SHA256=${ARROW_LIBXML2_BUILD_SHA256_CHECKSUM}" - CMAKE_ARGS ${LIBXML2_CMAKE_ARGS} - BUILD_BYPRODUCTS ${LIBXML2_BUILD_BYPRODUCTS}) - - # Work around https://gitlab.kitware.com/cmake/cmake/issues/15052 - file(MAKE_DIRECTORY "${LIBXML2_INCLUDE_DIR}") - add_library(LibXml2::LibXml2 STATIC IMPORTED) - set_target_properties(LibXml2::LibXml2 - PROPERTIES IMPORTED_LOCATION ${LIBXML2_STATIC_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES - "${LIBXML2_INCLUDE_DIR}") - add_dependencies(LibXml2::LibXml2 libxml2_ep) - set(LIBXML2_VENDORED TRUE) -endmacro() - -if(ARROW_WITH_LIBXML2) - message(STATUS "Building LibXml2 from source") - resolve_dependency(LibXml2) - message(STATUS "Resolved LibXml2") - get_target_property(LIBXML2_INCLUDE_DIR LibXml2::LibXml2 - INTERFACE_INCLUDE_DIRECTORIES) - message(STATUS "Found xml2 headers: ${LIBXML2_INCLUDE_DIR}") -endif() - macro(build_azuresdk) message(STATUS "Building Azure C++ SDK from source") @@ -5142,10 +5081,6 @@ macro(build_azuresdk) ${ARROW_OPENSSL_REQUIRED_VERSION}) endif() - if(LIBXML2_VENDORED) - add_dependencies(azure_sdk_dependencies libxml2_ep) - endif() - set(AZURESDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-install") set(AZURESDK_INCLUDE_DIR "${AZURESDK_PREFIX}/include") set(AZURESDK_LIB_DIR "lib") diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index 8bc1894fe45a0..800de2e266d07 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -113,8 +113,6 @@ ARROW_UCX_BUILD_VERSION=1.12.1 ARROW_UCX_BUILD_SHA256_CHECKSUM=9bef31aed0e28bf1973d28d74d9ac4f8926c43ca3b7010bd22a084e164e31b71 ARROW_UTF8PROC_BUILD_VERSION=v2.7.0 ARROW_UTF8PROC_BUILD_SHA256_CHECKSUM=4bb121e297293c0fd55f08f83afab6d35d48f0af4ecc07523ad8ec99aa2b12a1 -ARROW_LIBXML2_BUILD_VERSION=v2.11.4 -ARROW_LIBXML2_BUILD_SHA256_CHECKSUM=2fd59eccfe277f7b7dec8836254acbebd24af33857a018dd64ddcf92d88d7f7e ARROW_XSIMD_BUILD_VERSION=9.0.1 ARROW_XSIMD_BUILD_SHA256_CHECKSUM=b1bb5f92167fd3a4f25749db0be7e61ed37e0a5d943490f3accdcd2cd2918cc0 ARROW_ZLIB_BUILD_VERSION=1.2.13 @@ -158,7 +156,6 @@ DEPENDENCIES=( "ARROW_LZ4_URL lz4-${ARROW_LZ4_BUILD_VERSION}.tar.gz https://github.com/lz4/lz4/archive/${ARROW_LZ4_BUILD_VERSION}.tar.gz" "ARROW_MIMALLOC_URL mimalloc-${ARROW_MIMALLOC_BUILD_VERSION}.tar.gz https://github.com/microsoft/mimalloc/archive/${ARROW_MIMALLOC_BUILD_VERSION}.tar.gz" "ARROW_NLOHMANN_JSON_URL nlohmann-json-${ARROW_NLOHMANN_JSON_BUILD_VERSION}.tar.gz https://github.com/nlohmann/json/archive/refs/tags/${ARROW_NLOHMANN_JSON_BUILD_VERSION}.tar.gz" - "ARROW_LIBXML2_URL xml2-${ARROW_LIBXML2_BUILD_VERSION}.tar.gz https://github.com/GNOME/libxml2/archive/refs/tags/${ARROW_LIBXML2_BUILD_VERSION}.tar.gz" "ARROW_OPENTELEMETRY_URL opentelemetry-cpp-${ARROW_OPENTELEMETRY_BUILD_VERSION}.tar.gz https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/${ARROW_OPENTELEMETRY_BUILD_VERSION}.tar.gz" "ARROW_OPENTELEMETRY_PROTO_URL opentelemetry-proto-${ARROW_OPENTELEMETRY_PROTO_BUILD_VERSION}.tar.gz https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/${ARROW_OPENTELEMETRY_PROTO_BUILD_VERSION}.tar.gz" "ARROW_ORC_URL orc-${ARROW_ORC_BUILD_VERSION}.tar.gz https://archive.apache.org/dist/orc/orc-${ARROW_ORC_BUILD_VERSION}/orc-${ARROW_ORC_BUILD_VERSION}.tar.gz" From 41359f83fb60248c72806f50d621f35db3e0eb45 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Fri, 11 Aug 2023 22:16:02 +0100 Subject: [PATCH 30/93] Add Azure libraries to correct vcpkg --- ci/vcpkg/vcpkg.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ci/vcpkg/vcpkg.json b/ci/vcpkg/vcpkg.json index f7760ebab7554..e722012dae279 100644 --- a/ci/vcpkg/vcpkg.json +++ b/ci/vcpkg/vcpkg.json @@ -131,6 +131,31 @@ ] } ] + }, + "azure": { + "description": "Azure support", + "dependencies": [ + { + "name": "azure-core-cpp", + "version>=": "1.10.2" + }, + { + "name": "azure-identity-cpp", + "version>=": "1.5.1" + }, + { + "name": "azure-storage-blobs-cpp", + "version>=": "12.8.0" + }, + { + "name": "azure-storage-common-cpp", + "version>=": "12.3.3" + }, + { + "name": "azure-storage-files-datalake-cpp", + "version>=": "12.7.0" + } + ] } } } From e44a8684a2d5efeb8e9533013b20e24755e02100 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Fri, 11 Aug 2023 22:17:23 +0100 Subject: [PATCH 31/93] Small consistency improvement --- cpp/CMakeLists.txt | 2 +- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 5fc977cfc4acc..24dbfc834a73b 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -795,7 +795,7 @@ if(ARROW_WITH_OPENTELEMETRY) list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl) endif() -if(ARROW_AZURE) +if(ARROW_WITH_AZURE_SDK) list(APPEND ARROW_SHARED_LINK_LIBS ${AZURESDK_LINK_LIBRARIES}) list(APPEND ARROW_STATIC_LINK_LIBS ${AZURESDK_LINK_LIBRARIES}) endif() diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 9ee6c541790d6..16dedd0f81577 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5200,7 +5200,7 @@ macro(build_azuresdk) set(AZURESDK_LINK_LIBRARIES ${AZURESDK_LIBRARIES}) endmacro() -if(ARROW_AZURE) +if(ARROW_WITH_AZURE_SDK) if(AZURE_SDK_SOURCE STREQUAL "SYSTEM") list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS Azure::azure-core From 3b199aea15641bd06a68d7af4a1a7fd25ff34273 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Fri, 11 Aug 2023 22:31:02 +0100 Subject: [PATCH 32/93] improve consistency --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 16dedd0f81577..e5f3fc809a6fb 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5202,12 +5202,11 @@ endmacro() if(ARROW_WITH_AZURE_SDK) if(AZURE_SDK_SOURCE STREQUAL "SYSTEM") - list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS - Azure::azure-core - Azure::azure-identity - Azure::azure-storage-blobs - Azure::azure-storage-common - Azure::azure-storage-files-datalake) + resolve_dependency(Azure::azure-core) + resolve_dependency(Azure::azure-identity) + resolve_dependency(Azure::azure-storage-blobs) + resolve_dependency(Azure::azure-storage-common) + resolve_dependency(Azure::azure-storage-files-datalake) else() resolve_dependency(AZURE_SDK) message(STATUS "Found Azure SDK headers: ${AZURESDK_INCLUDE_DIR}") From 4ec48beaa4fd5664d859a5b78ab3c8ec9fbf1a1d Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Fri, 11 Aug 2023 22:42:04 +0100 Subject: [PATCH 33/93] Add missing find_package since removing the capability for bundled libxml2 --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index e5f3fc809a6fb..fc7485ac00cc5 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5074,6 +5074,7 @@ macro(build_azuresdk) message(STATUS "Building Azure C++ SDK from source") find_curl() + find_package(LibXml2) add_custom_target(azure_sdk_dependencies) if(NOT OpenSSL_FOUND) From 7aeaabcd7e6082e850aebf95ea3620d16766ab1d Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Fri, 11 Aug 2023 22:50:39 +0100 Subject: [PATCH 34/93] Remove explicit off option since its off by default --- ci/appveyor-cpp-build.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/appveyor-cpp-build.bat b/ci/appveyor-cpp-build.bat index 850bf6821ab84..e69c7bf2516d9 100644 --- a/ci/appveyor-cpp-build.bat +++ b/ci/appveyor-cpp-build.bat @@ -60,7 +60,6 @@ pushd cpp\build cmake -G "%GENERATOR%" %ARROW_CMAKE_ARGS% ^ -DARROW_ACERO=ON ^ - -DARROW_AZURE=OFF ^ -DARROW_BOOST_USE_SHARED=ON ^ -DARROW_BUILD_EXAMPLES=ON ^ -DARROW_BUILD_STATIC=OFF ^ From cb92ddf18dc9469b4526d1b736f82d8c9ec8b249 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 12 Aug 2023 13:29:32 +0100 Subject: [PATCH 35/93] Remove vcpkg libxml which is now unnecessary --- ci/vcpkg/vcpkg.json | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/vcpkg/vcpkg.json b/ci/vcpkg/vcpkg.json index e722012dae279..830f95d162615 100644 --- a/ci/vcpkg/vcpkg.json +++ b/ci/vcpkg/vcpkg.json @@ -20,7 +20,6 @@ "flatbuffers", "gflags", "glog", - "libxml2", "lz4", "openssl", "re2", From 5e2257fbb733371bab862f28ca61b8d16d0e2714 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 12 Aug 2023 13:30:00 +0100 Subject: [PATCH 36/93] Tidy + enable azure vcpkg on manylinux build --- ci/docker/python-wheel-manylinux.dockerfile | 1 + ci/vcpkg/vcpkg.json | 50 ++++++++++----------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index 0f7779c878505..b27c169ae1895 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -81,6 +81,7 @@ RUN vcpkg install \ --clean-after-build \ --x-install-root=${VCPKG_ROOT}/installed \ --x-manifest-root=/arrow/ci/vcpkg \ + --x-feature=azure \ --x-feature=flight \ --x-feature=gcs \ --x-feature=json \ diff --git a/ci/vcpkg/vcpkg.json b/ci/vcpkg/vcpkg.json index 830f95d162615..c1448169edea1 100644 --- a/ci/vcpkg/vcpkg.json +++ b/ci/vcpkg/vcpkg.json @@ -39,6 +39,31 @@ ], "default-features": [], "features": { + "azure": { + "description": "Azure support", + "dependencies": [ + { + "name": "azure-core-cpp", + "version>=": "1.10.2" + }, + { + "name": "azure-identity-cpp", + "version>=": "1.5.1" + }, + { + "name": "azure-storage-blobs-cpp", + "version>=": "12.8.0" + }, + { + "name": "azure-storage-common-cpp", + "version>=": "12.3.3" + }, + { + "name": "azure-storage-files-datalake-cpp", + "version>=": "12.7.0" + } + ] + }, "dev": { "description": "Development dependencies", "dependencies": [ @@ -130,31 +155,6 @@ ] } ] - }, - "azure": { - "description": "Azure support", - "dependencies": [ - { - "name": "azure-core-cpp", - "version>=": "1.10.2" - }, - { - "name": "azure-identity-cpp", - "version>=": "1.5.1" - }, - { - "name": "azure-storage-blobs-cpp", - "version>=": "12.8.0" - }, - { - "name": "azure-storage-common-cpp", - "version>=": "12.3.3" - }, - { - "name": "azure-storage-files-datalake-cpp", - "version>=": "12.7.0" - } - ] } } } From 814fa0667d653eb5265509515a9350e569419585 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 12 Aug 2023 16:41:07 +0100 Subject: [PATCH 37/93] Initialise blob client in azurefs.cc to ensure build is working correctly in all environments --- cpp/src/arrow/filesystem/azurefs.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index 0158c0cec74e1..63fd25d108b18 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -19,6 +19,8 @@ #include "arrow/result.h" #include "arrow/util/checked_cast.h" +#include +#include namespace arrow { namespace fs { @@ -47,6 +49,11 @@ class AzureFileSystem::Impl { : io_context_(io_context), options_(std::move(options)) {} Status Init() { + // TODO: Delete this once we have a proper implementation. This is just here to + // ensure the build is working correctly with the Azure SDK. + auto defaultCredential = std::make_shared(); + auto serviceClient = Azure::Storage::Blobs::BlobServiceClient( + "http://127.0.0.1:10000/devstoreaccount1", defaultCredential); if (options_.backend == AzureBackend::Azurite) { // gen1Client_->GetAccountInfo().Value.IsHierarchicalNamespaceEnabled // throws error in azurite From 25dc0f296349688a95210146088a62186bb4443a Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 12 Aug 2023 16:41:46 +0100 Subject: [PATCH 38/93] Use bundled Azure SDK in manylinux build --- ci/docker/python-wheel-manylinux.dockerfile | 3 +-- ci/scripts/python_wheel_manylinux_build.sh | 3 ++- ci/vcpkg/vcpkg.json | 25 --------------------- cpp/vcpkg.json | 6 ----- 4 files changed, 3 insertions(+), 34 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index b27c169ae1895..f4e7bb3d38060 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -28,7 +28,7 @@ ENV MANYLINUX_VERSION=${manylinux} RUN yum install -y dnf # Install basic dependencies -RUN dnf install -y git flex curl autoconf zip perl-IPC-Cmd wget kernel-headers +RUN dnf install -y git flex curl autoconf zip perl-IPC-Cmd wget kernel-headers libxml2 # A system Python is required for ninja and vcpkg in this Dockerfile. # On manylinux2014 base images, system Python is 2.7.5, while @@ -81,7 +81,6 @@ RUN vcpkg install \ --clean-after-build \ --x-install-root=${VCPKG_ROOT}/installed \ --x-manifest-root=/arrow/ci/vcpkg \ - --x-feature=azure \ --x-feature=flight \ --x-feature=gcs \ --x-feature=json \ diff --git a/ci/scripts/python_wheel_manylinux_build.sh b/ci/scripts/python_wheel_manylinux_build.sh index a6e729622c1ae..546f35c6778fb 100755 --- a/ci/scripts/python_wheel_manylinux_build.sh +++ b/ci/scripts/python_wheel_manylinux_build.sh @@ -88,6 +88,8 @@ pushd /tmp/arrow-build cmake \ -DARROW_ACERO=${ARROW_ACERO} \ + -DARROW_AZURE=${ARROW_AZURE} \ + -DAZURE_SDK_SOURCE=BUNDLED \ -DARROW_BUILD_SHARED=ON \ -DARROW_BUILD_STATIC=OFF \ -DARROW_BUILD_TESTS=OFF \ @@ -100,7 +102,6 @@ cmake \ -DARROW_FLIGHT=${ARROW_FLIGHT} \ -DARROW_GANDIVA=${ARROW_GANDIVA} \ -DARROW_GCS=${ARROW_GCS} \ - -DARROW_AZURE=${ARROW_AZURE} \ -DARROW_HDFS=${ARROW_HDFS} \ -DARROW_JEMALLOC=${ARROW_JEMALLOC} \ -DARROW_JSON=ON \ diff --git a/ci/vcpkg/vcpkg.json b/ci/vcpkg/vcpkg.json index c1448169edea1..71c23165e61f0 100644 --- a/ci/vcpkg/vcpkg.json +++ b/ci/vcpkg/vcpkg.json @@ -39,31 +39,6 @@ ], "default-features": [], "features": { - "azure": { - "description": "Azure support", - "dependencies": [ - { - "name": "azure-core-cpp", - "version>=": "1.10.2" - }, - { - "name": "azure-identity-cpp", - "version>=": "1.5.1" - }, - { - "name": "azure-storage-blobs-cpp", - "version>=": "12.8.0" - }, - { - "name": "azure-storage-common-cpp", - "version>=": "12.3.3" - }, - { - "name": "azure-storage-files-datalake-cpp", - "version>=": "12.7.0" - } - ] - }, "dev": { "description": "Development dependencies", "dependencies": [ diff --git a/cpp/vcpkg.json b/cpp/vcpkg.json index 8a3df79d963be..71855dafdea35 100644 --- a/cpp/vcpkg.json +++ b/cpp/vcpkg.json @@ -14,11 +14,6 @@ "transfer" ] }, - "azure-core-cpp", - "azure-identity-cpp", - "azure-storage-blobs-cpp", - "azure-storage-common-cpp", - "azure-storage-files-datalake-cpp", "benchmark", "boost-filesystem", "boost-multiprecision", @@ -42,7 +37,6 @@ }, "grpc", "gtest", - "libxml2", "lz4", "openssl", "orc", From 31eea24004e474e2c389dbb57b1a1fc7150157d6 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 12 Aug 2023 17:17:35 +0100 Subject: [PATCH 39/93] Fix libxml2 install in manylinux build --- ci/docker/python-wheel-manylinux.dockerfile | 2 +- ci/vcpkg/vcpkg.json | 1 + cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- cpp/vcpkg.json | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index f4e7bb3d38060..0f7779c878505 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -28,7 +28,7 @@ ENV MANYLINUX_VERSION=${manylinux} RUN yum install -y dnf # Install basic dependencies -RUN dnf install -y git flex curl autoconf zip perl-IPC-Cmd wget kernel-headers libxml2 +RUN dnf install -y git flex curl autoconf zip perl-IPC-Cmd wget kernel-headers # A system Python is required for ninja and vcpkg in this Dockerfile. # On manylinux2014 base images, system Python is 2.7.5, while diff --git a/ci/vcpkg/vcpkg.json b/ci/vcpkg/vcpkg.json index 71c23165e61f0..f7760ebab7554 100644 --- a/ci/vcpkg/vcpkg.json +++ b/ci/vcpkg/vcpkg.json @@ -20,6 +20,7 @@ "flatbuffers", "gflags", "glog", + "libxml2", "lz4", "openssl", "re2", diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index fc7485ac00cc5..9970d2c5839bf 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5074,7 +5074,7 @@ macro(build_azuresdk) message(STATUS "Building Azure C++ SDK from source") find_curl() - find_package(LibXml2) + find_package(LibXml2 REQUIRED) add_custom_target(azure_sdk_dependencies) if(NOT OpenSSL_FOUND) diff --git a/cpp/vcpkg.json b/cpp/vcpkg.json index 71855dafdea35..87f2b8988f555 100644 --- a/cpp/vcpkg.json +++ b/cpp/vcpkg.json @@ -37,6 +37,7 @@ }, "grpc", "gtest", + "libxml2", "lz4", "openssl", "orc", From 8fad64400690ab22aa62b1094db4ad1c9d12537a Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 12 Aug 2023 17:26:08 +0100 Subject: [PATCH 40/93] Fix azure ep log options after rebase --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 9970d2c5839bf..32f150729a8a0 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5125,7 +5125,7 @@ macro(build_azuresdk) "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-files-datalake${CMAKE_STATIC_LIBRARY_SUFFIX}" ) externalproject_add(azuresdk_ep - ${EP_LOG_OPTIONS} + ${EP_COMMON_OPTIONS} INSTALL_DIR ${AZURESDK_PREFIX} URL ${ARROW_AZURESDK_URL} URL_HASH "SHA256=${ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM}" From fd44cf80ed04ac44615f4056ead14924118aa794 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 12 Aug 2023 17:38:04 +0100 Subject: [PATCH 41/93] REvert unnecessary whitespace change --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 32f150729a8a0..0efea07723688 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -73,8 +73,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES utf8proc xsimd ZLIB - zstd -) + zstd) # For backward compatibility. We use "BOOST_SOURCE" if "Boost_SOURCE" # isn't specified and "BOOST_SOURCE" is specified. From 304c9512c80995b6e32ad0adc73230c94ce73247 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sun, 13 Aug 2023 13:06:45 +0100 Subject: [PATCH 42/93] Update comments --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 0efea07723688..12342a9c0118c 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -365,14 +365,12 @@ if(ARROW_WITH_GRPC) set(ARROW_WITH_ZLIB ON) endif() -# Enable GCS if(ARROW_GCS) set(ARROW_WITH_GOOGLE_CLOUD_CPP ON) set(ARROW_WITH_NLOHMANN_JSON ON) set(ARROW_WITH_ZLIB ON) endif() -# Enable Azure if(ARROW_AZURE) set(ARROW_WITH_AZURE_SDK ON) endif() @@ -5067,7 +5065,7 @@ if(ARROW_S3) endif() # ---------------------------------------------------------------------- -# Azure SDK and dependencies +# Azure SDK for C++ macro(build_azuresdk) message(STATUS "Building Azure C++ SDK from source") From 05d6d6ea498513496eca6407355d8ae0db845587 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 08:47:20 +0100 Subject: [PATCH 43/93] Add comment about confusing version names --- cpp/thirdparty/versions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index 800de2e266d07..06321e1997a28 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -53,6 +53,7 @@ ARROW_AWS_LC_BUILD_VERSION=v1.3.0 ARROW_AWS_LC_BUILD_SHA256_CHECKSUM=ae96a3567161552744fc0cae8b4d68ed88b1ec0f3d3c98700070115356da5a37 ARROW_AWSSDK_BUILD_VERSION=1.10.55 ARROW_AWSSDK_BUILD_SHA256_CHECKSUM=2d552fb1a84bef4a9b65e34aa7031851ed2aef5319e02cc6e4cb735c48aa30de +# Despite the confusing version name this is still the whole azure SDK including core, keyvault, storage-common, etc. ARROW_AZURE_SDK_BUILD_VERSION=azure-identity_1.5.1 ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM=651a660592540c267420b7e1c8dc98428a17396e45f7f6c92a864ab9a4fa028a ARROW_BOOST_BUILD_VERSION=1.81.0 From 93817c7ab5683836593a7e56f96b8efa5a86d246 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 08:50:00 +0100 Subject: [PATCH 44/93] Alphabetical ordering and turn off azure in python wheel builds --- ci/scripts/python_wheel_manylinux_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/python_wheel_manylinux_build.sh b/ci/scripts/python_wheel_manylinux_build.sh index 546f35c6778fb..bf28894abc52f 100755 --- a/ci/scripts/python_wheel_manylinux_build.sh +++ b/ci/scripts/python_wheel_manylinux_build.sh @@ -49,11 +49,11 @@ rm -rf /arrow/python/pyarrow/*.so.* echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries ===" : ${ARROW_ACERO:=ON} +: ${ARROW_AZURE:=OFF} : ${ARROW_DATASET:=ON} : ${ARROW_FLIGHT:=ON} : ${ARROW_GANDIVA:=OFF} : ${ARROW_GCS:=ON} -: ${ARROW_AZURE:=ON} : ${ARROW_HDFS:=ON} : ${ARROW_JEMALLOC:=ON} : ${ARROW_MIMALLOC:=ON} From 80f4cd769faa4e2b513bc32380cce6274ee9b6b1 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 08:53:53 +0100 Subject: [PATCH 45/93] Update azurite account name --- cpp/src/arrow/filesystem/azurefs.cc | 2 +- cpp/src/arrow/filesystem/azurefs_test.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index 63fd25d108b18..8e7e9358d224e 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -53,7 +53,7 @@ class AzureFileSystem::Impl { // ensure the build is working correctly with the Azure SDK. auto defaultCredential = std::make_shared(); auto serviceClient = Azure::Storage::Blobs::BlobServiceClient( - "http://127.0.0.1:10000/devstoreaccount1", defaultCredential); + "http://fake-blob-storage-endpoit", defaultCredential); if (options_.backend == AzureBackend::Azurite) { // gen1Client_->GetAccountInfo().Value.IsHierarchicalNamespaceEnabled // throws error in azurite diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index fd1e65d8a4b5e..a02f86c03d03b 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -64,7 +64,7 @@ using ::testing::NotNull; class AzuriteEnv : public ::testing::Environment { public: AzuriteEnv() { - account_name_ = "devstoreaccount1"; + account_name_ = "account_name"; account_key_ = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/" "KBHBeksoGMGw=="; @@ -125,7 +125,7 @@ TEST(AzureFileSystem, UploadThenDownload) { account_name, account_key); auto serviceClient = Azure::Storage::Blobs::BlobServiceClient( - "http://127.0.0.1:10000/devstoreaccount1", credential); + "http://127.0.0.1:10000/account_name", credential); auto containerClient = serviceClient.GetBlobContainerClient(containerName); containerClient.CreateIfNotExists(); auto blobClient = containerClient.GetBlockBlobClient(blobName); From 530c6b2b189c0c2f9aa9200c75674c4088f7c065 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 08:50:49 +0100 Subject: [PATCH 46/93] Update cpp/src/arrow/filesystem/azurefs_test.cc Co-authored-by: Sutou Kouhei --- cpp/src/arrow/filesystem/azurefs_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index a02f86c03d03b..77ef607d13bd4 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -139,7 +139,7 @@ TEST(AzureFileSystem, UploadThenDownload) { EXPECT_EQ(std::string(buffer2.begin(), buffer2.end()), blobContent); } -TEST(AzureFileSystem, InitialiseCredentials) { +TEST(AzureFileSystem, InitializeCredentials) { auto defaultCredential = std::make_shared(); auto managedIdentityCredential = std::make_shared(); From 2dc551db201e3b2a661a39768342f4558f43d400 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:04:11 +0100 Subject: [PATCH 47/93] Move libxml vcpkg dependency to an azure feature --- ci/vcpkg/vcpkg.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/vcpkg/vcpkg.json b/ci/vcpkg/vcpkg.json index f7760ebab7554..daa189df4ab2a 100644 --- a/ci/vcpkg/vcpkg.json +++ b/ci/vcpkg/vcpkg.json @@ -20,7 +20,6 @@ "flatbuffers", "gflags", "glog", - "libxml2", "lz4", "openssl", "re2", @@ -40,6 +39,12 @@ ], "default-features": [], "features": { + "azure" { + "description": "Azure support", + "dependencies": [ + "libxml2" + ] + }, "dev": { "description": "Development dependencies", "dependencies": [ From f1d5c364d6db15e41df2a12e2cf0c351603e784c Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:07:18 +0100 Subject: [PATCH 48/93] Update cpp/cmake_modules/ThirdpartyToolchain.cmake Co-authored-by: Sutou Kouhei --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 12342a9c0118c..7bb62eafaa562 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -161,7 +161,7 @@ macro(build_dependency DEPENDENCY_NAME) elseif("${DEPENDENCY_NAME}" STREQUAL "AWSSDK") build_awssdk() elseif("${DEPENDENCY_NAME}" STREQUAL "AZURE_SDK") - build_azuresdk() + build_azure_sdk() elseif("${DEPENDENCY_NAME}" STREQUAL "benchmark") build_benchmark() elseif("${DEPENDENCY_NAME}" STREQUAL "Boost") From 47fb13ac318dec74a04e0105f8326acb006799d0 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:08:08 +0100 Subject: [PATCH 49/93] Update cpp/cmake_modules/ThirdpartyToolchain.cmake Co-authored-by: Sutou Kouhei --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 7bb62eafaa562..0a896b58eaec1 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5067,7 +5067,7 @@ endif() # ---------------------------------------------------------------------- # Azure SDK for C++ -macro(build_azuresdk) +macro(build_azure_sdk) message(STATUS "Building Azure C++ SDK from source") find_curl() From 18f3115bea00cb549d9d4737f25051d373950300 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:08:24 +0100 Subject: [PATCH 50/93] Update cpp/cmake_modules/ThirdpartyToolchain.cmake Co-authored-by: Sutou Kouhei --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 0a896b58eaec1..ebb6325ba3482 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5068,7 +5068,7 @@ endif() # Azure SDK for C++ macro(build_azure_sdk) - message(STATUS "Building Azure C++ SDK from source") + message(STATUS "Building Azure SDK for C++ from source") find_curl() find_package(LibXml2 REQUIRED) From 6d233b8400a3ade4722e4f961a4c554f131fde07 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:16:11 +0100 Subject: [PATCH 51/93] Update cpp/cmake_modules/ThirdpartyToolchain.cmake Co-authored-by: Sutou Kouhei --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index ebb6325ba3482..551ba67bd11f9 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5094,15 +5094,10 @@ macro(build_azure_sdk) -DENABLE_UNITY_BUILD=ON -DWARNINGS_AS_ERRORS=OFF) - STRING(REPLACE "." ";" OPENSSL_VERSION_ELEMENTS_LIST ${OPENSSL_VERSION}) - list(GET OPENSSL_VERSION_ELEMENTS_LIST 0 OPENSSL_VERSION_MAJOR) - if(OPENSSL_VERSION_MAJOR EQUAL 1) + if(OPENSSL_VERSION VERSION_LESS 2) list(APPEND AZURESDK_COMMON_CMAKE_ARGS -DVCPKG_OVERLAY_PORTS=${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-prefix/src/azuresdk_ep/vcpkg-custom-ports) - elseif(OPENSSL_VERSION_MAJOR EQUAL 3) - else() - message(FATAL_ERROR "Unknown OpenSSL version: ${OPENSSL_VERSION}") endif() file(MAKE_DIRECTORY ${AZURESDK_INCLUDE_DIR}) From 5d7bd1cbca94c6cd7736714783e06bdb2e8249b5 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:31:09 +0100 Subject: [PATCH 52/93] Rename ARROW_AZURESDK_URL -> ARROW_AZURE_SDK_URL --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 551ba67bd11f9..2c4192813e0b3 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -555,10 +555,10 @@ else() "${THIRDPARTY_MIRROR_URL}/aws-sdk-cpp-${ARROW_AWSSDK_BUILD_VERSION}.tar.gz") endif() -if(DEFINED ENV{ARROW_AZURESDK_URL}) - set(ARROW_AZURESDK_URL "$ENV{ARROW_AZURESDK_URL}") +if(DEFINED ENV{ARROW_AZURE_SDK_URL}) + set(ARROW_AZURE_SDK_URL "$ENV{ARROW_AZURE_SDK_URL}") else() - set_urls(ARROW_AZURESDK_URL + set_urls(ARROW_AZURE_SDK_URL "https://github.com/Azure/azure-sdk-for-cpp/archive/${ARROW_AZURE_SDK_BUILD_VERSION}.tar.gz" ) endif() @@ -5119,7 +5119,7 @@ macro(build_azure_sdk) externalproject_add(azuresdk_ep ${EP_COMMON_OPTIONS} INSTALL_DIR ${AZURESDK_PREFIX} - URL ${ARROW_AZURESDK_URL} + URL ${ARROW_AZURE_SDK_URL} URL_HASH "SHA256=${ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM}" CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} BUILD_BYPRODUCTS ${AZURE_CORE_STATIC_LIBRARY} From bd105412ea6484a474ad4501660da469259e7671 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:27:05 +0100 Subject: [PATCH 53/93] Update cpp/cmake_modules/ThirdpartyToolchain.cmake Co-authored-by: Sutou Kouhei --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 2c4192813e0b3..d98fbe3c27581 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5090,7 +5090,6 @@ macro(build_azure_sdk) -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=${AZURESDK_LIB_DIR} -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON - -DENABLE_TESTING=OFF -DENABLE_UNITY_BUILD=ON -DWARNINGS_AS_ERRORS=OFF) From d2ce4bbac9507430c1d9a8d97ec17fb3205ad179 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:36:35 +0100 Subject: [PATCH 54/93] Update openssl resolution --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index d98fbe3c27581..bff7a23115c20 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -1382,6 +1382,7 @@ endif() set(ARROW_OPENSSL_REQUIRED_VERSION "1.0.2") set(ARROW_USE_OPENSSL OFF) if(PARQUET_REQUIRE_ENCRYPTION + OR ARROW_AZURE OR ARROW_FLIGHT OR ARROW_GANDIVA OR ARROW_GCS @@ -5073,11 +5074,6 @@ macro(build_azure_sdk) find_curl() find_package(LibXml2 REQUIRED) add_custom_target(azure_sdk_dependencies) - - if(NOT OpenSSL_FOUND) - resolve_dependency(OpenSSL HAVE_ALT REQUIRED_VERSION - ${ARROW_OPENSSL_REQUIRED_VERSION}) - endif() set(AZURESDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-install") set(AZURESDK_INCLUDE_DIR "${AZURESDK_PREFIX}/include") From 5dbcad76c228497214654fe4a3734182e79314c2 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:37:56 +0100 Subject: [PATCH 55/93] Re-enable Azure on manylinux build --- ci/docker/python-wheel-manylinux.dockerfile | 1 + ci/scripts/python_wheel_manylinux_build.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index 0f7779c878505..b27c169ae1895 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -81,6 +81,7 @@ RUN vcpkg install \ --clean-after-build \ --x-install-root=${VCPKG_ROOT}/installed \ --x-manifest-root=/arrow/ci/vcpkg \ + --x-feature=azure \ --x-feature=flight \ --x-feature=gcs \ --x-feature=json \ diff --git a/ci/scripts/python_wheel_manylinux_build.sh b/ci/scripts/python_wheel_manylinux_build.sh index bf28894abc52f..5e2c451575073 100755 --- a/ci/scripts/python_wheel_manylinux_build.sh +++ b/ci/scripts/python_wheel_manylinux_build.sh @@ -49,7 +49,7 @@ rm -rf /arrow/python/pyarrow/*.so.* echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries ===" : ${ARROW_ACERO:=ON} -: ${ARROW_AZURE:=OFF} +: ${ARROW_AZURE:=ON} : ${ARROW_DATASET:=ON} : ${ARROW_FLIGHT:=ON} : ${ARROW_GANDIVA:=OFF} From 8bae613f5b387584df0ab6485045d9f44298466c Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:45:40 +0100 Subject: [PATCH 56/93] Remove unity build option --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index bff7a23115c20..466af30d0e510 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5086,7 +5086,6 @@ macro(build_azure_sdk) -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=${AZURESDK_LIB_DIR} -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON - -DENABLE_UNITY_BUILD=ON -DWARNINGS_AS_ERRORS=OFF) if(OPENSSL_VERSION VERSION_LESS 2) From fe2dcde31eebab7748c8449a8dc283765b0e9b18 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:41:31 +0100 Subject: [PATCH 57/93] Update cpp/cmake_modules/ThirdpartyToolchain.cmake Co-authored-by: Sutou Kouhei --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 466af30d0e510..fe034d0991a03 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5083,8 +5083,6 @@ macro(build_azure_sdk) ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=" "-DCMAKE_PREFIX_PATH=${AZURESDK_PREFIX}" - -DBUILD_SHARED_LIBS=OFF - -DCMAKE_INSTALL_LIBDIR=${AZURESDK_LIB_DIR} -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON -DWARNINGS_AS_ERRORS=OFF) From 06283cb505a57bf7305eb6cc83d83917eba26101 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 09:42:09 +0100 Subject: [PATCH 58/93] Update cpp/cmake_modules/ThirdpartyToolchain.cmake Co-authored-by: Sutou Kouhei --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index fe034d0991a03..6755a14368074 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5077,7 +5077,6 @@ macro(build_azure_sdk) set(AZURESDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-install") set(AZURESDK_INCLUDE_DIR "${AZURESDK_PREFIX}/include") - set(AZURESDK_LIB_DIR "lib") set(AZURESDK_COMMON_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} From e73c271b477c962bb364a26bd7325c69b7e5b011 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 19:23:32 +0100 Subject: [PATCH 59/93] Revert azurite storage account name --- cpp/src/arrow/filesystem/azurefs_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index 77ef607d13bd4..3d132c3774076 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -64,7 +64,7 @@ using ::testing::NotNull; class AzuriteEnv : public ::testing::Environment { public: AzuriteEnv() { - account_name_ = "account_name"; + account_name_ = "devstoreaccount1"; account_key_ = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/" "KBHBeksoGMGw=="; @@ -125,7 +125,7 @@ TEST(AzureFileSystem, UploadThenDownload) { account_name, account_key); auto serviceClient = Azure::Storage::Blobs::BlobServiceClient( - "http://127.0.0.1:10000/account_name", credential); + "http://127.0.0.1:10000/devstoreaccount1", credential); auto containerClient = serviceClient.GetBlobContainerClient(containerName); containerClient.CreateIfNotExists(); auto blobClient = containerClient.GetBlockBlobClient(blobName); From 2140ede2708133f1bb93238cfe5bac23336a69da Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 20:53:54 +0100 Subject: [PATCH 60/93] Working link to system openssl --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 9 ++------- cpp/overlays/openssl/portfile.cmake | 1 + cpp/overlays/openssl/vcpkg.json | 4 ++++ 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 cpp/overlays/openssl/portfile.cmake create mode 100644 cpp/overlays/openssl/vcpkg.json diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 6755a14368074..0ec62b5ddede5 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5083,13 +5083,8 @@ macro(build_azure_sdk) "-DCMAKE_INSTALL_PREFIX=" "-DCMAKE_PREFIX_PATH=${AZURESDK_PREFIX}" -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON - -DWARNINGS_AS_ERRORS=OFF) - - if(OPENSSL_VERSION VERSION_LESS 2) - list(APPEND - AZURESDK_COMMON_CMAKE_ARGS - -DVCPKG_OVERLAY_PORTS=${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-prefix/src/azuresdk_ep/vcpkg-custom-ports) - endif() + -DWARNINGS_AS_ERRORS=OFF + -DVCPKG_OVERLAY_PORTS=${CMAKE_SOURCE_DIR}/overlays) file(MAKE_DIRECTORY ${AZURESDK_INCLUDE_DIR}) set(AZURE_CORE_STATIC_LIBRARY diff --git a/cpp/overlays/openssl/portfile.cmake b/cpp/overlays/openssl/portfile.cmake new file mode 100644 index 0000000000000..065116c276adc --- /dev/null +++ b/cpp/overlays/openssl/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/cpp/overlays/openssl/vcpkg.json b/cpp/overlays/openssl/vcpkg.json new file mode 100644 index 0000000000000..47f0999a75e57 --- /dev/null +++ b/cpp/overlays/openssl/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "openssl", + "version": "1.0.2" +} From b90ad9071f0e20ecfffbdc985e99c508fa4014a2 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 21:06:17 +0100 Subject: [PATCH 61/93] Declare dependencies on the exact requirements for each component of the Azure SDK --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 0ec62b5ddede5..66c30e925bedd 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5120,7 +5120,7 @@ macro(build_azure_sdk) INTERFACE_INCLUDE_DIRECTORIES ${AZURESDK_INCLUDE_DIR}) set_property(TARGET Azure::azure-core - PROPERTY INTERFACE_LINK_LIBRARIES CURL::libcurl OpenSSL::Crypto OpenSSL::SSL) + PROPERTY INTERFACE_LINK_LIBRARIES CURL::libcurl OpenSSL::SSL) add_dependencies(Azure::azure-core azuresdk_ep) add_library(Azure::azure-identity STATIC IMPORTED) @@ -5138,7 +5138,7 @@ macro(build_azure_sdk) INTERFACE_INCLUDE_DIRECTORIES ${AZURESDK_INCLUDE_DIR}) set_property(TARGET Azure::azure-storage-common - PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::Crypto LibXml2::LibXml2 Azure::azure-core) + PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::SSL OpenSSL::Crypto LibXml2::LibXml2 Azure::azure-core) add_dependencies(Azure::azure-storage-common azuresdk_ep) add_library(Azure::azure-storage-blobs STATIC IMPORTED) @@ -5146,8 +5146,8 @@ macro(build_azure_sdk) PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES ${AZURESDK_INCLUDE_DIR}) - set_property(TARGET Azure::azure-identity - PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-core Azure::azure-storage-common) + set_property(TARGET Azure::azure-storage-blobs + PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-storage-common) add_dependencies(Azure::azure-storage-blobs azuresdk_ep) add_library(Azure::azure-storage-files-datalake STATIC IMPORTED) @@ -5156,7 +5156,7 @@ macro(build_azure_sdk) INTERFACE_INCLUDE_DIRECTORIES ${AZURESDK_INCLUDE_DIR}) set_property(TARGET Azure::azure-storage-files-datalake - PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-core Azure::azure-identity Azure::azure-storage-common Azure::azure-storage-blobs) + PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-storage-blobs) add_dependencies(Azure::azure-storage-files-datalake azuresdk_ep) set(AZURE_SDK_VENDORED TRUE) From 0e4b8e7af2d62a7ba16a99fc3c0d51604ed4cc31 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 21:51:41 +0100 Subject: [PATCH 62/93] Rename AZURESDK -> AZURE_SDK and azuresdk -> azure-sdk --- cpp/CMakeLists.txt | 4 +- cpp/cmake_modules/ThirdpartyToolchain.cmake | 56 ++++++++++----------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 24dbfc834a73b..6ab5800fd887f 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -796,8 +796,8 @@ if(ARROW_WITH_OPENTELEMETRY) endif() if(ARROW_WITH_AZURE_SDK) - list(APPEND ARROW_SHARED_LINK_LIBS ${AZURESDK_LINK_LIBRARIES}) - list(APPEND ARROW_STATIC_LINK_LIBS ${AZURESDK_LINK_LIBRARIES}) + list(APPEND ARROW_SHARED_LINK_LIBS ${AZURE_SDK_LINK_LIBRARIES}) + list(APPEND ARROW_STATIC_LINK_LIBS ${AZURE_SDK_LINK_LIBRARIES}) endif() if(ARROW_WITH_UTF8PROC) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 66c30e925bedd..aadce8068ae94 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5075,39 +5075,39 @@ macro(build_azure_sdk) find_package(LibXml2 REQUIRED) add_custom_target(azure_sdk_dependencies) - set(AZURESDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azuresdk_ep-install") - set(AZURESDK_INCLUDE_DIR "${AZURESDK_PREFIX}/include") + set(AZURE_SDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azure-sdk_ep-install") + set(AZURE_SDK_INCLUDE_DIR "${AZURE_SDK_PREFIX}/include") - set(AZURESDK_COMMON_CMAKE_ARGS + set(AZURE_SDK_COMMON_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=" - "-DCMAKE_PREFIX_PATH=${AZURESDK_PREFIX}" + "-DCMAKE_PREFIX_PATH=${AZURE_SDK_PREFIX}" -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON -DWARNINGS_AS_ERRORS=OFF -DVCPKG_OVERLAY_PORTS=${CMAKE_SOURCE_DIR}/overlays) - file(MAKE_DIRECTORY ${AZURESDK_INCLUDE_DIR}) + file(MAKE_DIRECTORY ${AZURE_SDK_INCLUDE_DIR}) set(AZURE_CORE_STATIC_LIBRARY - "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-core${CMAKE_STATIC_LIBRARY_SUFFIX}" + "${AZURE_SDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-core${CMAKE_STATIC_LIBRARY_SUFFIX}" ) set(AZURE_IDENTITY_STATIC_LIBRARY - "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-identity${CMAKE_STATIC_LIBRARY_SUFFIX}" + "${AZURE_SDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-identity${CMAKE_STATIC_LIBRARY_SUFFIX}" ) set(AZURE_STORAGE_BLOBS_STATIC_LIBRARY - "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-blobs${CMAKE_STATIC_LIBRARY_SUFFIX}" + "${AZURE_SDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-blobs${CMAKE_STATIC_LIBRARY_SUFFIX}" ) set(AZURE_STORAGE_COMMON_STATIC_LIBRARY - "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-common${CMAKE_STATIC_LIBRARY_SUFFIX}" + "${AZURE_SDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-common${CMAKE_STATIC_LIBRARY_SUFFIX}" ) set(AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY - "${AZURESDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-files-datalake${CMAKE_STATIC_LIBRARY_SUFFIX}" + "${AZURE_SDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-files-datalake${CMAKE_STATIC_LIBRARY_SUFFIX}" ) - externalproject_add(azuresdk_ep + externalproject_add(azure-sdk_ep ${EP_COMMON_OPTIONS} - INSTALL_DIR ${AZURESDK_PREFIX} + INSTALL_DIR ${AZURE_SDK_PREFIX} URL ${ARROW_AZURE_SDK_URL} URL_HASH "SHA256=${ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM}" - CMAKE_ARGS ${AZURESDK_COMMON_CMAKE_ARGS} + CMAKE_ARGS ${AZURE_SDK_COMMON_CMAKE_ARGS} BUILD_BYPRODUCTS ${AZURE_CORE_STATIC_LIBRARY} ${AZURE_IDENTITY_STATIC_LIBRARY} ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} @@ -5118,51 +5118,51 @@ macro(build_azure_sdk) set_target_properties(Azure::azure-core PROPERTIES IMPORTED_LOCATION ${AZURE_CORE_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES - ${AZURESDK_INCLUDE_DIR}) + ${AZURE_SDK_INCLUDE_DIR}) set_property(TARGET Azure::azure-core PROPERTY INTERFACE_LINK_LIBRARIES CURL::libcurl OpenSSL::SSL) - add_dependencies(Azure::azure-core azuresdk_ep) + add_dependencies(Azure::azure-core azure-sdk_ep) add_library(Azure::azure-identity STATIC IMPORTED) set_target_properties(Azure::azure-identity PROPERTIES IMPORTED_LOCATION ${AZURE_IDENTITY_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES - ${AZURESDK_INCLUDE_DIR}) + ${AZURE_SDK_INCLUDE_DIR}) set_property(TARGET Azure::azure-identity PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::Crypto Azure::azure-core) - add_dependencies(Azure::azure-identity azuresdk_ep) + add_dependencies(Azure::azure-identity azure-sdk_ep) add_library(Azure::azure-storage-common STATIC IMPORTED) set_target_properties(Azure::azure-storage-common PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_COMMON_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES - ${AZURESDK_INCLUDE_DIR}) + ${AZURE_SDK_INCLUDE_DIR}) set_property(TARGET Azure::azure-storage-common PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::SSL OpenSSL::Crypto LibXml2::LibXml2 Azure::azure-core) - add_dependencies(Azure::azure-storage-common azuresdk_ep) + add_dependencies(Azure::azure-storage-common azure-sdk_ep) add_library(Azure::azure-storage-blobs STATIC IMPORTED) set_target_properties(Azure::azure-storage-blobs PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES - ${AZURESDK_INCLUDE_DIR}) + ${AZURE_SDK_INCLUDE_DIR}) set_property(TARGET Azure::azure-storage-blobs PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-storage-common) - add_dependencies(Azure::azure-storage-blobs azuresdk_ep) + add_dependencies(Azure::azure-storage-blobs azure-sdk_ep) add_library(Azure::azure-storage-files-datalake STATIC IMPORTED) set_target_properties(Azure::azure-storage-files-datalake PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES - ${AZURESDK_INCLUDE_DIR}) + ${AZURE_SDK_INCLUDE_DIR}) set_property(TARGET Azure::azure-storage-files-datalake PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-storage-blobs) - add_dependencies(Azure::azure-storage-files-datalake azuresdk_ep) + add_dependencies(Azure::azure-storage-files-datalake azure-sdk_ep) set(AZURE_SDK_VENDORED TRUE) - set(AZURESDK_LIBRARIES) + set(AZURE_SDK_LIBRARIES) list(APPEND - AZURESDK_LIBRARIES + AZURE_SDK_LIBRARIES Azure::azure-core Azure::azure-identity Azure::azure-storage-blobs @@ -5176,7 +5176,7 @@ macro(build_azure_sdk) Azure::azure-storage-common Azure::azure-storage-files-datalake) - set(AZURESDK_LINK_LIBRARIES ${AZURESDK_LIBRARIES}) + set(AZURE_SDK_LINK_LIBRARIES ${AZURE_SDK_LIBRARIES}) endmacro() if(ARROW_WITH_AZURE_SDK) @@ -5188,8 +5188,8 @@ if(ARROW_WITH_AZURE_SDK) resolve_dependency(Azure::azure-storage-files-datalake) else() resolve_dependency(AZURE_SDK) - message(STATUS "Found Azure SDK headers: ${AZURESDK_INCLUDE_DIR}") - message(STATUS "Found Azure SDK libraries: ${AZURESDK_LINK_LIBRARIES}") + message(STATUS "Found Azure SDK headers: ${AZURE_SDK_INCLUDE_DIR}") + message(STATUS "Found Azure SDK libraries: ${AZURE_SDK_LINK_LIBRARIES}") endif() endif() From 621af79cbd0a23d5d030bb4fd0eb79ac62bffbed Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 22:34:45 +0100 Subject: [PATCH 63/93] Typo --- ci/vcpkg/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/vcpkg/vcpkg.json b/ci/vcpkg/vcpkg.json index daa189df4ab2a..133545ea04427 100644 --- a/ci/vcpkg/vcpkg.json +++ b/ci/vcpkg/vcpkg.json @@ -39,7 +39,7 @@ ], "default-features": [], "features": { - "azure" { + "azure": { "description": "Azure support", "dependencies": [ "libxml2" From 3d005d1cbf45679517e2d46be3422de03d48afc0 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 14 Aug 2023 23:14:20 +0100 Subject: [PATCH 64/93] Create FindAzure.cmake --- cpp/cmake_modules/FindAzure.cmake | 27 +++++++++++++++++++++ cpp/cmake_modules/ThirdpartyToolchain.cmake | 18 ++++---------- 2 files changed, 32 insertions(+), 13 deletions(-) create mode 100644 cpp/cmake_modules/FindAzure.cmake diff --git a/cpp/cmake_modules/FindAzure.cmake b/cpp/cmake_modules/FindAzure.cmake new file mode 100644 index 0000000000000..c9d03a94cc38a --- /dev/null +++ b/cpp/cmake_modules/FindAzure.cmake @@ -0,0 +1,27 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +if(Azure_FOUND) + return() +endif() + +message(STATUS "find azure sdk") +find_package(Azure::azure-core) +find_package(Azure::azure-identity) +find_package(Azure::azure-storage-blobs) +find_package(Azure::azure-storage-common) +find_package(Azure::azure-storage-files-datalake) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index aadce8068ae94..d217d74af7d5b 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -46,7 +46,7 @@ set(ARROW_RE2_LINKAGE set(ARROW_THIRDPARTY_DEPENDENCIES absl AWSSDK - AZURE_SDK + Azure benchmark Boost Brotli @@ -160,7 +160,7 @@ macro(build_dependency DEPENDENCY_NAME) build_absl() elseif("${DEPENDENCY_NAME}" STREQUAL "AWSSDK") build_awssdk() - elseif("${DEPENDENCY_NAME}" STREQUAL "AZURE_SDK") + elseif("${DEPENDENCY_NAME}" STREQUAL "Azure") build_azure_sdk() elseif("${DEPENDENCY_NAME}" STREQUAL "benchmark") build_benchmark() @@ -5180,17 +5180,9 @@ macro(build_azure_sdk) endmacro() if(ARROW_WITH_AZURE_SDK) - if(AZURE_SDK_SOURCE STREQUAL "SYSTEM") - resolve_dependency(Azure::azure-core) - resolve_dependency(Azure::azure-identity) - resolve_dependency(Azure::azure-storage-blobs) - resolve_dependency(Azure::azure-storage-common) - resolve_dependency(Azure::azure-storage-files-datalake) - else() - resolve_dependency(AZURE_SDK) - message(STATUS "Found Azure SDK headers: ${AZURE_SDK_INCLUDE_DIR}") - message(STATUS "Found Azure SDK libraries: ${AZURE_SDK_LINK_LIBRARIES}") - endif() + resolve_dependency(Azure) + message(STATUS "Found Azure SDK headers: ${AZURE_SDK_INCLUDE_DIR}") + message(STATUS "Found Azure SDK libraries: ${AZURE_SDK_LINK_LIBRARIES}") endif() # ---------------------------------------------------------------------- From c0517b2e2313399ceee794964ef2424afe3326d2 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Tue, 15 Aug 2023 22:47:07 +0100 Subject: [PATCH 65/93] Somewhat working FindAzure.cmake --- cpp/cmake_modules/FindAzure.cmake | 32 +++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/cpp/cmake_modules/FindAzure.cmake b/cpp/cmake_modules/FindAzure.cmake index c9d03a94cc38a..eecc5c9aab332 100644 --- a/cpp/cmake_modules/FindAzure.cmake +++ b/cpp/cmake_modules/FindAzure.cmake @@ -19,9 +19,29 @@ if(Azure_FOUND) return() endif() -message(STATUS "find azure sdk") -find_package(Azure::azure-core) -find_package(Azure::azure-identity) -find_package(Azure::azure-storage-blobs) -find_package(Azure::azure-storage-common) -find_package(Azure::azure-storage-files-datalake) +set(FIND_PACKAGE_ARGUMENTS) +list(APPEND FIND_PACKAGE_ARGUMENTS CONFIG) +if(Azure_FIND_REQUIRED) + list(APPEND FIND_PACKAGE_ARGUMENTS REQUIRED) +endif() + +find_package(azure-core-cpp ${FIND_PACKAGE_ARGUMENTS}) +find_package(azure-identity-cpp ${FIND_PACKAGE_ARGUMENTS}) +find_package(azure-storage-blobs-cpp ${FIND_PACKAGE_ARGUMENTS}) +find_package(azure-storage-common-cpp ${FIND_PACKAGE_ARGUMENTS}) +find_package(azure-storage-files-datalake-cpp ${FIND_PACKAGE_ARGUMENTS}) + +if(azure-core-cpp_FOUND AND azure-identity-cpp_FOUND AND azure-storage-blobs-cpp_FOUND + AND azure-storage-common-cpp_FOUND AND azure-storage-files-datalake-cpp_FOUND) + list(APPEND + AZURE_SDK_LINK_LIBRARIES + Azure::azure-core + Azure::azure-identity + Azure::azure-storage-blobs + Azure::azure-storage-common + Azure::azure-storage-files-datalake + ) + set(Azure_FOUND TRUE) +else() + set(Azure_FOUND FALSE) +endif() From d60ea2059a80358afb1ef38c9cfdf33cb22eeae8 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Tue, 15 Aug 2023 23:07:22 +0100 Subject: [PATCH 66/93] Update bundled configurations --- ci/docker/ubuntu-20.04-cpp.dockerfile | 2 +- ci/docker/ubuntu-22.04-cpp.dockerfile | 2 +- ci/scripts/cpp_build.sh | 2 +- ci/scripts/python_wheel_manylinux_build.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/docker/ubuntu-20.04-cpp.dockerfile b/ci/docker/ubuntu-20.04-cpp.dockerfile index d66aaad4494db..c970173e229b2 100644 --- a/ci/docker/ubuntu-20.04-cpp.dockerfile +++ b/ci/docker/ubuntu-20.04-cpp.dockerfile @@ -175,7 +175,7 @@ ENV absl_SOURCE=BUNDLED \ ARROW_WITH_ZSTD=ON \ ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-${llvm}/bin/llvm-symbolizer \ AWSSDK_SOURCE=BUNDLED \ - AZURE_SDK_SOURCE=BUNDLED \ + Azure_SOURCE=BUNDLED \ google_cloud_cpp_storage_SOURCE=BUNDLED \ gRPC_SOURCE=BUNDLED \ GTest_SOURCE=BUNDLED \ diff --git a/ci/docker/ubuntu-22.04-cpp.dockerfile b/ci/docker/ubuntu-22.04-cpp.dockerfile index 134bc5fe8a60a..b1d013c75cbf7 100644 --- a/ci/docker/ubuntu-22.04-cpp.dockerfile +++ b/ci/docker/ubuntu-22.04-cpp.dockerfile @@ -199,7 +199,7 @@ ENV absl_SOURCE=BUNDLED \ ARROW_WITH_ZSTD=ON \ ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-${llvm}/bin/llvm-symbolizer \ AWSSDK_SOURCE=BUNDLED \ - AZURE_SDK_SOURCE=BUNDLED \ + Azure_SOURCE=BUNDLED \ google_cloud_cpp_storage_SOURCE=BUNDLED \ GTest_SOURCE=BUNDLED \ ORC_SOURCE=BUNDLED \ diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh index 9f89cef521d69..d73f4ad23085e 100755 --- a/ci/scripts/cpp_build.sh +++ b/ci/scripts/cpp_build.sh @@ -152,7 +152,7 @@ cmake \ -DARROW_WITH_ZLIB=${ARROW_WITH_ZLIB:-OFF} \ -DARROW_WITH_ZSTD=${ARROW_WITH_ZSTD:-OFF} \ -DAWSSDK_SOURCE=${AWSSDK_SOURCE:-} \ - -DAZURE_SDK_SOURCE=${AZURE_SDK_SOURCE:-} \ + -DAzure_SOURCE=${Azure_SOURCE:-} \ -Dbenchmark_SOURCE=${benchmark_SOURCE:-} \ -DBOOST_SOURCE=${BOOST_SOURCE:-} \ -DBrotli_SOURCE=${Brotli_SOURCE:-} \ diff --git a/ci/scripts/python_wheel_manylinux_build.sh b/ci/scripts/python_wheel_manylinux_build.sh index 5e2c451575073..5d1d97fc8de00 100755 --- a/ci/scripts/python_wheel_manylinux_build.sh +++ b/ci/scripts/python_wheel_manylinux_build.sh @@ -89,7 +89,7 @@ pushd /tmp/arrow-build cmake \ -DARROW_ACERO=${ARROW_ACERO} \ -DARROW_AZURE=${ARROW_AZURE} \ - -DAZURE_SDK_SOURCE=BUNDLED \ + -DAzure_SOURCE=BUNDLED \ -DARROW_BUILD_SHARED=ON \ -DARROW_BUILD_STATIC=OFF \ -DARROW_BUILD_TESTS=OFF \ From cfc3c6fe3c4c56e0c3c3f0dc184868ba56a7c111 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 16 Aug 2023 00:32:04 +0100 Subject: [PATCH 67/93] Functional FindAzure.cmake --- cpp/cmake_modules/FindAzure.cmake | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/cpp/cmake_modules/FindAzure.cmake b/cpp/cmake_modules/FindAzure.cmake index eecc5c9aab332..a4de4ca1eb19f 100644 --- a/cpp/cmake_modules/FindAzure.cmake +++ b/cpp/cmake_modules/FindAzure.cmake @@ -19,17 +19,26 @@ if(Azure_FOUND) return() endif() -set(FIND_PACKAGE_ARGUMENTS) -list(APPEND FIND_PACKAGE_ARGUMENTS CONFIG) +set(find_package_args) +list(APPEND find_package_args + CONFIG + # Avoid finding cmake files in local copies of the Azure SDK for C++. + # e.g. the extracted copy from the previous build. + NO_CMAKE_PACKAGE_REGISTRY +) +if(Azure_FIND_QUIETLY) + list(APPEND find_package_args QUIET) +endif() + if(Azure_FIND_REQUIRED) - list(APPEND FIND_PACKAGE_ARGUMENTS REQUIRED) + list(APPEND find_package_args REQUIRED) endif() -find_package(azure-core-cpp ${FIND_PACKAGE_ARGUMENTS}) -find_package(azure-identity-cpp ${FIND_PACKAGE_ARGUMENTS}) -find_package(azure-storage-blobs-cpp ${FIND_PACKAGE_ARGUMENTS}) -find_package(azure-storage-common-cpp ${FIND_PACKAGE_ARGUMENTS}) -find_package(azure-storage-files-datalake-cpp ${FIND_PACKAGE_ARGUMENTS}) +find_package(azure-core-cpp ${find_package_args}) +find_package(azure-identity-cpp ${find_package_args}) +find_package(azure-storage-blobs-cpp ${find_package_args}) +find_package(azure-storage-common-cpp ${find_package_args}) +find_package(azure-storage-files-datalake-cpp ${find_package_args}) if(azure-core-cpp_FOUND AND azure-identity-cpp_FOUND AND azure-storage-blobs-cpp_FOUND AND azure-storage-common-cpp_FOUND AND azure-storage-files-datalake-cpp_FOUND) From 971e017e0f19e955f9c8442aa3af4462cd7cf249 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 16 Aug 2023 08:44:07 +0100 Subject: [PATCH 68/93] snake case + update comment --- cpp/src/arrow/filesystem/azurefs.cc | 11 +++++---- cpp/src/arrow/filesystem/azurefs_test.cc | 30 ++++++++++++------------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index 8e7e9358d224e..177d62cdfc32c 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -49,11 +49,12 @@ class AzureFileSystem::Impl { : io_context_(io_context), options_(std::move(options)) {} Status Init() { - // TODO: Delete this once we have a proper implementation. This is just here to - // ensure the build is working correctly with the Azure SDK. - auto defaultCredential = std::make_shared(); - auto serviceClient = Azure::Storage::Blobs::BlobServiceClient( - "http://fake-blob-storage-endpoit", defaultCredential); + // TODO: GH-18014 Delete this once we have a proper implementation. This just + // initializes a pointless Azure blob service client with a fake endpoint to ensure + // the build will fail if the Azure SDK build is broken. + auto default_credential = std::make_shared(); + auto service_client = Azure::Storage::Blobs::BlobServiceClient( + "http://fake-blob-storage-endpoint", default_credential); if (options_.backend == AzureBackend::Azurite) { // gen1Client_->GetAccountInfo().Value.IsHierarchicalNamespaceEnabled // throws error in azurite diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index 3d132c3774076..ec34db1a4cd99 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -114,9 +114,9 @@ AzuriteEnv* GetAzuriteEnv() { // Placeholder tests // TODO: GH-18014 Remove once a proper test is added TEST(AzureFileSystem, UploadThenDownload) { - const std::string containerName = "sample-container"; - const std::string blobName = "sample-blob.txt"; - const std::string blobContent = "Hello Azure!"; + const std::string container_name = "sample-container"; + const std::string blob_name = "sample-blob.txt"; + const std::string blob_content = "Hello Azure!"; const std::string& account_name = GetAzuriteEnv()->account_name(); const std::string& account_key = GetAzuriteEnv()->account_key(); @@ -124,26 +124,26 @@ TEST(AzureFileSystem, UploadThenDownload) { auto credential = std::make_shared( account_name, account_key); - auto serviceClient = Azure::Storage::Blobs::BlobServiceClient( + auto service_client = Azure::Storage::Blobs::BlobServiceClient( "http://127.0.0.1:10000/devstoreaccount1", credential); - auto containerClient = serviceClient.GetBlobContainerClient(containerName); - containerClient.CreateIfNotExists(); - auto blobClient = containerClient.GetBlockBlobClient(blobName); + auto container_client = service_client.GetBlobContainerClient(container_name); + container_client.CreateIfNotExists(); + auto blob_client = container_client.GetBlockBlobClient(blob_name); - std::vector buffer(blobContent.begin(), blobContent.end()); - blobClient.UploadFrom(buffer.data(), buffer.size()); + std::vector buffer(blob_content.begin(), blob_content.end()); + blob_client.UploadFrom(buffer.data(), buffer.size()); - std::vector buffer2(blobContent.size()); - blobClient.DownloadTo(buffer2.data(), buffer2.size()); + std::vector buffer2(blob_content.size()); + blob_client.DownloadTo(buffer2.data(), buffer2.size()); - EXPECT_EQ(std::string(buffer2.begin(), buffer2.end()), blobContent); + EXPECT_EQ(std::string(buffer2.begin(), buffer2.end()), blob_content); } TEST(AzureFileSystem, InitializeCredentials) { - auto defaultCredential = std::make_shared(); - auto managedIdentityCredential = + auto default_credential = std::make_shared(); + auto managed_identity_credential = std::make_shared(); - auto servicePrincipalCredential = + auto service_principal_credential = std::make_shared("tenant_id", "client_id", "client_secret"); } From f16c7e1e23de71114d3c5e7d94931a638a5258c3 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 16 Aug 2023 01:20:46 +0100 Subject: [PATCH 69/93] Kou's suggestions to minimise dependencies --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index d217d74af7d5b..f84a839b287ea 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5125,39 +5125,27 @@ macro(build_azure_sdk) add_library(Azure::azure-identity STATIC IMPORTED) set_target_properties(Azure::azure-identity - PROPERTIES IMPORTED_LOCATION ${AZURE_IDENTITY_STATIC_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES - ${AZURE_SDK_INCLUDE_DIR}) + PROPERTIES IMPORTED_LOCATION ${AZURE_IDENTITY_STATIC_LIBRARY}) set_property(TARGET Azure::azure-identity PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::Crypto Azure::azure-core) - add_dependencies(Azure::azure-identity azure-sdk_ep) add_library(Azure::azure-storage-common STATIC IMPORTED) set_target_properties(Azure::azure-storage-common - PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_COMMON_STATIC_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES - ${AZURE_SDK_INCLUDE_DIR}) + PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_COMMON_STATIC_LIBRARY}) set_property(TARGET Azure::azure-storage-common PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::SSL OpenSSL::Crypto LibXml2::LibXml2 Azure::azure-core) - add_dependencies(Azure::azure-storage-common azure-sdk_ep) add_library(Azure::azure-storage-blobs STATIC IMPORTED) set_target_properties(Azure::azure-storage-blobs - PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES - ${AZURE_SDK_INCLUDE_DIR}) + PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY}) set_property(TARGET Azure::azure-storage-blobs PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-storage-common) - add_dependencies(Azure::azure-storage-blobs azure-sdk_ep) add_library(Azure::azure-storage-files-datalake STATIC IMPORTED) set_target_properties(Azure::azure-storage-files-datalake - PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES - ${AZURE_SDK_INCLUDE_DIR}) + PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY}) set_property(TARGET Azure::azure-storage-files-datalake PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-storage-blobs) - add_dependencies(Azure::azure-storage-files-datalake azure-sdk_ep) set(AZURE_SDK_VENDORED TRUE) set(AZURE_SDK_LIBRARIES) From e012756d598cfab1f97f962c3c6ba097c46baf5e Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 16 Aug 2023 10:53:51 +0100 Subject: [PATCH 70/93] Update cpp/cmake_modules/ThirdpartyToolchain.cmake Co-authored-by: Sutou Kouhei --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index f84a839b287ea..869b284a20e77 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5073,7 +5073,6 @@ macro(build_azure_sdk) find_curl() find_package(LibXml2 REQUIRED) - add_custom_target(azure_sdk_dependencies) set(AZURE_SDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azure-sdk_ep-install") set(AZURE_SDK_INCLUDE_DIR "${AZURE_SDK_PREFIX}/include") From 2617c20f4a70c9bbe5a25ae78849075142ba7534 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 16 Aug 2023 10:54:41 +0100 Subject: [PATCH 71/93] Update cpp/cmake_modules/ThirdpartyToolchain.cmake Co-authored-by: Sutou Kouhei --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 869b284a20e77..1ec77e14da5f1 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5111,8 +5111,7 @@ macro(build_azure_sdk) ${AZURE_IDENTITY_STATIC_LIBRARY} ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} ${AZURE_STORAGE_COMMON_STATIC_LIBRARY} - ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY} - DEPENDS azure_sdk_dependencies) + ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY}) add_library(Azure::azure-core STATIC IMPORTED) set_target_properties(Azure::azure-core PROPERTIES IMPORTED_LOCATION ${AZURE_CORE_STATIC_LIBRARY} From 13bdcf7ebe90c8fc8c76fbb1b017584370883ad0 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sun, 20 Aug 2023 10:57:52 +0100 Subject: [PATCH 72/93] CMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON --- cpp/cmake_modules/FindAzure.cmake | 27 +++++++-------------- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/cpp/cmake_modules/FindAzure.cmake b/cpp/cmake_modules/FindAzure.cmake index a4de4ca1eb19f..4ab87ed27320c 100644 --- a/cpp/cmake_modules/FindAzure.cmake +++ b/cpp/cmake_modules/FindAzure.cmake @@ -21,10 +21,7 @@ endif() set(find_package_args) list(APPEND find_package_args - CONFIG - # Avoid finding cmake files in local copies of the Azure SDK for C++. - # e.g. the extracted copy from the previous build. - NO_CMAKE_PACKAGE_REGISTRY + CONFIG ) if(Azure_FIND_QUIETLY) list(APPEND find_package_args QUIET) @@ -40,17 +37,11 @@ find_package(azure-storage-blobs-cpp ${find_package_args}) find_package(azure-storage-common-cpp ${find_package_args}) find_package(azure-storage-files-datalake-cpp ${find_package_args}) -if(azure-core-cpp_FOUND AND azure-identity-cpp_FOUND AND azure-storage-blobs-cpp_FOUND - AND azure-storage-common-cpp_FOUND AND azure-storage-files-datalake-cpp_FOUND) - list(APPEND - AZURE_SDK_LINK_LIBRARIES - Azure::azure-core - Azure::azure-identity - Azure::azure-storage-blobs - Azure::azure-storage-common - Azure::azure-storage-files-datalake - ) - set(Azure_FOUND TRUE) -else() - set(Azure_FOUND FALSE) -endif() +find_package_handle_standard_args( + Azure + REQUIRED_VARS azure-core-cpp_FOUND + azure-identity-cpp_FOUND + azure-storage-blobs-cpp_FOUND + azure-storage-common-cpp_FOUND + azure-storage-files-datalake-cpp_FOUND + VERSION_VAR azure-storage-files-datalake-cpp_VERSION) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 1ec77e14da5f1..f6f533275595c 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -928,7 +928,7 @@ set(EP_COMMON_CMAKE_ARGS -DCMAKE_C_FLAGS_MISIZEREL=${EP_C_FLAGS_MINSIZEREL} -DCMAKE_C_FLAGS_RELEASE=${EP_C_FLAGS_RELEASE} -DCMAKE_C_FLAGS_RELWITHDEBINFO=${EP_C_FLAGS_RELWITHDEBINFO} - -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=${CMAKE_EXPORT_NO_PACKAGE_REGISTRY} + -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=${CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} From dca8a6f52349d80ece5f5848713d9e3e44f7eb67 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sun, 20 Aug 2023 10:49:16 +0100 Subject: [PATCH 73/93] Update cpp/src/arrow/filesystem/azurefs_test.cc Co-authored-by: Sutou Kouhei --- cpp/src/arrow/filesystem/azurefs_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index ec34db1a4cd99..f000ac6971651 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -125,7 +125,7 @@ TEST(AzureFileSystem, UploadThenDownload) { account_name, account_key); auto service_client = Azure::Storage::Blobs::BlobServiceClient( - "http://127.0.0.1:10000/devstoreaccount1", credential); + std::string("http://127.0.0.1:10000/") + account_name, credential); auto container_client = service_client.GetBlobContainerClient(container_name); container_client.CreateIfNotExists(); auto blob_client = container_client.GetBlockBlobClient(blob_name); From 7a9c67a2f1243999a994ebad4ca17e5e4b4995e2 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 21 Aug 2023 13:10:18 +0100 Subject: [PATCH 74/93] Disable azure on manylinux build --- ci/docker/python-wheel-manylinux.dockerfile | 1 - ci/scripts/python_wheel_manylinux_build.sh | 4 ---- ci/vcpkg/vcpkg.json | 6 ------ cpp/vcpkg.json | 1 - 4 files changed, 12 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index b27c169ae1895..0f7779c878505 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -81,7 +81,6 @@ RUN vcpkg install \ --clean-after-build \ --x-install-root=${VCPKG_ROOT}/installed \ --x-manifest-root=/arrow/ci/vcpkg \ - --x-feature=azure \ --x-feature=flight \ --x-feature=gcs \ --x-feature=json \ diff --git a/ci/scripts/python_wheel_manylinux_build.sh b/ci/scripts/python_wheel_manylinux_build.sh index 5d1d97fc8de00..58e42fea88088 100755 --- a/ci/scripts/python_wheel_manylinux_build.sh +++ b/ci/scripts/python_wheel_manylinux_build.sh @@ -49,7 +49,6 @@ rm -rf /arrow/python/pyarrow/*.so.* echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries ===" : ${ARROW_ACERO:=ON} -: ${ARROW_AZURE:=ON} : ${ARROW_DATASET:=ON} : ${ARROW_FLIGHT:=ON} : ${ARROW_GANDIVA:=OFF} @@ -88,8 +87,6 @@ pushd /tmp/arrow-build cmake \ -DARROW_ACERO=${ARROW_ACERO} \ - -DARROW_AZURE=${ARROW_AZURE} \ - -DAzure_SOURCE=BUNDLED \ -DARROW_BUILD_SHARED=ON \ -DARROW_BUILD_STATIC=OFF \ -DARROW_BUILD_TESTS=OFF \ @@ -148,7 +145,6 @@ export PYARROW_WITH_DATASET=${ARROW_DATASET} export PYARROW_WITH_FLIGHT=${ARROW_FLIGHT} export PYARROW_WITH_GANDIVA=${ARROW_GANDIVA} export PYARROW_WITH_GCS=${ARROW_GCS} -export PYARROW_WITH_AZURE=${ARROW_AZURE} export PYARROW_WITH_HDFS=${ARROW_HDFS} export PYARROW_WITH_ORC=${ARROW_ORC} export PYARROW_WITH_PARQUET=${ARROW_PARQUET} diff --git a/ci/vcpkg/vcpkg.json b/ci/vcpkg/vcpkg.json index 133545ea04427..71c23165e61f0 100644 --- a/ci/vcpkg/vcpkg.json +++ b/ci/vcpkg/vcpkg.json @@ -39,12 +39,6 @@ ], "default-features": [], "features": { - "azure": { - "description": "Azure support", - "dependencies": [ - "libxml2" - ] - }, "dev": { "description": "Development dependencies", "dependencies": [ diff --git a/cpp/vcpkg.json b/cpp/vcpkg.json index 87f2b8988f555..71855dafdea35 100644 --- a/cpp/vcpkg.json +++ b/cpp/vcpkg.json @@ -37,7 +37,6 @@ }, "grpc", "gtest", - "libxml2", "lz4", "openssl", "orc", From a7a7077d8fdd5801b9a0e38409486b73b37df186 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 21 Aug 2023 09:25:54 +0100 Subject: [PATCH 75/93] Disable azure on Ubuntu 20 build --- ci/docker/ubuntu-20.04-cpp.dockerfile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ci/docker/ubuntu-20.04-cpp.dockerfile b/ci/docker/ubuntu-20.04-cpp.dockerfile index c970173e229b2..5a46212d7fb39 100644 --- a/ci/docker/ubuntu-20.04-cpp.dockerfile +++ b/ci/docker/ubuntu-20.04-cpp.dockerfile @@ -99,7 +99,6 @@ RUN apt-get update -y -q && \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ - libxml2-dev \ libzstd-dev \ make \ ninja-build \ @@ -115,9 +114,7 @@ RUN apt-get update -y -q && \ rapidjson-dev \ rsync \ tzdata \ - wget \ - zip \ - unzip && \ + wget && \ apt-get clean && \ rm -rf /var/lib/apt/lists* @@ -148,7 +145,6 @@ RUN /arrow/ci/scripts/install_sccache.sh unknown-linux-musl /usr/local/bin # static Arrow to run Flight/Flight SQL tests ENV absl_SOURCE=BUNDLED \ ARROW_ACERO=ON \ - ARROW_AZURE=ON \ ARROW_BUILD_STATIC=ON \ ARROW_BUILD_TESTS=ON \ ARROW_DEPENDENCY_SOURCE=SYSTEM \ @@ -175,7 +171,6 @@ ENV absl_SOURCE=BUNDLED \ ARROW_WITH_ZSTD=ON \ ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-${llvm}/bin/llvm-symbolizer \ AWSSDK_SOURCE=BUNDLED \ - Azure_SOURCE=BUNDLED \ google_cloud_cpp_storage_SOURCE=BUNDLED \ gRPC_SOURCE=BUNDLED \ GTest_SOURCE=BUNDLED \ From 1212c19bdb5156b1a8f726f2a1b88815a376986f Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Mon, 21 Aug 2023 13:09:18 +0100 Subject: [PATCH 76/93] Kou's FetchContent patch --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 121 +++++--------------- 1 file changed, 30 insertions(+), 91 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index f6f533275595c..ea06d026fd2e6 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -975,6 +975,8 @@ else() set(MAKE_BUILD_ARGS "-j${NPROC}") endif() +include(FetchContent) + # ---------------------------------------------------------------------- # Find pthreads @@ -5068,92 +5070,25 @@ endif() # ---------------------------------------------------------------------- # Azure SDK for C++ -macro(build_azure_sdk) +function(build_azure_sdk) message(STATUS "Building Azure SDK for C++ from source") - - find_curl() - find_package(LibXml2 REQUIRED) - - set(AZURE_SDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/azure-sdk_ep-install") - set(AZURE_SDK_INCLUDE_DIR "${AZURE_SDK_PREFIX}/include") - - set(AZURE_SDK_COMMON_CMAKE_ARGS - ${EP_COMMON_CMAKE_ARGS} - "-DCMAKE_INSTALL_PREFIX=" - "-DCMAKE_PREFIX_PATH=${AZURE_SDK_PREFIX}" - -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON - -DWARNINGS_AS_ERRORS=OFF - -DVCPKG_OVERLAY_PORTS=${CMAKE_SOURCE_DIR}/overlays) - - file(MAKE_DIRECTORY ${AZURE_SDK_INCLUDE_DIR}) - set(AZURE_CORE_STATIC_LIBRARY - "${AZURE_SDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-core${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - set(AZURE_IDENTITY_STATIC_LIBRARY - "${AZURE_SDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-identity${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - set(AZURE_STORAGE_BLOBS_STATIC_LIBRARY - "${AZURE_SDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-blobs${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - set(AZURE_STORAGE_COMMON_STATIC_LIBRARY - "${AZURE_SDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-common${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - set(AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY - "${AZURE_SDK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}azure-storage-files-datalake${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - externalproject_add(azure-sdk_ep - ${EP_COMMON_OPTIONS} - INSTALL_DIR ${AZURE_SDK_PREFIX} - URL ${ARROW_AZURE_SDK_URL} - URL_HASH "SHA256=${ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM}" - CMAKE_ARGS ${AZURE_SDK_COMMON_CMAKE_ARGS} - BUILD_BYPRODUCTS ${AZURE_CORE_STATIC_LIBRARY} - ${AZURE_IDENTITY_STATIC_LIBRARY} - ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY} - ${AZURE_STORAGE_COMMON_STATIC_LIBRARY} - ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY}) - add_library(Azure::azure-core STATIC IMPORTED) - set_target_properties(Azure::azure-core - PROPERTIES IMPORTED_LOCATION ${AZURE_CORE_STATIC_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES - ${AZURE_SDK_INCLUDE_DIR}) - set_property(TARGET Azure::azure-core - PROPERTY INTERFACE_LINK_LIBRARIES CURL::libcurl OpenSSL::SSL) - add_dependencies(Azure::azure-core azure-sdk_ep) - - add_library(Azure::azure-identity STATIC IMPORTED) - set_target_properties(Azure::azure-identity - PROPERTIES IMPORTED_LOCATION ${AZURE_IDENTITY_STATIC_LIBRARY}) - set_property(TARGET Azure::azure-identity - PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::Crypto Azure::azure-core) - - add_library(Azure::azure-storage-common STATIC IMPORTED) - set_target_properties(Azure::azure-storage-common - PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_COMMON_STATIC_LIBRARY}) - set_property(TARGET Azure::azure-storage-common - PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::SSL OpenSSL::Crypto LibXml2::LibXml2 Azure::azure-core) - - add_library(Azure::azure-storage-blobs STATIC IMPORTED) - set_target_properties(Azure::azure-storage-blobs - PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_BLOBS_STATIC_LIBRARY}) - set_property(TARGET Azure::azure-storage-blobs - PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-storage-common) - - add_library(Azure::azure-storage-files-datalake STATIC IMPORTED) - set_target_properties(Azure::azure-storage-files-datalake - PROPERTIES IMPORTED_LOCATION ${AZURE_STORAGE_FILES_DATALAKE_STATIC_LIBRARY}) - set_property(TARGET Azure::azure-storage-files-datalake - PROPERTY INTERFACE_LINK_LIBRARIES Azure::azure-storage-blobs) - - set(AZURE_SDK_VENDORED TRUE) - set(AZURE_SDK_LIBRARIES) - list(APPEND - AZURE_SDK_LIBRARIES - Azure::azure-core - Azure::azure-identity - Azure::azure-storage-blobs - Azure::azure-storage-common - Azure::azure-storage-files-datalake) + fetchcontent_declare(azure_sdk + URL ${ARROW_AZURE_SDK_URL} + URL_HASH "SHA256=${ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM}") + fetchcontent_getproperties(azure_sdk) + if(NOT azure_sdk_POPULATED) + fetchcontent_populate(azure_sdk) + set(BUILD_PERFORMANCE_TESTS FALSE) + set(BUILD_SAMPLES FALSE) + set(BUILD_TESTING FALSE) + set(BUILD_WINDOWS_UWP TRUE) + set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY TRUE) + set(DISABLE_AZURE_CORE_OPENTELEMETRY TRUE) + add_subdirectory(${azure_sdk_SOURCE_DIR} ${azure_sdk_BINARY_DIR} EXCLUDE_FROM_ALL) + endif() + set(AZURE_SDK_VENDORED + TRUE + PARENT_SCOPE) list(APPEND ARROW_BUNDLED_STATIC_LIBS Azure::azure-core @@ -5161,16 +5096,20 @@ macro(build_azure_sdk) Azure::azure-storage-blobs Azure::azure-storage-common Azure::azure-storage-files-datalake) - - set(AZURE_SDK_LINK_LIBRARIES ${AZURE_SDK_LIBRARIES}) -endmacro() +set(ARROW_BUNDLED_STATIC_LIBS + ${ARROW_BUNDLED_STATIC_LIBS} + PARENT_SCOPE) +endfunction() if(ARROW_WITH_AZURE_SDK) resolve_dependency(Azure) - message(STATUS "Found Azure SDK headers: ${AZURE_SDK_INCLUDE_DIR}") - message(STATUS "Found Azure SDK libraries: ${AZURE_SDK_LINK_LIBRARIES}") + set(AZURE_SDK_LINK_LIBRARIES + Azure::azure-storage-files-datalake + Azure::azure-storage-common + Azure::azure-storage-blobs + Azure::azure-identity + Azure::azure-core) endif() - # ---------------------------------------------------------------------- # ucx - communication framework for modern, high-bandwidth and low-latency networks From f357561d1b80d1c2f07401fba49cdbd45eacb453 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Tue, 22 Aug 2023 09:11:08 +0100 Subject: [PATCH 77/93] Revert now unnecessary zip and unzip apt installs --- ci/docker/ubuntu-22.04-cpp.dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ci/docker/ubuntu-22.04-cpp.dockerfile b/ci/docker/ubuntu-22.04-cpp.dockerfile index b1d013c75cbf7..dedeedd979f72 100644 --- a/ci/docker/ubuntu-22.04-cpp.dockerfile +++ b/ci/docker/ubuntu-22.04-cpp.dockerfile @@ -113,9 +113,7 @@ RUN apt-get update -y -q && \ rapidjson-dev \ rsync \ tzdata \ - wget \ - zip \ - unzip && \ + wget && \ apt-get clean && \ rm -rf /var/lib/apt/lists* From 6d3ba286667375df7dc1d1e59532c73e814489cf Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Tue, 22 Aug 2023 09:20:07 +0100 Subject: [PATCH 78/93] Remove now unnecessary vcpkg overlays --- cpp/overlays/openssl/portfile.cmake | 1 - cpp/overlays/openssl/vcpkg.json | 4 ---- 2 files changed, 5 deletions(-) delete mode 100644 cpp/overlays/openssl/portfile.cmake delete mode 100644 cpp/overlays/openssl/vcpkg.json diff --git a/cpp/overlays/openssl/portfile.cmake b/cpp/overlays/openssl/portfile.cmake deleted file mode 100644 index 065116c276adc..0000000000000 --- a/cpp/overlays/openssl/portfile.cmake +++ /dev/null @@ -1 +0,0 @@ -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/cpp/overlays/openssl/vcpkg.json b/cpp/overlays/openssl/vcpkg.json deleted file mode 100644 index 47f0999a75e57..0000000000000 --- a/cpp/overlays/openssl/vcpkg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "openssl", - "version": "1.0.2" -} From 2308559c433c0c0143910547264cb613304694a2 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 24 Aug 2023 12:09:01 +0900 Subject: [PATCH 79/93] Fix styles --- cpp/cmake_modules/FindAzure.cmake | 4 +--- cpp/cmake_modules/ThirdpartyToolchain.cmake | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cpp/cmake_modules/FindAzure.cmake b/cpp/cmake_modules/FindAzure.cmake index 4ab87ed27320c..b06c5aaf04026 100644 --- a/cpp/cmake_modules/FindAzure.cmake +++ b/cpp/cmake_modules/FindAzure.cmake @@ -20,9 +20,7 @@ if(Azure_FOUND) endif() set(find_package_args) -list(APPEND find_package_args - CONFIG -) +list(APPEND find_package_args CONFIG) if(Azure_FIND_QUIETLY) list(APPEND find_package_args QUIET) endif() diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index ea06d026fd2e6..9b23b4f6256b6 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5096,9 +5096,9 @@ function(build_azure_sdk) Azure::azure-storage-blobs Azure::azure-storage-common Azure::azure-storage-files-datalake) -set(ARROW_BUNDLED_STATIC_LIBS - ${ARROW_BUNDLED_STATIC_LIBS} - PARENT_SCOPE) + set(ARROW_BUNDLED_STATIC_LIBS + ${ARROW_BUNDLED_STATIC_LIBS} + PARENT_SCOPE) endfunction() if(ARROW_WITH_AZURE_SDK) From a6fac8ff31f111d37bb970fa868c15510492ef26 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 24 Aug 2023 12:09:13 +0900 Subject: [PATCH 80/93] Revert a needless change --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 9b23b4f6256b6..9e318ff73811a 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -928,7 +928,7 @@ set(EP_COMMON_CMAKE_ARGS -DCMAKE_C_FLAGS_MISIZEREL=${EP_C_FLAGS_MINSIZEREL} -DCMAKE_C_FLAGS_RELEASE=${EP_C_FLAGS_RELEASE} -DCMAKE_C_FLAGS_RELWITHDEBINFO=${EP_C_FLAGS_RELWITHDEBINFO} - -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON + -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=${CMAKE_EXPORT_NO_PACKAGE_REGISTRY} -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=${CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} From 88f792b75c1af6db117b18cce626c10b137b935d Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 24 Aug 2023 12:09:39 +0900 Subject: [PATCH 81/93] Improve naming --- cpp/src/arrow/filesystem/azurefs_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index f000ac6971651..d709eb78047fd 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -133,10 +133,10 @@ TEST(AzureFileSystem, UploadThenDownload) { std::vector buffer(blob_content.begin(), blob_content.end()); blob_client.UploadFrom(buffer.data(), buffer.size()); - std::vector buffer2(blob_content.size()); - blob_client.DownloadTo(buffer2.data(), buffer2.size()); + std::vector downloaded_content(blob_content.size()); + blob_client.DownloadTo(downloaded_content.data(), downloaded_content.size()); - EXPECT_EQ(std::string(buffer2.begin(), buffer2.end()), blob_content); + EXPECT_EQ(std::string(downloaded_content.begin(), downloaded_content.end()), blob_content); } TEST(AzureFileSystem, InitializeCredentials) { From 2e258d86d0b85ffec1e9bea71c53aa855f9ba501 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 24 Aug 2023 12:09:53 +0900 Subject: [PATCH 82/93] Use the official name --- cpp/thirdparty/versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index 06321e1997a28..72a01e51346ed 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -53,7 +53,7 @@ ARROW_AWS_LC_BUILD_VERSION=v1.3.0 ARROW_AWS_LC_BUILD_SHA256_CHECKSUM=ae96a3567161552744fc0cae8b4d68ed88b1ec0f3d3c98700070115356da5a37 ARROW_AWSSDK_BUILD_VERSION=1.10.55 ARROW_AWSSDK_BUILD_SHA256_CHECKSUM=2d552fb1a84bef4a9b65e34aa7031851ed2aef5319e02cc6e4cb735c48aa30de -# Despite the confusing version name this is still the whole azure SDK including core, keyvault, storage-common, etc. +# Despite the confusing version name this is still the whole Azure SDK for C++ including core, keyvault, storage-common, etc. ARROW_AZURE_SDK_BUILD_VERSION=azure-identity_1.5.1 ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM=651a660592540c267420b7e1c8dc98428a17396e45f7f6c92a864ab9a4fa028a ARROW_BOOST_BUILD_VERSION=1.81.0 From ff657c1f2629e369eb1a52eb714577f1b6661816 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 24 Aug 2023 12:11:04 +0900 Subject: [PATCH 83/93] Fix style --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 9e318ff73811a..15b9fa1883bdd 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5097,8 +5097,8 @@ function(build_azure_sdk) Azure::azure-storage-common Azure::azure-storage-files-datalake) set(ARROW_BUNDLED_STATIC_LIBS - ${ARROW_BUNDLED_STATIC_LIBS} - PARENT_SCOPE) + ${ARROW_BUNDLED_STATIC_LIBS} + PARENT_SCOPE) endfunction() if(ARROW_WITH_AZURE_SDK) From 704fde7ad7bb35832f373bd05298b00634be4823 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 24 Aug 2023 12:19:48 +0900 Subject: [PATCH 84/93] Disable vcpkg integration --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 15b9fa1883bdd..f4eb699ec2a91 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5084,6 +5084,7 @@ function(build_azure_sdk) set(BUILD_WINDOWS_UWP TRUE) set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY TRUE) set(DISABLE_AZURE_CORE_OPENTELEMETRY TRUE) + set(ENV{AZURE_SDK_DISABLE_AUTO_VCPKG} TRUE) add_subdirectory(${azure_sdk_SOURCE_DIR} ${azure_sdk_BINARY_DIR} EXCLUDE_FROM_ALL) endif() set(AZURE_SDK_VENDORED From 5c9854a0e84f7b07771ba439063e86dcfb2e99b6 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 24 Aug 2023 12:12:35 +0900 Subject: [PATCH 85/93] Fix style --- cpp/src/arrow/filesystem/azurefs.cc | 10 +++++----- cpp/src/arrow/filesystem/azurefs_test.cc | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index 177d62cdfc32c..6d25781319cee 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -17,10 +17,10 @@ #include "arrow/filesystem/azurefs.h" +#include +#include #include "arrow/result.h" #include "arrow/util/checked_cast.h" -#include -#include namespace arrow { namespace fs { @@ -49,12 +49,12 @@ class AzureFileSystem::Impl { : io_context_(io_context), options_(std::move(options)) {} Status Init() { - // TODO: GH-18014 Delete this once we have a proper implementation. This just - // initializes a pointless Azure blob service client with a fake endpoint to ensure + // TODO: GH-18014 Delete this once we have a proper implementation. This just + // initializes a pointless Azure blob service client with a fake endpoint to ensure // the build will fail if the Azure SDK build is broken. auto default_credential = std::make_shared(); auto service_client = Azure::Storage::Blobs::BlobServiceClient( - "http://fake-blob-storage-endpoint", default_credential); + "http://fake-blob-storage-endpoint", default_credential); if (options_.backend == AzureBackend::Azurite) { // gen1Client_->GetAccountInfo().Value.IsHierarchicalNamespaceEnabled // throws error in azurite diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index d709eb78047fd..9bf7cb8e753ec 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -136,7 +136,8 @@ TEST(AzureFileSystem, UploadThenDownload) { std::vector downloaded_content(blob_content.size()); blob_client.DownloadTo(downloaded_content.data(), downloaded_content.size()); - EXPECT_EQ(std::string(downloaded_content.begin(), downloaded_content.end()), blob_content); + EXPECT_EQ(std::string(downloaded_content.begin(), downloaded_content.end()), + blob_content); } TEST(AzureFileSystem, InitializeCredentials) { From 92ce1f91649607122c61b881078bf4a0566afcaa Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Thu, 24 Aug 2023 22:11:42 +0100 Subject: [PATCH 86/93] Update cpp/src/arrow/filesystem/azurefs.cc Co-authored-by: Antoine Pitrou --- cpp/src/arrow/filesystem/azurefs.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index 6d25781319cee..fcbae332d2397 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -19,6 +19,7 @@ #include #include + #include "arrow/result.h" #include "arrow/util/checked_cast.h" From 2b576fd73da044d5291dafbaf66c1cbe69c691b0 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Thu, 24 Aug 2023 22:59:04 +0100 Subject: [PATCH 87/93] Use `fetchcontent_makeavailable` --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index f4eb699ec2a91..1dfaf71b4bd7c 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5075,18 +5075,14 @@ function(build_azure_sdk) fetchcontent_declare(azure_sdk URL ${ARROW_AZURE_SDK_URL} URL_HASH "SHA256=${ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM}") - fetchcontent_getproperties(azure_sdk) - if(NOT azure_sdk_POPULATED) - fetchcontent_populate(azure_sdk) - set(BUILD_PERFORMANCE_TESTS FALSE) - set(BUILD_SAMPLES FALSE) - set(BUILD_TESTING FALSE) - set(BUILD_WINDOWS_UWP TRUE) - set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY TRUE) - set(DISABLE_AZURE_CORE_OPENTELEMETRY TRUE) - set(ENV{AZURE_SDK_DISABLE_AUTO_VCPKG} TRUE) - add_subdirectory(${azure_sdk_SOURCE_DIR} ${azure_sdk_BINARY_DIR} EXCLUDE_FROM_ALL) - endif() + set(BUILD_PERFORMANCE_TESTS FALSE) + set(BUILD_SAMPLES FALSE) + set(BUILD_TESTING FALSE) + set(BUILD_WINDOWS_UWP TRUE) + set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY TRUE) + set(DISABLE_AZURE_CORE_OPENTELEMETRY TRUE) + set(ENV{AZURE_SDK_DISABLE_AUTO_VCPKG} TRUE) + fetchcontent_makeavailable(azure_sdk) set(AZURE_SDK_VENDORED TRUE PARENT_SCOPE) From a205b87682beb9df05fe9f714b06bbab196f4199 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 26 Aug 2023 13:31:02 +0100 Subject: [PATCH 88/93] Patch for disabling Werror in Azure build --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 1dfaf71b4bd7c..9ff91f9784b1d 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5082,6 +5082,13 @@ function(build_azure_sdk) set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY TRUE) set(DISABLE_AZURE_CORE_OPENTELEMETRY TRUE) set(ENV{AZURE_SDK_DISABLE_AUTO_VCPKG} TRUE) + if(MSVC) + string(REPLACE "/WX" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + string(REPLACE "/WX" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + else() + string(REPLACE "-Werror" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + string(REPLACE "-Werror" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + endif() fetchcontent_makeavailable(azure_sdk) set(AZURE_SDK_VENDORED TRUE From 19e6a5605c9b8f0bd5593ffed913baa96b932c44 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 26 Aug 2023 13:38:09 +0100 Subject: [PATCH 89/93] Add comment --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 9ff91f9784b1d..9c830c88dc7a9 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5082,6 +5082,8 @@ function(build_azure_sdk) set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY TRUE) set(DISABLE_AZURE_CORE_OPENTELEMETRY TRUE) set(ENV{AZURE_SDK_DISABLE_AUTO_VCPKG} TRUE) + # TODO: Configure flags in a better way. FetchContent builds inherit + # global flags but we want to disable -Werror for Azure SDK for C++ builds. if(MSVC) string(REPLACE "/WX" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") string(REPLACE "/WX" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") From f5ebc083dc51a400f86bc26976b2878d2d889bc7 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 26 Aug 2023 13:47:01 +0100 Subject: [PATCH 90/93] Use newer Azure SDK with support for older curl --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 1 + cpp/thirdparty/versions.txt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 9c830c88dc7a9..7b00344fa8c0c 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5082,6 +5082,7 @@ function(build_azure_sdk) set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY TRUE) set(DISABLE_AZURE_CORE_OPENTELEMETRY TRUE) set(ENV{AZURE_SDK_DISABLE_AUTO_VCPKG} TRUE) + set(WARNINGS_AS_ERRORS FALSE) # TODO: Configure flags in a better way. FetchContent builds inherit # global flags but we want to disable -Werror for Azure SDK for C++ builds. if(MSVC) diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index 72a01e51346ed..52d302592b55c 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -54,8 +54,8 @@ ARROW_AWS_LC_BUILD_SHA256_CHECKSUM=ae96a3567161552744fc0cae8b4d68ed88b1ec0f3d3c9 ARROW_AWSSDK_BUILD_VERSION=1.10.55 ARROW_AWSSDK_BUILD_SHA256_CHECKSUM=2d552fb1a84bef4a9b65e34aa7031851ed2aef5319e02cc6e4cb735c48aa30de # Despite the confusing version name this is still the whole Azure SDK for C++ including core, keyvault, storage-common, etc. -ARROW_AZURE_SDK_BUILD_VERSION=azure-identity_1.5.1 -ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM=651a660592540c267420b7e1c8dc98428a17396e45f7f6c92a864ab9a4fa028a +ARROW_AZURE_SDK_BUILD_VERSION=azure-core_1.10.2 +ARROW_AZURE_SDK_BUILD_SHA256_CHECKSUM=36557dae87de4cdd257d9b441d9a7f043290eae6666fb1065e0fa486ae3e58a0 ARROW_BOOST_BUILD_VERSION=1.81.0 ARROW_BOOST_BUILD_SHA256_CHECKSUM=9e0ffae35528c35f90468997bc8d99500bf179cbae355415a89a600c38e13574 ARROW_BROTLI_BUILD_VERSION=v1.0.9 From 1ef88c8508d7510d9dcd4bbe47248f89324e1172 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 26 Aug 2023 14:57:20 +0100 Subject: [PATCH 91/93] Re-enable Azure build on ubuntu 20 --- ci/docker/ubuntu-20.04-cpp.dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/docker/ubuntu-20.04-cpp.dockerfile b/ci/docker/ubuntu-20.04-cpp.dockerfile index 5a46212d7fb39..08dda6cf50a17 100644 --- a/ci/docker/ubuntu-20.04-cpp.dockerfile +++ b/ci/docker/ubuntu-20.04-cpp.dockerfile @@ -99,6 +99,7 @@ RUN apt-get update -y -q && \ libssl-dev \ libthrift-dev \ libutf8proc-dev \ + libxml2-dev \ libzstd-dev \ make \ ninja-build \ @@ -145,6 +146,7 @@ RUN /arrow/ci/scripts/install_sccache.sh unknown-linux-musl /usr/local/bin # static Arrow to run Flight/Flight SQL tests ENV absl_SOURCE=BUNDLED \ ARROW_ACERO=ON \ + ARROW_AZURE=ON \ ARROW_BUILD_STATIC=ON \ ARROW_BUILD_TESTS=ON \ ARROW_DEPENDENCY_SOURCE=SYSTEM \ @@ -171,6 +173,7 @@ ENV absl_SOURCE=BUNDLED \ ARROW_WITH_ZSTD=ON \ ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-${llvm}/bin/llvm-symbolizer \ AWSSDK_SOURCE=BUNDLED \ + Azure_SOURCE=BUNDLED \ google_cloud_cpp_storage_SOURCE=BUNDLED \ gRPC_SOURCE=BUNDLED \ GTest_SOURCE=BUNDLED \ From 6398a65606ae02cff3411c72c3e57888db91fbcb Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sat, 26 Aug 2023 15:20:27 +0100 Subject: [PATCH 92/93] Require azure-core >= 1.10.2 in FindAzure.cmake --- cpp/cmake_modules/FindAzure.cmake | 2 +- cpp/cmake_modules/ThirdpartyToolchain.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/cmake_modules/FindAzure.cmake b/cpp/cmake_modules/FindAzure.cmake index b06c5aaf04026..fdf354b724e77 100644 --- a/cpp/cmake_modules/FindAzure.cmake +++ b/cpp/cmake_modules/FindAzure.cmake @@ -42,4 +42,4 @@ find_package_handle_standard_args( azure-storage-blobs-cpp_FOUND azure-storage-common-cpp_FOUND azure-storage-files-datalake-cpp_FOUND - VERSION_VAR azure-storage-files-datalake-cpp_VERSION) + VERSION_VAR azure-core-cpp_VERSION) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 7b00344fa8c0c..42628cd74ec3e 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5109,7 +5109,7 @@ function(build_azure_sdk) endfunction() if(ARROW_WITH_AZURE_SDK) - resolve_dependency(Azure) + resolve_dependency(Azure REQUIRED_VERSION 1.10.2) set(AZURE_SDK_LINK_LIBRARIES Azure::azure-storage-files-datalake Azure::azure-storage-common From e3fb84c74588a5bb87c0400c7076671c6dce5575 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 27 Aug 2023 06:18:48 +0900 Subject: [PATCH 93/93] Fix a lint failure --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 42628cd74ec3e..1abc55041301e 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -5083,8 +5083,8 @@ function(build_azure_sdk) set(DISABLE_AZURE_CORE_OPENTELEMETRY TRUE) set(ENV{AZURE_SDK_DISABLE_AUTO_VCPKG} TRUE) set(WARNINGS_AS_ERRORS FALSE) - # TODO: Configure flags in a better way. FetchContent builds inherit - # global flags but we want to disable -Werror for Azure SDK for C++ builds. + # TODO: Configure flags in a better way. FetchContent builds inherit + # global flags but we want to disable -Werror for Azure SDK for C++ builds. if(MSVC) string(REPLACE "/WX" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") string(REPLACE "/WX" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")