From e7abd39170637d45cf86922053fbf84f348cdf9f Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 7 Dec 2023 15:27:36 -0800 Subject: [PATCH] Fix build failure in the flightsql-odbc repo * Use 1.3 Zlib version - The built-in base line does not work, since it will try to get zlib from https://www.zlib.net/zlib-1.2.12.tar.gz, which is no longer valid. To fix this, I changed ZLIB version to 1.3. * Fix ARROW_GIT_REPOSITORY not set error * In `flight_sql\CMakeLists.txt`, set(ARROW_GIT_REPOSITORY ... CACHE STRING) only sets the default value of ARROW_GIT_REPOSITORY. This value is supposed to be set in the build script (e.g., `cpp/src/flightsql_odbc/flightsql-odbc/build_win64.bat`), and the setting of this value is fixed. * Create flightsqlodbc_build.yml to add workflow to build flightsql-odbc --- .github/workflows/flightsqlodbc_build.yml | 32 +++++++++++++++++++ .../flightsql-odbc/build_win64.bat | 4 ++- .../flightsql-odbc/flight_sql/CMakeLists.txt | 4 ++- .../flightsql_odbc/flightsql-odbc/vcpkg.json | 4 +-- 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/flightsqlodbc_build.yml diff --git a/.github/workflows/flightsqlodbc_build.yml b/.github/workflows/flightsqlodbc_build.yml new file mode 100644 index 0000000000000..e2a1b5abffa43 --- /dev/null +++ b/.github/workflows/flightsqlodbc_build.yml @@ -0,0 +1,32 @@ +name: Flight SQL ODBC Driver Client for Windows + +on: + push: + paths: + - '.github/workflows/flightsqlodbc_build.yml' + - 'cpp/src/flightsql_odbc/flightsql-odbc/**' + pull_request: + paths: + - '.github/workflows/flightsqlodbc_build.yml' + - 'cpp/src/flightsql_odbc/flightsql-odbc/**' + +jobs: + build-windows32: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v2 + + - name: configure-and-build-driver + run: | + cd cpp/src/flightsql_odbc/flightsql-odbc + .\build_win32.bat + + build-windows64: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v2 + + - name: configure-and-build-driver + run: | + cd cpp/src/flightsql_odbc/flightsql-odbc + .\build_win64.bat \ No newline at end of file diff --git a/cpp/src/flightsql_odbc/flightsql-odbc/build_win64.bat b/cpp/src/flightsql_odbc/flightsql-odbc/build_win64.bat index ef0d9cc0882ed..11b4bc0ef2712 100644 --- a/cpp/src/flightsql_odbc/flightsql-odbc/build_win64.bat +++ b/cpp/src/flightsql_odbc/flightsql-odbc/build_win64.bat @@ -36,7 +36,9 @@ mkdir build cd build -if NOT DEFINED ARROW_GIT_REPOSITORY SET ARROW_GIT_REPOSITORY = "https://github.com/apache/arrow" +if NOT DEFINED ARROW_GIT_REPOSITORY ( + SET ARROW_GIT_REPOSITORY="https://github.com/apache/arrow" + ) cmake ..^ -DARROW_GIT_REPOSITORY=%ARROW_GIT_REPOSITORY%^ diff --git a/cpp/src/flightsql_odbc/flightsql-odbc/flight_sql/CMakeLists.txt b/cpp/src/flightsql_odbc/flightsql-odbc/flight_sql/CMakeLists.txt index 44887430398ad..c2fb049d29db9 100644 --- a/cpp/src/flightsql_odbc/flightsql-odbc/flight_sql/CMakeLists.txt +++ b/cpp/src/flightsql_odbc/flightsql-odbc/flight_sql/CMakeLists.txt @@ -113,11 +113,13 @@ else() ) endif() +# If build fails, need to remove build folder to re-build. set(ARROW_GIT_REPOSITORY "https://github.com/apache/arrow.git" CACHE STRING "Arrow repository path or URL") set(ARROW_GIT_TAG "b050bd0d31db6412256cec3362c0d57c9732e1f2" CACHE STRING "Tag for the Arrow repository") message("Using Arrow from ${ARROW_GIT_REPOSITORY} on tag ${ARROW_GIT_TAG}") -ExternalProject_Add(ApacheArrow +ExternalProject_Add( + ApacheArrow GIT_REPOSITORY ${ARROW_GIT_REPOSITORY} GIT_TAG ${ARROW_GIT_TAG} CMAKE_ARGS ${ARROW_CMAKE_ARGS}) diff --git a/cpp/src/flightsql_odbc/flightsql-odbc/vcpkg.json b/cpp/src/flightsql_odbc/flightsql-odbc/vcpkg.json index 519d6441bec61..8c065a15654a1 100644 --- a/cpp/src/flightsql_odbc/flightsql-odbc/vcpkg.json +++ b/cpp/src/flightsql_odbc/flightsql-odbc/vcpkg.json @@ -12,18 +12,18 @@ "boost-optional", "boost-process", "boost-system", + "boost-test", "boost-variant", "boost-xpressive", "brotli", "gflags", "openssl", "protobuf", - "zlib", + { "name": "zlib", "version>=": "1.3" }, "re2", "spdlog", "grpc", "utf8proc", - "zlib", "zstd", "rapidjson" ],