Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
a01b836
Generate versioned DLLs and import LIBs when building with MSVC
IIFE May 25, 2025
4a2394a
Update c/cmake_modules/AdbcDefines.cmake
IIFE May 26, 2025
3ae75c3
Sory warning list
IIFE May 26, 2025
b8ad1f2
Merge branch 'window-build' of https://github.com/IIFE/arrow-adbc int…
IIFE May 26, 2025
c2254ee
Move version rc to c folder
IIFE May 26, 2025
cc41040
Add Software Foundation to company name
IIFE May 26, 2025
f87b1d4
Update c/driver/flightsql/CMakeLists.txt
IIFE May 26, 2025
563cfd4
Include licence comment
IIFE May 26, 2025
cf87023
Merge branch 'window-build' of https://github.com/IIFE/arrow-adbc int…
IIFE May 26, 2025
fa7e0f6
Use defines for hard-coded values
IIFE May 26, 2025
9f73ec3
Use WIN32 instead of MSVC for windows specific conditions
IIFE May 26, 2025
2a5a1eb
Fix pre-commit
IIFE May 27, 2025
08f96db
Add vcpkg pipeline
lidavidm May 30, 2025
d0ebe48
try again
lidavidm May 30, 2025
112599a
try again
lidavidm May 30, 2025
4cefd77
try again
lidavidm May 30, 2025
12f66b7
vcpkg install
lidavidm May 30, 2025
aab31a1
don't build tests
lidavidm May 30, 2025
81e9ea5
Use msbuild to build and install
IIFE May 30, 2025
10c3776
Fix pre-commit
IIFE Jun 1, 2025
81b6db7
Put licence before include
IIFE Jun 2, 2025
622a066
Merge branch 'window-build' of https://github.com/IIFE/arrow-adbc int…
IIFE Jun 2, 2025
3575619
Merge remote-tracking branch 'origin/main' into window-build
IIFE Sep 30, 2025
413d069
Merge branch 'apache:main' into window-build
IIFE Dec 1, 2025
6179a26
Fix warning 4456 on windows
IIFE Dec 1, 2025
c3c3108
Add summary to disabled warnings
IIFE Dec 1, 2025
104d04f
Use WIN32 instead of MSVC
IIFE Dec 1, 2025
9c043c0
Use WIN32 instead of MSVC
IIFE Dec 1, 2025
72c3668
Add internal name and use adbc_version
IIFE Dec 2, 2025
d061a5a
update vcpkg build pipeline
IIFE Dec 7, 2025
d68a05e
Update .github/workflows/native-windows.yml
IIFE Dec 7, 2025
8f98346
update to 2025.06.13 vcpkg
IIFE Dec 12, 2025
82806b8
Merge branch 'apache:main' into window-build
IIFE Dec 12, 2025
9db5d09
Ensure consistent API used for Windows when setting and getting envir…
IIFE Dec 14, 2025
7390176
Ensure runtime dependencies are copied to install folder
IIFE Dec 14, 2025
14b96ae
Ensure config subdir is included in library path
IIFE Dec 14, 2025
98e6f97
Add presets for debug and release that set build and install folders …
IIFE Dec 14, 2025
14a1d2d
Update windows pipeline to build/test in debug and release
IIFE Dec 14, 2025
9745dac
Make condition on MSVC so it doesn't affect other builds of windows (…
IIFE Dec 14, 2025
7f402ad
use cmake option to turn runtime dependencies copy on/off
IIFE Dec 14, 2025
d6db78e
Update AllDisabled test to cater for Windows error messages, as in Wi…
IIFE Dec 14, 2025
6898d9d
Test in release only, and use bundled gtest
IIFE Dec 14, 2025
12ccdfd
Fix precommit
IIFE Dec 14, 2025
d82407c
cache vcpkg and use config in job matrix
IIFE Dec 14, 2025
3445e4f
Use ADBC_BUILD_VCPKG option to drive behaviour of building with vcpkg…
IIFE Dec 14, 2025
2227c55
Install libpq sqlite3 with vcpkg
IIFE Dec 14, 2025
4d62b37
user lower case debug
IIFE Dec 14, 2025
d4c1a00
Put back to WIN32
IIFE Dec 14, 2025
02e752b
use env var for local app data path
IIFE Dec 14, 2025
d713f66
build release as well
IIFE Dec 14, 2025
841de71
Remove vcpkg cache for now, doesn't seem to work
IIFE Dec 14, 2025
caaac41
disable test step for now
IIFE Dec 14, 2025
d6ebdf0
Add config to job name
IIFE Dec 14, 2025
6712c63
try python driver manager build fix
IIFE Dec 15, 2025
acc86a6
try python driver manager build fix
IIFE Dec 15, 2025
adfeff5
try using tdm-gcc
IIFE Dec 15, 2025
8516f78
remove tdm test
IIFE Dec 15, 2025
2a43333
reneable vcpkg test
IIFE Dec 15, 2025
2ad78b4
try windows-2022
IIFE Dec 15, 2025
6bb7d89
use windows-2022 on all jobs
IIFE Dec 15, 2025
2281a5f
Try capturing crash dump
IIFE Dec 16, 2025
507c6ee
ensure local install path is searched first before other paths. This …
IIFE Dec 17, 2025
b7eb629
Merge branch 'main' into window-build
IIFE Dec 17, 2025
b80104e
fix pre-commit
IIFE Dec 17, 2025
f7f5f53
use windows-latest
IIFE Dec 17, 2025
6fc466b
Merge branch 'window-build' of https://github.com/IIFE/arrow-adbc int…
IIFE Dec 17, 2025
8c539ad
force use of msys ucrt for gcc
IIFE Dec 18, 2025
6928a6a
try pinning gcc version using winlibs
IIFE Dec 18, 2025
5c5620a
try using latest winlibs
IIFE Dec 18, 2025
a8bdc9f
pin msbuild action
IIFE Dec 18, 2025
824b3d5
update driver manager in go folder
IIFE Dec 18, 2025
88972ae
use ucrt runtime
IIFE Dec 18, 2025
9acf729
remove hard coded generator and let build system choose default one. …
IIFE Dec 18, 2025
e249134
only use winlibs where required for python build
IIFE Dec 18, 2025
a132035
Update .github/workflows/native-windows.yml
IIFE Dec 19, 2025
a995837
revert unintended changes
IIFE Dec 19, 2025
d1c4510
Merge branch 'window-build' of https://github.com/IIFE/arrow-adbc int…
IIFE Dec 19, 2025
a162178
replicate setup winlibs with powershell
IIFE Dec 19, 2025
4721561
improve winlibs setup
IIFE Dec 19, 2025
a3d695e
Update ci/scripts/cpp_test.ps1
IIFE Dec 22, 2025
fc9b29f
Update c/driver_manager/adbc_driver_manager.cc
IIFE Dec 22, 2025
04d1af2
Update .github/workflows/native-windows.yml
IIFE Dec 22, 2025
a6dbf1d
use github_path and snake case
IIFE Dec 22, 2025
23d77ae
use github_path and only install mingw-w64-x86_64-tools
IIFE Dec 22, 2025
8d36f26
Update c/cmake_modules/GoUtils.cmake
IIFE Dec 22, 2025
a71ee95
Update c/driver/flightsql/CMakeLists.txt
IIFE Dec 22, 2025
6e09c0c
Update c/driver/snowflake/CMakeLists.txt
IIFE Dec 22, 2025
e67aa1c
Revert to echoing env path to github env
IIFE Dec 22, 2025
e50f520
Merge branch 'window-build' of https://github.com/IIFE/arrow-adbc int…
IIFE Dec 22, 2025
49c2537
Update c/driver_manager/CMakeLists.txt
IIFE Dec 22, 2025
ccd0bd2
Update c/driver_manager/adbc_driver_manager_test.cc
IIFE Dec 22, 2025
7f654f7
Update go/adbc/drivermgr/adbc_driver_manager.cc
IIFE Dec 22, 2025
82550c2
update go driver manager
IIFE Dec 22, 2025
a6aeedc
Remove Windows config subdirectory handling
IIFE Dec 23, 2025
a02ba04
Update c/cmake_modules/BuildUtils.cmake
IIFE Dec 23, 2025
d3e54b9
Apply suggestions from code review
lidavidm Dec 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/native-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,49 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Set Winlibs version
id: winlibs-version
shell: pwsh
run: |
$winlibs_asset_name = "winlibs-x86_64-posix-seh-gcc-15.2.0-mingw-w64ucrt-13.0.0-r4.7z"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this has to be updated periodically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We can always get the latest, but I think it's safer pinning the version and updating manually.

