You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2023/01/18 17:56:45 UTC
[arrow-adbc] branch main updated: ci: refactor pipelines and deduplicate work (#354)
This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new bc27dfe ci: refactor pipelines and deduplicate work (#354)
bc27dfe is described below
commit bc27dfe5b82702c0dd42ac0f2fae268d1c563675
Author: David Li <li...@gmail.com>
AuthorDate: Wed Jan 18 12:56:40 2023 -0500
ci: refactor pipelines and deduplicate work (#354)
* Merge Go pipelines into the C/C++/GLib/Python/Ruby ones.
This is to prepare for when we have Go drivers with C APIs.
* Add tests for multiple Python versions.
* Fix deprecation warning about set-output.
Fixes #348.
---
.github/workflows/cpp.yml | 256 ------------------
.github/workflows/go.yml | 148 ----------
.github/workflows/native-unix.yml | 445 +++++++++++++++++++++++++++++++
.github/workflows/native-windows.yml | 327 +++++++++++++++++++++++
c/driver_manager/adbc_driver_manager.cc | 2 +-
ci/scripts/go_build.ps1 | 43 +++
ci/scripts/go_test.ps1 | 36 +++
go/adbc/drivermgr/wrapper.go | 3 +
go/adbc/drivermgr/wrapper_sqlite_test.go | 6 +-
go/adbc/pkg/_tmpl/driver.go.tmpl | 4 +-
go/adbc/pkg/flightsql/driver.go | 4 +-
11 files changed, 864 insertions(+), 410 deletions(-)
diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml
deleted file mode 100644
index 8352c28..0000000
--- a/.github/workflows/cpp.yml
+++ /dev/null
@@ -1,256 +0,0 @@
-# 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.
-
-name: C/C++/GLib/Python/Ruby
-
-on:
- pull_request:
- branches:
- - main
- paths:
- - "adbc.h"
- - "c/**"
- - "ci/**"
- - "glib/**"
- - "python/**"
- - ".github/workflows/cpp.yml"
- push:
- paths:
- - "adbc.h"
- - "c/**"
- - "ci/**"
- - "glib/**"
- - "python/**"
- - ".github/workflows/cpp.yml"
-
-concurrency:
- group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
- cancel-in-progress: true
-
-permissions:
- contents: read
-
-jobs:
- cpp-conda-unix:
- name: "Conda/${{ matrix.os }}"
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: ["macos-latest", "ubuntu-latest"]
- env:
- # Required for macOS
- # https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
- CXXFLAGS: "-D_LIBCPP_DISABLE_AVAILABILITY"
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- persist-credentials: false
- - name: Get Date
- id: get-date
- shell: bash
- run: |
- echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')"
- - name: Cache Conda
- uses: actions/cache@v3
- env:
- # Increment this to reset cache manually
- CACHE_NUMBER: 0
- with:
- path: ~/conda_pkgs_dir
- key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
- - uses: conda-incubator/setup-miniconda@v2
- with:
- miniforge-variant: Mambaforge
- miniforge-version: latest
- use-mamba: true
- - name: Install Dependencies
- shell: bash -l {0}
- run: |
- mamba install -c conda-forge \
- 'arrow-c-glib>=10.0.0' \
- --file ci/conda_env_cpp.txt \
- --file ci/conda_env_docs.txt \
- --file ci/conda_env_glib.txt \
- --file ci/conda_env_python.txt
-
- - name: Build SQLite3 Driver
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
- - name: Test SQLite3 Driver
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
- - name: Build PostgreSQL Driver
- shell: bash -l {0}
- # No test for now, since we need to spin up PostgreSQL itself
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_POSTGRESQL=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
- - name: Build Driver Manager
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
- - name: Test Driver Manager
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
- env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
-
- - name: Build and Install (No ASan)
- shell: bash -l {0}
- run: |
- # Python and others need something that don't use the ASAN runtime
- rm -rf "$(pwd)/build"
- export BUILD_ALL=1
- export ADBC_BUILD_TESTS=OFF
- export ADBC_USE_ASAN=OFF
- export ADBC_USE_UBSAN=OFF
- ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
-
- - name: Build Python Driver Manager
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- - name: Test Python Driver Manager
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- - name: Build Python Driver PostgreSQL
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_POSTGRESQL=1 ./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- - name: Test Python Driver PostgreSQL
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_POSTGRESQL=1 ./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- - name: Build Python Driver SQLite
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- - name: Test Python Driver SQLite
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
-
- - name: Build GLib Driver Manager
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/glib_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- - name: Test GLib/Ruby Driver Manager
- shell: bash -l {0}
- run: |
- env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/glib_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
-
- - name: Build Docs
- shell: bash -l {0}
- run: |
- ./ci/scripts/docs_build.sh "$(pwd)"
-
- cpp-conda-windows:
- name: "Conda/${{ matrix.os }}"
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: ["windows-latest"]
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- persist-credentials: false
- - uses: conda-incubator/setup-miniconda@v2
- with:
- miniforge-variant: Mambaforge
- miniforge-version: latest
- use-mamba: true
- # Required for caching
- use-only-tar-bz2: true
- - name: Install Dependencies
- shell: cmd /C call {0}
- run: |
- mamba install --file ci/conda_env_cpp.txt --file ci/conda_env_python.txt
- - name: Build Driver Manager
- shell: pwsh
- env:
- BUILD_ALL: "0"
- BUILD_DRIVER_MANAGER: "1"
- run:
- .\ci\scripts\cpp_build.ps1 $pwd $pwd\build
- - name: Build Driver PostgreSQL
- shell: pwsh
- env:
- BUILD_ALL: "0"
- BUILD_DRIVER_POSTGRESQL: "1"
- run:
- .\ci\scripts\cpp_build.ps1 $pwd $pwd\build
- - name: Build Driver SQLite
- shell: pwsh
- env:
- BUILD_ALL: "0"
- BUILD_DRIVER_SQLITE: "1"
- run:
- .\ci\scripts\cpp_build.ps1 $pwd $pwd\build
- - name: Test Driver Manager
- shell: pwsh
- env:
- BUILD_ALL: "0"
- BUILD_DRIVER_MANAGER: "1"
- run:
- .\ci\scripts\cpp_test.ps1 $pwd $pwd\build
- - name: Test Driver SQLite
- shell: pwsh
- env:
- BUILD_ALL: "0"
- BUILD_DRIVER_SQLITE: "1"
- run:
- .\ci\scripts\cpp_test.ps1 $pwd $pwd\build
-
- - name: Build Python Driver Manager
- shell: pwsh
- env:
- BUILD_ALL: "0"
- BUILD_DRIVER_MANAGER: "1"
- run:
- .\ci\scripts\python_build.ps1 $pwd $pwd\build
- - name: Build Python Driver PostgreSQL
- shell: pwsh
- env:
- BUILD_ALL: "0"
- BUILD_DRIVER_POSTGRESQL: "1"
- run:
- .\ci\scripts\python_build.ps1 $pwd $pwd\build
- - name: Build Python Driver SQLite
- shell: pwsh
- env:
- BUILD_ALL: "0"
- BUILD_DRIVER_SQLITE: "1"
- run:
- .\ci\scripts\python_build.ps1 $pwd $pwd\build
- - name: Test Python Driver Manager
- shell: pwsh
- env:
- BUILD_ALL: "0"
- BUILD_DRIVER_MANAGER: "1"
- run:
- .\ci\scripts\python_test.ps1 $pwd $pwd\build
- - name: Test Python Driver SQLite
- shell: pwsh
- env:
- BUILD_ALL: "0"
- BUILD_DRIVER_SQLITE: "1"
- run:
- .\ci\scripts\python_test.ps1 $pwd $pwd\build
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
deleted file mode 100644
index 1d7620e..0000000
--- a/.github/workflows/go.yml
+++ /dev/null
@@ -1,148 +0,0 @@
-# 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.
-
-name: Go
-
-on:
- pull_request:
- branches:
- - main
- paths:
- - "adbc.h"
- - "c/driver_manager/**"
- - "go/adbc/**"
- - ".github/workflows/go.yml"
- push:
- paths:
- - "adbc.h"
- - "c/driver_manager/**"
- - "go/adbc/**"
- - ".github/workflows/go.yml"
-
-permissions:
- contents: read
-
-concurrency:
- group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
- cancel-in-progress: true
-
-jobs:
- go-no-cgo:
- name: "${{ matrix.os}} - No CGO"
- env:
- CGO_ENABLED: "0"
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: ["macos-latest", "ubuntu-latest", "windows-latest"]
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- persist-credentials: false
- - uses: actions/setup-go@v3
- with:
- go-version-file: 'go/adbc/go.mod'
- check-latest: true
- cache: true
- cache-dependency-path: go/adbc/go.sum
- - name: Install staticcheck
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
- - name: Go Build
- run: |
- ./ci/scripts/go_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- - name: Run Staticcheck
- run: |
- pushd go/adbc
- staticcheck -f stylish ./...
- popd
- - name: Go Test
- run: |
- ./ci/scripts/go_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
-
- go-driver-mgr-unix:
- name: "${{ matrix.os }} - CGO driver mgr"
- runs-on: ${{ matrix.os }}
- env:
- CGO_ENABLED: "1"
- strategy:
- matrix:
- os: ["macos-latest", "ubuntu-latest"]
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- persist-credentials: false
- - uses: actions/setup-go@v3
- with:
- go-version: 1.18.6
- check-latest: true
- cache: true
- cache-dependency-path: go/adbc/go.sum
- - name: Get Date
- id: get-date
- shell: bash
- run: |
- echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')"
- - name: Cache Conda
- uses: actions/cache@v2
- env:
- # Increment this to reset cache manually
- CACHE_NUMBER: 0
- with:
- path: ~/conda_pkgs_dir
- key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
- - uses: conda-incubator/setup-miniconda@v2
- with:
- miniforge-variant: Mambaforge
- miniforge-version: latest
- use-mamba: true
- # Required for caching
- use-only-tar-bz2: true
- - name: Install Dependencies
- shell: bash -l {0}
- run: |
- mamba install --file ci/conda_env_cpp.txt --file ci/conda_env_python.txt
- - name: Build SQLite3 Driver
- shell: bash -l {0}
- run: |
- export BUILD_ALL=0
- export BUILD_DRIVER_SQLITE=1
- export ADBC_USE_ASAN=OFF
- export ADBC_USE_UBSAN=OFF
- ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- - name: Install staticcheck
- shell: bash -l {0}
- if: ${{ !contains('macos-latest', matrix.os) }}
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
- - name: Go Build
- shell: bash -l {0}
- run: |
- export PATH=$RUNNER_TOOL_CACHE/go/1.18.6/x64/bin:$PATH
- ./ci/scripts/go_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
- - name: Run Staticcheck
- if: ${{ !contains('macos-latest', matrix.os) }}
- shell: bash -l {0}
- run: |
- pushd go/adbc
- staticcheck -f stylish ./...
- popd
- - name: Go Test
- shell: bash -l {0}
- run: |
- export PATH=$RUNNER_TOOL_CACHE/go/1.18.6/x64/bin:$PATH
- ./ci/scripts/go_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
diff --git a/.github/workflows/native-unix.yml b/.github/workflows/native-unix.yml
new file mode 100644
index 0000000..1946900
--- /dev/null
+++ b/.github/workflows/native-unix.yml
@@ -0,0 +1,445 @@
+# 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.
+
+name: Native Libraries (Unix)
+
+on:
+ pull_request:
+ branches:
+ - main
+ paths:
+ - "adbc.h"
+ - "c/**"
+ - "ci/**"
+ - "glib/**"
+ - "go/**"
+ - "python/**"
+ - "ruby/**"
+ - ".github/workflows/native-unix.yml"
+ push:
+ paths:
+ - "adbc.h"
+ - "c/**"
+ - "ci/**"
+ - "glib/**"
+ - "go/**"
+ - "python/**"
+ - "ruby/**"
+ - ".github/workflows/native-unix.yml"
+
+concurrency:
+ group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+env:
+ # Increment this to reset cache manually
+ CACHE_NUMBER: "1"
+
+jobs:
+ # ------------------------------------------------------------
+ # Common build (builds libraries used in GLib, Python, Ruby)
+ # ------------------------------------------------------------
+ drivers-build-conda:
+ name: "Common Libraries (Conda/${{ matrix.os }})"
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: ["macos-latest", "ubuntu-latest"]
+ env:
+ # Required for macOS
+ # https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
+ CXXFLAGS: "-D_LIBCPP_DISABLE_AVAILABILITY"
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Get Date
+ id: get-date
+ shell: bash
+ run: |
+ echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
+ - name: Cache Conda
+ uses: actions/cache@v3
+ with:
+ path: ~/conda_pkgs_dir
+ key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
+ - uses: conda-incubator/setup-miniconda@v2
+ with:
+ miniforge-variant: Mambaforge
+ miniforge-version: latest
+ use-only-tar-bz2: false
+ use-mamba: true
+ - name: Install Dependencies
+ shell: bash -l {0}
+ run: |
+ mamba install -c conda-forge \
+ --file ci/conda_env_cpp.txt
+ - uses: actions/setup-go@v3
+ with:
+ go-version: 1.18.6
+ check-latest: true
+ cache: true
+ cache-dependency-path: go/adbc/go.sum
+
+ - name: Build and Install (No ASan)
+ shell: bash -l {0}
+ run: |
+ # Python and others need something that don't use the ASAN runtime
+ rm -rf "$(pwd)/build"
+ export BUILD_ALL=1
+ export ADBC_BUILD_TESTS=OFF
+ export ADBC_USE_ASAN=OFF
+ export ADBC_USE_UBSAN=OFF
+ ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+ - name: Go Build
+ shell: bash -l {0}
+ run: |
+ export PATH=$RUNNER_TOOL_CACHE/go/1.18.6/x64/bin:$PATH
+ ./ci/scripts/go_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+
+ - uses: actions/upload-artifact@v3
+ with:
+ name: driver-manager-${{ matrix.os }}
+ retention-days: 3
+ path: |
+ ~/local
+
+ # ------------------------------------------------------------
+ # C/C++ (builds and tests)
+ # ------------------------------------------------------------
+ drivers-test-conda:
+ name: "C/C++ (Conda/${{ matrix.os }})"
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: ["macos-latest", "ubuntu-latest"]
+ env:
+ # Required for macOS
+ # https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
+ CXXFLAGS: "-D_LIBCPP_DISABLE_AVAILABILITY"
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Get Date
+ id: get-date
+ shell: bash
+ run: |
+ echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
+ - name: Cache Conda
+ uses: actions/cache@v3
+ with:
+ path: ~/conda_pkgs_dir
+ key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
+ - uses: conda-incubator/setup-miniconda@v2
+ with:
+ miniforge-variant: Mambaforge
+ miniforge-version: latest
+ use-only-tar-bz2: false
+ use-mamba: true
+ - name: Install Dependencies
+ shell: bash -l {0}
+ run: |
+ mamba install -c conda-forge \
+ --file ci/conda_env_cpp.txt
+
+ - name: Start PostgreSQL
+ shell: bash -l {0}
+ if: matrix.os == 'ubuntu-latest'
+ run: |
+ docker run --detach --rm -p 5432:5432 -e POSTGRES_DB=tempdb -e POSTGRES_PASSWORD=password postgres
+
+ - name: Build SQLite3 Driver
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
+ - name: Test SQLite3 Driver
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
+ - name: Build PostgreSQL Driver
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_POSTGRESQL=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
+ - name: Test PostgreSQL Driver
+ shell: bash -l {0}
+ if: matrix.os == 'ubuntu-latest'
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_POSTGRESQL: "1"
+ ADBC_POSTGRESQL_TEST_URI: "postgres://localhost:5432/postgres?user=postgres&password=password"
+ run: |
+ ./ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
+ - name: Build Driver Manager
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
+ - name: Test Driver Manager
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
+ env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
+
+ # ------------------------------------------------------------
+ # GLib/Ruby
+ # ------------------------------------------------------------
+ glib-conda:
+ name: "GLib/Ruby (Conda/${{ matrix.os }})"
+ runs-on: ${{ matrix.os }}
+ needs:
+ - drivers-build-conda
+ strategy:
+ matrix:
+ os: ["macos-latest", "ubuntu-latest"]
+ env:
+ # Required for macOS
+ # https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
+ CXXFLAGS: "-D_LIBCPP_DISABLE_AVAILABILITY"
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Get Date
+ id: get-date
+ shell: bash
+ run: |
+ echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
+ - name: Cache Conda
+ uses: actions/cache@v3
+ with:
+ path: ~/conda_pkgs_dir
+ key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
+ - uses: conda-incubator/setup-miniconda@v2
+ with:
+ miniforge-variant: Mambaforge
+ miniforge-version: latest
+ use-only-tar-bz2: false
+ use-mamba: true
+ - name: Install Dependencies
+ shell: bash -l {0}
+ run: |
+ mamba install -c conda-forge \
+ 'arrow-c-glib>=10.0.1' \
+ --file ci/conda_env_cpp.txt \
+ --file ci/conda_env_glib.txt
+
+ - uses: actions/download-artifact@v3
+ with:
+ name: driver-manager-${{ matrix.os }}
+ path: ~/local
+
+ - name: Build GLib Driver Manager
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/glib_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+ - name: Test GLib/Ruby Driver Manager
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/glib_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+
+ # ------------------------------------------------------------
+ # Go
+ # ------------------------------------------------------------
+ go-no-cgo:
+ name: "Go (No CGO) (${{ matrix.os }})"
+ env:
+ CGO_ENABLED: "0"
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: ["macos-latest", "ubuntu-latest", "windows-latest"]
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - uses: actions/setup-go@v3
+ with:
+ go-version-file: 'go/adbc/go.mod'
+ check-latest: true
+ cache: true
+ cache-dependency-path: go/adbc/go.sum
+ - name: Install staticcheck
+ run: go install honnef.co/go/tools/cmd/staticcheck@latest
+ - name: Go Build
+ run: |
+ ./ci/scripts/go_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+ - name: Run Staticcheck
+ run: |
+ pushd go/adbc
+ staticcheck -f stylish ./...
+ popd
+ - name: Go Test
+ run: |
+ ./ci/scripts/go_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+
+ go-conda:
+ name: "Go (CGO) (Conda/${{ matrix.os }})"
+ runs-on: ${{ matrix.os }}
+ needs:
+ - drivers-build-conda
+ strategy:
+ matrix:
+ os: ["macos-latest", "ubuntu-latest"]
+ env:
+ CGO_ENABLED: "1"
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Get Date
+ id: get-date
+ shell: bash
+ run: |
+ echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
+ - name: Cache Conda
+ uses: actions/cache@v3
+ with:
+ path: ~/conda_pkgs_dir
+ key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
+ - uses: conda-incubator/setup-miniconda@v2
+ with:
+ miniforge-variant: Mambaforge
+ miniforge-version: latest
+ use-only-tar-bz2: false
+ use-mamba: true
+ - name: Install Dependencies
+ shell: bash -l {0}
+ run: |
+ mamba install -c conda-forge \
+ --file ci/conda_env_cpp.txt
+ - uses: actions/setup-go@v3
+ with:
+ go-version: 1.18.6
+ check-latest: true
+ cache: true
+ cache-dependency-path: go/adbc/go.sum
+ - name: Install staticcheck
+ shell: bash -l {0}
+ if: ${{ !contains('macos-latest', matrix.os) }}
+ run: go install honnef.co/go/tools/cmd/staticcheck@latest
+
+ - uses: actions/download-artifact@v3
+ with:
+ name: driver-manager-${{ matrix.os }}
+ path: ~/local
+
+ - name: Go Build
+ shell: bash -l {0}
+ run: |
+ export PATH=$RUNNER_TOOL_CACHE/go/1.18.6/x64/bin:$PATH
+ ./ci/scripts/go_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+ - name: Run Staticcheck
+ if: ${{ !contains('macos-latest', matrix.os) }}
+ shell: bash -l {0}
+ run: |
+ pushd go/adbc
+ staticcheck -f stylish ./...
+ popd
+ - name: Go Test
+ shell: bash -l {0}
+ run: |
+ export PATH=$RUNNER_TOOL_CACHE/go/1.18.6/x64/bin:$PATH
+ ./ci/scripts/go_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+
+ # ------------------------------------------------------------
+ # Python/doctests
+ # ------------------------------------------------------------
+ python-conda:
+ name: "Python ${{ matrix.python }} (Conda/${{ matrix.os }})"
+ runs-on: ${{ matrix.os }}
+ needs:
+ - drivers-build-conda
+ strategy:
+ matrix:
+ os: ["macos-latest", "ubuntu-latest"]
+ python: ["3.9", "3.11"]
+ env:
+ # Required for macOS
+ # https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
+ CXXFLAGS: "-D_LIBCPP_DISABLE_AVAILABILITY"
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Get Date
+ id: get-date
+ shell: bash
+ run: |
+ echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
+ - name: Cache Conda
+ uses: actions/cache@v3
+ with:
+ path: ~/conda_pkgs_dir
+ key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
+ - uses: conda-incubator/setup-miniconda@v2
+ with:
+ miniforge-variant: Mambaforge
+ miniforge-version: latest
+ use-only-tar-bz2: false
+ use-mamba: true
+ - name: Install Dependencies
+ shell: bash -l {0}
+ run: |
+ mamba install -c conda-forge \
+ python=${{ matrix.python }} \
+ --file ci/conda_env_cpp.txt \
+ --file ci/conda_env_docs.txt \
+ --file ci/conda_env_python.txt
+
+ - uses: actions/download-artifact@v3
+ with:
+ name: driver-manager-${{ matrix.os }}
+ path: ~/local
+
+ - name: Build Python Driver Manager
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+ - name: Test Python Driver Manager
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+ - name: Build Python Driver PostgreSQL
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_POSTGRESQL=1 ./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+ - name: Test Python Driver PostgreSQL
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_POSTGRESQL=1 ./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+ - name: Build Python Driver SQLite
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+ - name: Test Python Driver SQLite
+ shell: bash -l {0}
+ run: |
+ env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+ # Docs requires Python packages since it runs doctests
+ - name: Build Docs
+ shell: bash -l {0}
+ run: |
+ ./ci/scripts/docs_build.sh "$(pwd)"
diff --git a/.github/workflows/native-windows.yml b/.github/workflows/native-windows.yml
new file mode 100644
index 0000000..a658cd5
--- /dev/null
+++ b/.github/workflows/native-windows.yml
@@ -0,0 +1,327 @@
+# 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.
+
+name: Native Libraries (Windows)
+
+on:
+ pull_request:
+ branches:
+ - main
+ paths:
+ - "adbc.h"
+ - "c/**"
+ - "ci/**"
+ - "glib/**"
+ - "go/**"
+ - "python/**"
+ - "ruby/**"
+ - ".github/workflows/native-windows.yml"
+ push:
+ paths:
+ - "adbc.h"
+ - "c/**"
+ - "ci/**"
+ - "glib/**"
+ - "go/**"
+ - "python/**"
+ - "ruby/**"
+ - ".github/workflows/native-windows.yml"
+
+concurrency:
+ group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+jobs:
+ # ------------------------------------------------------------
+ # Common build (builds libraries used in GLib, Python, Ruby)
+ # ------------------------------------------------------------
+ drivers-build-conda:
+ name: "Common C/C++ Libraries (Conda/${{ matrix.os }})"
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: ["windows-latest"]
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Get Date
+ id: get-date
+ shell: bash
+ run: |
+ echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
+ - name: Cache Conda
+ uses: actions/cache@v3
+ env:
+ # Increment this to reset cache manually
+ CACHE_NUMBER: 0
+ with:
+ path: ~/conda_pkgs_dir
+ key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
+ - uses: conda-incubator/setup-miniconda@v2
+ with:
+ miniforge-variant: Mambaforge
+ miniforge-version: latest
+ use-mamba: true
+ - name: Install Dependencies
+ shell: bash -l {0}
+ run: |
+ mamba install -c conda-forge \
+ --file ci/conda_env_cpp.txt
+
+ - name: Build and Install (No ASan)
+ shell: pwsh
+ env:
+ BUILD_ALL: "1"
+ run: |
+ .\ci\scripts\cpp_build.ps1 $pwd ${{ github.workspace }}\build
+
+ - uses: actions/upload-artifact@v3
+ with:
+ name: driver-manager-${{ matrix.os }}
+ retention-days: 3
+ path: |
+ ${{ github.workspace }}/build
+
+ # ------------------------------------------------------------
+ # C/C++ build (builds and tests)
+ # ------------------------------------------------------------
+ drivers-test-conda:
+ name: "C/C++ (Conda/${{ matrix.os }})"
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: ["windows-latest"]
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Get Date
+ id: get-date
+ shell: bash
+ run: |
+ echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
+ - name: Cache Conda
+ uses: actions/cache@v3
+ env:
+ # Increment this to reset cache manually
+ CACHE_NUMBER: 0
+ with:
+ path: ~/conda_pkgs_dir
+ key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
+ - uses: conda-incubator/setup-miniconda@v2
+ with:
+ miniforge-variant: Mambaforge
+ miniforge-version: latest
+ use-mamba: true
+ - name: Install Dependencies
+ shell: bash -l {0}
+ run: |
+ mamba install -c conda-forge \
+ --file ci/conda_env_cpp.txt
+
+ - name: Build Driver Manager
+ shell: pwsh
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_MANAGER: "1"
+ run:
+ .\ci\scripts\cpp_build.ps1 $pwd $pwd\build
+ - name: Build Driver PostgreSQL
+ shell: pwsh
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_POSTGRESQL: "1"
+ run:
+ .\ci\scripts\cpp_build.ps1 $pwd $pwd\build
+ - name: Build Driver SQLite
+ shell: pwsh
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_SQLITE: "1"
+ run:
+ .\ci\scripts\cpp_build.ps1 $pwd $pwd\build
+ - name: Test Driver Manager
+ shell: pwsh
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_MANAGER: "1"
+ run:
+ .\ci\scripts\cpp_test.ps1 $pwd $pwd\build
+ - name: Test Driver SQLite
+ shell: pwsh
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_SQLITE: "1"
+ run:
+ .\ci\scripts\cpp_test.ps1 $pwd $pwd\build
+
+ # ------------------------------------------------------------
+ # Go build
+ # ------------------------------------------------------------
+ go-conda:
+ name: "Go (CGO) (Conda/${{ matrix.os }})"
+ runs-on: ${{ matrix.os }}
+ needs:
+ - drivers-build-conda
+ strategy:
+ matrix:
+ os: ["windows-latest"]
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Get Date
+ id: get-date
+ shell: bash
+ run: |
+ echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
+ - name: Cache Conda
+ uses: actions/cache@v3
+ env:
+ # Increment this to reset cache manually
+ CACHE_NUMBER: 0
+ with:
+ path: ~/conda_pkgs_dir
+ key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
+ - uses: conda-incubator/setup-miniconda@v2
+ with:
+ miniforge-variant: Mambaforge
+ miniforge-version: latest
+ use-mamba: true
+ - name: Install Dependencies
+ shell: bash -l {0}
+ run: |
+ mamba install -c conda-forge \
+ --file ci/conda_env_cpp.txt
+ - uses: actions/setup-go@v3
+ with:
+ go-version: 1.18.6
+ check-latest: true
+ cache: true
+ cache-dependency-path: go/adbc/go.sum
+
+ - uses: actions/download-artifact@v3
+ with:
+ name: driver-manager-${{ matrix.os }}
+ path: ${{ github.workspace }}/build
+
+ - name: Go Build
+ shell: pwsh
+ env:
+ CGO_ENABLED: "1"
+ run: |
+ $env:PATH="$($env:RUNNER_TOOL_CACHE)\go\1.18.6\x64\bin;" + $env:PATH
+ .\ci\scripts\go_build.ps1 $pwd $pwd\build
+ # TODO(apache/arrow#358): enable these tests on Windows
+ # - name: Go Test
+ # shell: pwsh
+ # env:
+ # CGO_ENABLED: "1"
+ # run: |
+ # $env:PATH="$($env:RUNNER_TOOL_CACHE)\go\1.18.6\x64\bin;" + $env:PATH
+ # .\ci\scripts\go_test.ps1 $pwd $pwd\build
+
+ # ------------------------------------------------------------
+ # Python build
+ # ------------------------------------------------------------
+ python-conda:
+ name: "Python ${{ matrix.python }} (Conda/${{ matrix.os }})"
+ runs-on: ${{ matrix.os }}
+ needs:
+ - drivers-build-conda
+ strategy:
+ matrix:
+ os: ["windows-latest"]
+ python: ["3.9", "3.11"]
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - name: Get Date
+ id: get-date
+ shell: bash
+ run: |
+ echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
+ - name: Cache Conda
+ uses: actions/cache@v3
+ env:
+ # Increment this to reset cache manually
+ CACHE_NUMBER: 0
+ with:
+ path: ~/conda_pkgs_dir
+ key: conda-${{ runner.os }}-${{ steps.get-date.outputs.today }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/**') }}
+ - uses: conda-incubator/setup-miniconda@v2
+ with:
+ miniforge-variant: Mambaforge
+ miniforge-version: latest
+ use-mamba: true
+ - name: Install Dependencies
+ shell: bash -l {0}
+ run: |
+ mamba install -c conda-forge \
+ python=${{ matrix.python }} \
+ --file ci/conda_env_cpp.txt \
+ --file ci/conda_env_python.txt
+
+ - uses: actions/download-artifact@v3
+ with:
+ name: driver-manager-${{ matrix.os }}
+ path: ${{ github.workspace }}/build
+
+ - name: Build Python Driver Manager
+ shell: pwsh
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_MANAGER: "1"
+ run:
+ .\ci\scripts\python_build.ps1 $pwd $pwd\build
+ - name: Build Python Driver PostgreSQL
+ shell: pwsh
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_POSTGRESQL: "1"
+ run:
+ .\ci\scripts\python_build.ps1 $pwd $pwd\build
+ - name: Build Python Driver SQLite
+ shell: pwsh
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_SQLITE: "1"
+ run:
+ .\ci\scripts\python_build.ps1 $pwd $pwd\build
+ - name: Test Python Driver Manager
+ shell: pwsh
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_MANAGER: "1"
+ run:
+ .\ci\scripts\python_test.ps1 $pwd $pwd\build
+ - name: Test Python Driver SQLite
+ shell: pwsh
+ env:
+ BUILD_ALL: "0"
+ BUILD_DRIVER_SQLITE: "1"
+ run:
+ .\ci\scripts\python_test.ps1 $pwd $pwd\build
diff --git a/c/driver_manager/adbc_driver_manager.cc b/c/driver_manager/adbc_driver_manager.cc
index e4dfda4..c63560a 100644
--- a/c/driver_manager/adbc_driver_manager.cc
+++ b/c/driver_manager/adbc_driver_manager.cc
@@ -675,7 +675,7 @@ AdbcStatusCode AdbcLoadDriver(const char* driver_name, const char* entrypoint,
return ADBC_STATUS_INTERNAL;
}
- void* load_handle = GetProcAddress(handle, entrypoint);
+ void* load_handle = reinterpret_cast<void*>(GetProcAddress(handle, entrypoint));
init_func = reinterpret_cast<AdbcDriverInitFunc>(load_handle);
if (!init_func) {
std::string message = "GetProcAddress(";
diff --git a/ci/scripts/go_build.ps1 b/ci/scripts/go_build.ps1
new file mode 100644
index 0000000..3e4a341
--- /dev/null
+++ b/ci/scripts/go_build.ps1
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+# 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.
+
+$ErrorActionPreference = "Stop"
+
+$SourceDir = $Args[0]
+$BuildDir = $Args[1]
+$InstallDir = if ($Args[2] -ne $null) { $Args[2] } else { Join-Path $BuildDir "local/" }
+
+$GoDir = Join-Path $SourceDir "go" "adbc"
+
+Push-Location $GoDir
+
+go build -v ./...
+if (-not $?) { exit 1 }
+
+if ($env:CGO_ENABLED -eq "1") {
+ Push-Location pkg
+ go build `
+ -tags driverlib `
+ -o adbc_driver_flightsql.dll `
+ -buildmode=c-shared `
+ ./flightsql
+ if (-not $?) { exit 1 }
+ Pop-Location
+}
+
+Pop-Location
diff --git a/ci/scripts/go_test.ps1 b/ci/scripts/go_test.ps1
new file mode 100644
index 0000000..ea17fc7
--- /dev/null
+++ b/ci/scripts/go_test.ps1
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+# 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.
+
+$ErrorActionPreference = "Stop"
+
+$SourceDir = $Args[0]
+$BuildDir = $Args[1]
+$InstallDir = if ($Args[2] -ne $null) { $Args[2] } else { Join-Path $BuildDir "local/" }
+
+if ($env:CGO_ENABLED -eq "1") {
+ $env:PATH += "$($InstallDir)\bin"
+}
+
+$GoDir = Join-Path $SourceDir "go" "adbc"
+
+Push-Location $GoDir
+
+go test -v ./...
+if (-not $?) { exit 1 }
+
+Pop-Location
diff --git a/go/adbc/drivermgr/wrapper.go b/go/adbc/drivermgr/wrapper.go
index a220291..4502590 100644
--- a/go/adbc/drivermgr/wrapper.go
+++ b/go/adbc/drivermgr/wrapper.go
@@ -18,6 +18,9 @@
package drivermgr
// #cgo !windows LDFLAGS: -ldl
+// #cgo windows CFLAGS: -DADBC_EXPORTING
+// #cgo windows CPPFLAGS: -DADBC_EXPORTING
+// #define ADBC_EXPORTING
// #include "adbc.h"
// #include <stdlib.h>
//
diff --git a/go/adbc/drivermgr/wrapper_sqlite_test.go b/go/adbc/drivermgr/wrapper_sqlite_test.go
index 929b1d4..71be337 100644
--- a/go/adbc/drivermgr/wrapper_sqlite_test.go
+++ b/go/adbc/drivermgr/wrapper_sqlite_test.go
@@ -219,7 +219,11 @@ func TestDriverMgrCustomInitFunc(t *testing.T) {
var exp *adbc.Error
assert.ErrorAs(t, err, &exp)
assert.Equal(t, adbc.StatusInternal, exp.Code)
- assert.Contains(t, exp.Msg, "dlsym(ThisSymbolDoesNotExist) failed")
+ if runtime.GOOS == "windows" {
+ assert.Contains(t, exp.Msg, "GetProcAddress(ThisSymbolDoesNotExist) failed")
+ } else {
+ assert.Contains(t, exp.Msg, "dlsym(ThisSymbolDoesNotExist) failed")
+ }
switch runtime.GOOS {
case "darwin":
assert.Contains(t, exp.Msg, "ThisSymbolDoesNotExist): symbol not found")
diff --git a/go/adbc/pkg/_tmpl/driver.go.tmpl b/go/adbc/pkg/_tmpl/driver.go.tmpl
index 3feb64c..6713714 100644
--- a/go/adbc/pkg/_tmpl/driver.go.tmpl
+++ b/go/adbc/pkg/_tmpl/driver.go.tmpl
@@ -596,8 +596,8 @@ func {{.Prefix}}StatementExecutePartitions(stmt *C.struct_AdbcStatement, schema
}
partitions.num_partitions = C.size_t(part.NumPartitions)
- partitions.partitions = (**C.cuint8_t)(C.malloc(C.ulong(unsafe.Sizeof((*C.uint8_t)(nil)) * uintptr(part.NumPartitions))))
- partitions.partition_lengths = (*C.size_t)(C.malloc(C.ulong(unsafe.Sizeof(C.size_t(0)) * uintptr(part.NumPartitions))))
+ partitions.partitions = (**C.cuint8_t)(C.malloc(C.size_t(unsafe.Sizeof((*C.uint8_t)(nil)) * uintptr(part.NumPartitions))))
+ partitions.partition_lengths = (*C.size_t)(C.malloc(C.size_t(unsafe.Sizeof(C.size_t(0)) * uintptr(part.NumPartitions))))
partIDs := fromCArr[*C.cuint8_t](partitions.partitions, int(partitions.num_partitions))
partLens := fromCArr[C.size_t](partitions.partition_lengths, int(partitions.num_partitions))
diff --git a/go/adbc/pkg/flightsql/driver.go b/go/adbc/pkg/flightsql/driver.go
index e177cd8..c34d8c0 100644
--- a/go/adbc/pkg/flightsql/driver.go
+++ b/go/adbc/pkg/flightsql/driver.go
@@ -599,8 +599,8 @@ func FlightSQLStatementExecutePartitions(stmt *C.struct_AdbcStatement, schema *C
}
partitions.num_partitions = C.size_t(part.NumPartitions)
- partitions.partitions = (**C.cuint8_t)(C.malloc(C.ulong(unsafe.Sizeof((*C.uint8_t)(nil)) * uintptr(part.NumPartitions))))
- partitions.partition_lengths = (*C.size_t)(C.malloc(C.ulong(unsafe.Sizeof(C.size_t(0)) * uintptr(part.NumPartitions))))
+ partitions.partitions = (**C.cuint8_t)(C.malloc(C.size_t(unsafe.Sizeof((*C.uint8_t)(nil)) * uintptr(part.NumPartitions))))
+ partitions.partition_lengths = (*C.size_t)(C.malloc(C.size_t(unsafe.Sizeof(C.size_t(0)) * uintptr(part.NumPartitions))))
partIDs := fromCArr[*C.cuint8_t](partitions.partitions, int(partitions.num_partitions))
partLens := fromCArr[C.size_t](partitions.partition_lengths, int(partitions.num_partitions))