From 2e7413e6a4f5bf8f984b242939ba4758ec56ccc9 Mon Sep 17 00:00:00 2001
From: David Li
Date: Thu, 7 Mar 2024 18:16:32 -0500
Subject: [PATCH] ci: build wheels with debug info
Fixes #1583.
---
c/driver/sqlite/statement_reader.c | 13 ++++++-------
ci/scripts/python_util.sh | 2 +-
ci/scripts/python_wheel_unix_build.sh | 3 +++
ci/scripts/python_wheel_windows_build.bat | 5 ++++-
4 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/c/driver/sqlite/statement_reader.c b/c/driver/sqlite/statement_reader.c
index 9e02ee3b80..909fd854c7 100644
--- a/c/driver/sqlite/statement_reader.c
+++ b/c/driver/sqlite/statement_reader.c
@@ -608,15 +608,14 @@ int StatementReaderGetOneValue(struct StatementReader* reader, int col,
return ArrowArrayAppendBytes(out, value);
}
- default: {
- snprintf(reader->error.message, sizeof(reader->error.message),
- "[SQLite] Internal error: unknown inferred column type %d",
- reader->types[col]);
- return ENOTSUP;
- }
+ default:
+ break;
}
- return 0;
+ snprintf(reader->error.message, sizeof(reader->error.message),
+ "[SQLite] Internal error: unknown inferred column type %d",
+ reader->types[col]);
+ return ENOTSUP;
}
int StatementReaderGetNext(struct ArrowArrayStream* self, struct ArrowArray* out) {
diff --git a/ci/scripts/python_util.sh b/ci/scripts/python_util.sh
index 635e50e520..027caf4980 100644
--- a/ci/scripts/python_util.sh
+++ b/ci/scripts/python_util.sh
@@ -25,7 +25,7 @@ function build_drivers {
local -r source_dir="$1"
local -r build_dir="$2/${VCPKG_ARCH}"
- : ${CMAKE_BUILD_TYPE:=release}
+ : ${CMAKE_BUILD_TYPE:=RelWithDebInfo}
: ${CMAKE_UNITY_BUILD:=ON}
: ${CMAKE_GENERATOR:=Ninja}
: ${VCPKG_ROOT:=/opt/vcpkg}
diff --git a/ci/scripts/python_wheel_unix_build.sh b/ci/scripts/python_wheel_unix_build.sh
index fa614bfded..a904230c1d 100755
--- a/ci/scripts/python_wheel_unix_build.sh
+++ b/ci/scripts/python_wheel_unix_build.sh
@@ -88,6 +88,9 @@ check_visibility $ADBC_SNOWFLAKE_LIBRARY
# Get the latest pip so we have in-tree-build by default
python -m pip install --upgrade pip auditwheel cibuildwheel delocate setuptools wheel
+# Build with Cython debug info
+export ADBC_BUILD_TYPE="debug"
+
for component in $COMPONENTS; do
pushd ${source_dir}/python/$component
diff --git a/ci/scripts/python_wheel_windows_build.bat b/ci/scripts/python_wheel_windows_build.bat
index b57338ba1c..4bc8a6f240 100644
--- a/ci/scripts/python_wheel_windows_build.bat
+++ b/ci/scripts/python_wheel_windows_build.bat
@@ -22,7 +22,7 @@ set build_dir=%2
echo "=== (%PYTHON_VERSION%) Building ADBC libpq driver ==="
-set CMAKE_BUILD_TYPE=release
+set CMAKE_BUILD_TYPE=RelWithDebInfo
set CMAKE_GENERATOR=Visual Studio 17 2022
set CMAKE_GENERATOR_PLATFORM=x64
set CMAKE_UNITY_BUILD=ON
@@ -61,6 +61,9 @@ set ADBC_POSTGRESQL_LIBRARY=%build_dir%\bin\adbc_driver_postgresql.dll
set ADBC_SQLITE_LIBRARY=%build_dir%\bin\adbc_driver_sqlite.dll
set ADBC_SNOWFLAKE_LIBRARY=%build_dir%\bin\adbc_driver_snowflake.dll
+# Build with Cython debug info
+set ADBC_BUILD_TYPE=debug
+
popd
python -m pip install --upgrade pip delvewheel wheel || exit /B 1