From 2a3c8845611a433441222f814c07f753941ba5e3 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.
---
ci/scripts/python_util.sh | 2 +-
ci/scripts/python_wheel_unix_build.sh | 3 +++
ci/scripts/python_wheel_windows_build.bat | 5 ++++-
3 files changed, 8 insertions(+), 2 deletions(-)
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