echo "winlibs_asset_name=$winlibs_asset_name" >> $env:GITHUB_OUTPUT

- name: Cache Winlibs
id: cache-winlibs
uses: actions/cache@v5
with:
path: ${{ runner.temp }}/winlibs
key: winlibs-${{ steps.winlibs-version.outputs.winlibs_asset_name }}

- name: Download and setup Winlibs
if: steps.cache-winlibs.outputs.cache-hit != 'true'
shell: pwsh
run: |
$base_url = "https://github.com/brechtsanders/winlibs_mingw/releases/download/15.2.0posix-13.0.0-ucrt-r4/"
$asset_name = "${{ steps.winlibs-version.outputs.winlibs_asset_name }}"
$hash_expected = "148175f2ba3c4ab0bfd93116b75f7ff172e9e0d06ca8680c8a98c375ec45abb5"
$url = $base_url + $asset_name

Write-Host "Downloading $asset_name..."
Invoke-WebRequest -Uri $url -OutFile $asset_name -UseBasicParsing

Write-Host "Verifying hash..."
$hash_actual = (Get-FileHash -Path $asset_name -Algorithm SHA256).Hash.ToLower()
if ($hash_actual -ne $hash_expected) {
throw "SHA256 mismatch! Expected: $hash_expected, Got: $hash_actual"
}

Write-Host "Extracting..."
7z x $asset_name -o"${{ runner.temp }}/winlibs" -y
Remove-Item $asset_name -Force

- name: Add Winlibs to PATH
shell: pwsh
run: |
$winlibs_bin = Join-Path "${{ runner.temp }}" "winlibs\mingw64\bin"
$env:PATH="$winlibs_bin;${env:PATH}"
echo "PATH=$env:PATH" >> $env:GITHUB_ENV

- name: Get Date
id: get-date
shell: bash
Expand All @@ -273,6 +316,7 @@ jobs:
with:
path: ~/conda_pkgs_dir
key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}

- uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
with:
miniforge-version: latest
Expand Down Expand Up @@ -319,3 +363,58 @@ jobs:
BUILD_ALL: "0"
BUILD_DRIVER_SQLITE: "1"
run: .\ci\scripts\python_test.ps1 $pwd $pwd\build

# ------------------------------------------------------------
# MSVC/vcpkg build (no Conda)
# ------------------------------------------------------------
drivers-vcpkg:
name: "C/C++ (vcpkg/${{ matrix.os }}/${{ matrix.config }})"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["windows-latest"]
arch: ["x64"]
config: ["debug", "release"]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2
- name: Setup MSYS2 tools
run: |
# msys64 is pre-installed on windows but not added to path
$env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin\;C:\msys64\ucrt64\bin;$env:PATH"
echo "PATH=$env:PATH" >> $env:GITHUB_ENV

# Needed for gendef tool in GoUtils.cmake
pacman --noconfirm -S mingw-w64-x86_64-tools
# TODO(https://github.com/apache/arrow-adbc/issues/3825)
- name: Clone vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout ef7dbf94b9198bc58f45951adcf1f041fcbc5ea0
.\bootstrap-vcpkg.bat
- name: Install vcpkg dependencies
working-directory: c
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
run: |
${{ github.workspace }}/vcpkg/vcpkg.exe install libpq sqlite3 --triplet ${{ matrix.arch }}-windows
- name: Build and Install (No ASan)
env:
CMAKE_BUILD_TYPE: ${{ matrix.config }}
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
run: |
cmake .\c\ --preset windows-${{ matrix.config }} -DCMAKE_VERBOSE_MAKEFILE=ON

cmake --build .\build\${{ matrix.config }} --target install --config ${{ matrix.config }} --parallel
- name: Test
env:
BUILD_ALL: "0"
BUILD_DRIVER_MANAGER: "1"
BUILD_DRIVER_MANAGER_USER_CONFIG_TEST: "1"
BUILD_DRIVER_SQLITE: "1"
run: .\ci\scripts\cpp_test.ps1 $pwd\build\${{ matrix.config }} $pwd\local\${{ matrix.config }}
53 changes: 53 additions & 0 deletions c/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,47 @@
"ADBC_USE_UBSAN": "ON"
}
},
{
"name": "multi-config-windows-base",
"displayName": "Base config for Windows without ASAN/UBSAN",
"hidden": true,
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"ADBC_BUILD_TESTS": "ON",
"ADBC_DRIVER_FLIGHTSQL": "ON",
"ADBC_DRIVER_MANAGER": "ON",
"ADBC_DRIVER_POSTGRESQL": "ON",
"ADBC_DRIVER_SNOWFLAKE": "ON",
"ADBC_DRIVER_SQLITE": "ON",
"ADBC_BUILD_SHARED": "ON",
"ADBC_BUILD_STATIC": "OFF",
"ADBC_USE_ASAN": "OFF",
"ADBC_USE_UBSAN": "OFF",
"ADBC_BUILD_VCPKG": "ON",
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
}
},
{
"name": "windows-debug",
"displayName": "Windows Debug",
"inherits": "multi-config-windows-base",
"binaryDir": "${sourceDir}/../build/debug",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/../local/debug"
}
},
{
"name": "windows-release",
"displayName": "Windows Release",
"inherits": "multi-config-windows-base",
"binaryDir": "${sourceDir}/../build/release",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/../local/release"
}
},
{
"name": "debug-python",
"displayName": "debug, all drivers, with tests, without ASan/UBSan (usable from Python)",
Expand All @@ -41,6 +82,18 @@
}
}
],
"buildPresets": [
{
"name": "debug-windows",
"configurePreset": "windows-debug",
"configuration": "Debug"
},
{
"name": "release-windows",
"configurePreset": "windows-release",
"configuration": "Release"
}
],
"testPresets": [
{
"name": "debug",
Expand Down
20 changes: 20 additions & 0 deletions c/cmake_modules/AdbcDefines.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,26 @@ endmacro()
# Common testing setup
add_custom_target(all-tests)
if(ADBC_BUILD_TESTS)
if(MSVC)
# MSVC emitted warnings for testing code
# Unary minus operator applied to unsigned type, result still unsigned
add_compile_options(/wd4146)
# An integer type is converted to a smaller integer type.
add_compile_options(/wd4244)
# Class has virtual functions, but its non-trivial destructor is not virtual; instances of this class may not be destructed correctly
add_compile_options(/wd4265)
# No override available for virtual member function from base
add_compile_options(/wd4266)
# Signed integral constant overflow
add_compile_options(/wd4307)
# Move constructor was implicitly defined as deleted
add_compile_options(/wd5026)
# Class has virtual functions, but its trivial destructor is not virtual
add_compile_options(/wd5204)
# Implicit fall-through occurs here
add_compile_options(/wd5262)
endif()

find_package(GTest)
if(NOT GTest_FOUND)
message(STATUS "Building googletest from source")
Expand Down
24 changes: 24 additions & 0 deletions c/cmake_modules/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,17 @@ function(ADD_ARROW_LIB LIB_NAME)
VERSION "${ADBC_FULL_SO_VERSION}"
SOVERSION "${ADBC_SO_VERSION}")

if(WIN32)
# Binaries generated on Windows need file version information, otherwise when the binary is part of a Windows installer
# the installer won't know to update a previously installed version.
set(VERSION_RC_TEMPLATE "${CMAKE_SOURCE_DIR}/version.rc.in")
configure_file("${VERSION_RC_TEMPLATE}"
"${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}_version.rc" @ONLY)

target_sources(${LIB_NAME}_shared
PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}_version.rc")
endif()

# https://github.com/apache/arrow-adbc/issues/81
target_compile_features(${LIB_NAME}_shared PRIVATE cxx_std_11)

Expand Down Expand Up @@ -289,6 +300,19 @@ function(ADD_ARROW_LIB LIB_NAME)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# If we're building on Windows using vcpkg, ensure the runtime dependencies of binaries are copied to the install folder.
# TODO(https://github.com/apache/arrow-adbc/issues/3826): auto-detect this
if(ADBC_BUILD_VCPKG)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this automatically be detected somehow? e.g. by checking CMake's platform property and something the vcpkg-cmake integration sets?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm had a quick look but can't see a better way at the moment. The problem is that runtime dependencies copying doesn't work for other builds like python/conda etc. Maybe we can spend more time investigating in a separate PR if that's OK?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

install(TARGETS ${LIB_NAME}_shared
RUNTIME_DEPENDENCIES
PRE_EXCLUDE_REGEXES
"api-ms-win-.*"
"ext-ms-.*"
POST_EXCLUDE_REGEXES
".*system32.*"
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR})
endif()
endif()

if(BUILD_STATIC)
Expand Down
4 changes: 4 additions & 0 deletions c/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
define_option(ADBC_DRIVER_BIGQUERY "Build the BigQuery driver" OFF)

define_option(ADBC_INTEGRATION_DUCKDB "Build the test suite for DuckDB" OFF)

define_option(ADBC_BUILD_VCPKG
"Build on Windows using vcpkg for dependencies and Visual Studio generator."
OFF)
endif()

macro(validate_config)
Expand Down
Loading
Loading