Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
2562df6
CI: Implement sccache (and disable other workflows) for faster dev
paultiq Sep 17, 2025
b3b4fb3
on_workflow_dispatch_only
paultiq Sep 17, 2025
4ada7d6
fix: workflow_dispatch
paultiq Sep 17, 2025
f31b18b
speed up tests with xdist
paultiq Sep 17, 2025
6b0ebb2
tests: add durations to show slowest tests
paultiq Sep 17, 2025
fefc83c
dont activate venv in step
paultiq Sep 17, 2025
02e927f
ci: CIBW_BEFORE_TEST was shadowed
paultiq Sep 17, 2025
d72baff
tests: not yet ready for n auto
paultiq Sep 17, 2025
afe0b8e
ci: Use unity for duckdb, but not for the python package to balance c…
paultiq Sep 19, 2025
1e19339
docs: update readme and move contributing docs to CONTRIBUTING.md
NickCrews Sep 15, 2025
51ca139
contributing.md: keep some of the old general guidelines, re-organize…
NickCrews Sep 15, 2025
5154188
Apply suggestions from code review
NickCrews Sep 17, 2025
0c16b58
merging free_threading_314t
paultiq Sep 20, 2025
b353450
add msvc for env
paultiq Sep 20, 2025
14541c9
simplify
paultiq Sep 20, 2025
dcb18dd
remove python_gil
paultiq Sep 20, 2025
0d0ac2a
enable Windows and macos and macos26
paultiq Sep 20, 2025
2b319fe
merged concurrency_testing
paultiq Sep 20, 2025
587c767
enalbe windows, and verbose ninja logging
paultiq Sep 20, 2025
17dc36b
disable sanity check
paultiq Sep 20, 2025
69919a9
fix verbose settings
paultiq Sep 20, 2025
e91a1b8
disable sanity guard
paultiq Sep 20, 2025
8ccf32c
cmake param
paultiq Sep 20, 2025
fe2e9fd
add stats
paultiq Sep 20, 2025
95cf9ef
verbose is a build arg
paultiq Sep 20, 2025
2b5574d
update
paultiq Sep 20, 2025
0cd4dc1
add os
paultiq Sep 20, 2025
d93dcb0
correct ninja stats
paultiq Sep 20, 2025
77cf6ac
more interruptable query
paultiq Sep 20, 2025
4b3b51e
try a longer timeout
paultiq Sep 20, 2025
7d06005
debug cache misses
paultiq Sep 20, 2025
7e614d4
trace level sccache log
paultiq Sep 20, 2025
9ae1378
ci: fix upload wheel to use os
paultiq Sep 20, 2025
c4a840e
try to fix sccache misses
paultiq Sep 20, 2025
601258c
not so noisy
paultiq Sep 20, 2025
95d0338
fix winfix windows
paultiq Sep 20, 2025
3984a6a
debug again - cache misses
paultiq Sep 20, 2025
e5a94ab
linux only
paultiq Sep 20, 2025
ea4468b
windows mkdir correctly
paultiq Sep 20, 2025
6f7354a
stable path
paultiq Sep 20, 2025
9b0154e
no-build-isolation
paultiq Sep 20, 2025
0252e87
CIBW_BUILD_FRONTEND
paultiq Sep 20, 2025
c29ac46
set conf settings
paultiq Sep 20, 2025
05bf0fc
as array
paultiq Sep 20, 2025
bf7d8a6
UV_NO_BUILD_ISOLATION
paultiq Sep 20, 2025
d3e3371
try quay cache
paultiq Sep 20, 2025
f049f3a
pass build env args and try caching docker
paultiq Sep 20, 2025
7a4d0a3
no isolation
paultiq Sep 20, 2025
a2a2cab
update
paultiq Sep 20, 2025
d01a93e
disable cache
paultiq Sep 20, 2025
2185525
adjust builderx
paultiq Sep 20, 2025
a89b419
docker container caching
paultiq Sep 20, 2025
ca2b480
keep trying to get uv to use a stable build-env
paultiq Sep 20, 2025
0efb786
remove cache
paultiq Sep 20, 2025
fa71207
testing just linux
paultiq Sep 20, 2025
4e26deb
still build isolation not working
paultiq Sep 20, 2025
d90de07
and, anotehr try
paultiq Sep 20, 2025
2eda9a9
try no-build-isolation
paultiq Sep 20, 2025
34a99a4
try again with build-env dir
paultiq Sep 20, 2025
7543e02
try again
paultiq Sep 20, 2025
921528d
try regular backend
paultiq Sep 20, 2025
bc7a374
again
paultiq Sep 20, 2025
1d260e3
and again
paultiq Sep 20, 2025
397c105
revert
paultiq Sep 20, 2025
5834ced
try --no-use-pep517
paultiq Sep 20, 2025
4dc6819
try a different way
paultiq Sep 20, 2025
0de81d2
shadow
paultiq Sep 20, 2025
ad72841
get duckdb_packaging back in path
paultiq Sep 20, 2025
54d4779
dirs
paultiq Sep 20, 2025
3f2deec
matrix
paultiq Sep 20, 2025
1e5ccf7
hardcode it test
paultiq Sep 20, 2025
54234a1
pass uv python
paultiq Sep 20, 2025
3c6c17e
pass pythonpath
paultiq Sep 20, 2025
2bcbc7a
try again with environment
paultiq Sep 21, 2025
e5c51be
and again
paultiq Sep 21, 2025
cffd0ad
windows and mac
paultiq Sep 21, 2025
cd42577
uv pip
paultiq Sep 21, 2025
13c7329
paths
paultiq Sep 21, 2025
6451556
install editable
paultiq Sep 21, 2025
7473dba
try 3
paultiq Sep 21, 2025
c6414b7
fix
paultiq Sep 21, 2025
9d4a915
try again
paultiq Sep 21, 2025
0f0641a
ubuntu finally? mac and win fixes
paultiq Sep 21, 2025
b22aaf2
uv pip
paultiq Sep 21, 2025
5d5fb0f
fix uv
paultiq Sep 21, 2025
9594211
mac
paultiq Sep 21, 2025
5a03800
mac 2
paultiq Sep 21, 2025
3551f45
mac 3
paultiq Sep 21, 2025
0247ea4
"true"
paultiq Sep 21, 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
22 changes: 11 additions & 11 deletions .github/workflows/on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Tests and builds on PR
on:
pull_request:
branches:
- main
- v*.*-*
- '**'
types: [opened, reopened, ready_for_review, converted_to_draft, synchronize]
paths-ignore:
- '**.md'
Expand All @@ -13,19 +12,20 @@ on:
- '.github//**'
- '!.github/workflows/on_push.yml'
- '!.github/workflows/coverage.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true

jobs:
submodule_sanity_guard:
name: Make sure submodule is in a sane state
uses: ./.github/workflows/submodule_sanity.yml
# submodule_sanity_guard:
# name: Make sure submodule is in a sane state
# uses: ./.github/workflows/submodule_sanity.yml

packaging_test:
name: Build a minimal set of packages and run all tests on them
needs: submodule_sanity_guard
# needs: submodule_sanity_guard
# Skip packaging tests for draft PRs
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
uses: ./.github/workflows/packaging.yml
Expand All @@ -36,9 +36,9 @@ jobs:

coverage_test:
name: Run coverage tests
needs: submodule_sanity_guard
# needs: submodule_sanity_guard
# Only run coverage test for draft PRs
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == true }}
if: false # ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == true }}
uses: ./.github/workflows/coverage.yml
with:
duckdb_git_ref: ${{ github.base_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Tests and coverage on push
on:
push:
workflow_dispatch:
branches-ignore:
- main
- v*.*-*
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ on:
required: false
type: string

concurrency:
group: packaging-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# concurrency:
# group: packaging-${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true

defaults:
run:
Expand All @@ -63,6 +63,7 @@ defaults:
jobs:
build_sdist:
name: Build an sdist and determine versions
if: false # disable for dev
uses: ./.github/workflows/packaging_sdist.yml
with:
testsuite: all
Expand Down
159 changes: 138 additions & 21 deletions .github/workflows/packaging_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,55 +26,80 @@ on:

jobs:
build_wheels:
name: 'Wheel: ${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}'
name: 'Wheel: ${{ matrix.python }}-${{ matrix.platform.os }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}'
strategy:
fail-fast: false
matrix:
python: [ cp39, cp310, cp311, cp312, cp313, cp314, cp314t ]
python: [ cp314t ] # cp39, cp310, cp311, cp312, cp313, cp314t,
platform:
- { os: windows-2025, arch: amd64, cibw_system: win }
- { os: ubuntu-24.04, arch: x86_64, cibw_system: manylinux }
- { os: ubuntu-24.04-arm, arch: aarch64, cibw_system: manylinux }
- { os: macos-15, arch: arm64, cibw_system: macosx }
- { os: macos-15, arch: universal2, cibw_system: macosx }
- { os: macos-13, arch: x86_64, cibw_system: macosx }
- { os: ubuntu-latest, arch: x86_64, cibw_system: manylinux }
# - { os: ubuntu-24.04-arm, arch: aarch64, cibw_system: manylinux }
#- { os: macos-15, arch: arm64, cibw_system: macosx }
- { os: macos-26, arch: arm64, cibw_system: macosx }
# - { os: macos-15, arch: universal2, cibw_system: macosx }
# - { os: macos-13, arch: x86_64, cibw_system: macosx }
minimal:
- ${{ inputs.minimal }}
exclude:
- { minimal: true, python: cp310 }
- { minimal: true, python: cp311 }
- { minimal: true, python: cp312 }
- { minimal: true, platform: { arch: universal2 } }
# Windows+cp314t disabled due to test failures in CI.
# TODO: Diagnose why tests fail (access violations) in some configurations
- { python: cp314t, platform: { os: windows-2025 } }


runs-on: ${{ matrix.platform.os }}
env:
CIBW_TEST_SKIP: ${{ inputs.testsuite == 'none' && '*' || '*-macosx_universal2' }}
CIBW_TEST_SOURCES: tests
CIBW_BEFORE_TEST: >
uv export --only-group test --no-emit-project --output-file pylock.toml --directory {project} &&
CIBW_BEFORE_TEST_LINUX: >
unset UV_NO_BUILD_ISOLATION &&
sccache --show-stats &&
uv export --only-group test --no-emit-project --output-file pylock.toml --directory {project} --quiet &&
uv pip install -r pylock.toml
CIBW_BEFORE_TEST_MACOS: >
unset UV_NO_BUILD_ISOLATION &&
sccache --show-stats &&
uv export --only-group test --no-emit-project --output-file pylock.toml --directory {project} --quiet &&
uv pip install -r pylock.toml
CIBW_BEFORE_TEST_WINDOWS: >
set UV_NO_BUILD_ISOLATION= &&
sccache --show-stats &&
uv export --only-group test --no-emit-project --output-file pylock.toml --directory {project} --quiet &&
uv pip install -r pylock.toml
CIBW_TEST_COMMAND: >
uv run -v pytest ${{ inputs.testsuite == 'fast' && './tests/fast' || './tests' }} --verbose --ignore=./tests/stubs
uv run -v pytest ${{ inputs.testsuite == 'fast' && './tests/fast' || './tests' }} --verbose --ignore=./tests/stubs --durations=5 -n 2 &&
uv run -v pytest ./tests/fast/threading --durations=5 --parallel-threads=10 --iterations=5 -n 2

# sccache configuration with path normalization fixes
SCCACHE_GHA_ENABLED: "on"
SCCACHE_C_CUSTOM_CACHE_BUSTER: ${{ toJSON(matrix) }}
SCCACHE_BASEDIR: "/project"
ACTIONS_CACHE_SERVICE_V2: "1"

# Fix random temp directories for consistent caching
TMPDIR: "/tmp/duckdb-build"
TEMP: "/tmp/duckdb-build"
steps:
- name: Checkout DuckDB Python
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.duckdb-python-sha }}
fetch-depth: 0
submodules: true

- name: Checkout DuckDB
shell: bash
continue-on-error: true # needed when we're merging into a branch
if: ${{ inputs.duckdb-sha }}
run: |
cd external/duckdb
git fetch origin
git checkout ${{ inputs.duckdb-sha }}

- name: Configure Cache Env
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# Make sure that OVERRIDE_GIT_DESCRIBE is propagated to cibuildwhel's env, also when it's running linux builds
- name: Set OVERRIDE_GIT_DESCRIBE
shell: bash
Expand All @@ -89,17 +114,109 @@ jobs:
cache-suffix: -${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
python-version: ${{ matrix.python }}

# # Install Astral UV, which will be used as build-frontend for cibuildwheel
# - name: Install UV
# shell: bash
# env:
# TMPDIR: /tmp
# run: |
# curl -LsSf https://astral.sh/uv/0.8.16/install.sh | sh
# echo "$HOME/.local/bin" >> $GITHUB_PATH
# export PATH="$HOME/.local/bin:$PATH"
# uv --version

# Load MSVC environment, needed for Windows - ninja builds
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.python == 'cp314t' && matrix.platform.cibw_system == 'win' }}
with:
arch: ${{ matrix.platform.arch }}

- name: Build${{ inputs.testsuite != 'none' && ' and test ' || ' ' }}wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.platform.arch == 'amd64' && 'AMD64' || matrix.platform.arch }}
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
# PYTHON_GIL=1: Suppresses the RuntimeWarning that the GIL is enabled on free-threaded builds.
# TODO: Remove PYTHON_GIL=1 when free-threaded is supported.
CIBW_ENVIRONMENT: PYTHON_GIL=1
CIBW_BUILD_FRONTEND: "build[uv]; args: --no-isolation"
UV_PYTHON: ${{ matrix.python }}
UV_PROJECT_ENVIRONMENT: /project/.venv
PYTHONPATH: /project
# SCCACHE Notes:
# - Without the /project dir and tmpdirs (not sure exactly which mattered), the python environment is installed to a random tmp dir, which breaks
# the cache key... so, only the external/duckdb would cache, and not the project itself
# - GHA cache is limited to 10GB LRU.
# - SCCACHE_BASEDIR is not implemented in sccache (https://github.com/mozilla/sccache/issues/35)
# - Using -fdebug-prefix-map/-fmacro-prefix-map for path normalization instead (Mozilla Firefox approach)
# - Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1524662 "Support gcc/clang-like build path prefix map"
# - UV creates random build-env-* dirs causing cache misses (https://github.com/astral-sh/uv/issues/13096)
# - Using --no-isolation to eliminate random UV build environments
#
# SCCACHE_LOG: trace
# SCCACHE_LOG_LEVEL: trace
# RUST_LOG: trace
# SCCACHE_NO_DAEMON: "1"

# no-build-isolation uses the same build-env path for each build, stable paths needed for caching
CIBW_ENVIRONMENT: >
CMAKE_C_COMPILER_LAUNCHER="" CMAKE_CXX_COMPILER_LAUNCHER=""
CFLAGS="-Wno-attributes" CXXFLAGS="-Wno-attributes"
SCCACHE_BASEDIR="/tmp/duckdb-build"
TMPDIR="/tmp/duckdb-build" TEMP="/tmp/duckdb-build"
UV_NO_BUILD_ISOLATION="true"
PYTHONPATH="/project"
UV_CACHE_DIR="/tmp/duckdb-build/uv-cache"
UV_PROJECT_ENVIRONMENT="/project/.venv"
UV_PYTHON=cp314t
CIBW_ENVIRONMENT_MACOS: >
CMAKE_C_COMPILER_LAUNCHER="" CMAKE_CXX_COMPILER_LAUNCHER=""
CFLAGS="-Wno-attributes" CXXFLAGS="-Wno-attributes"
SCCACHE_BASEDIR="/tmp/duckdb-build"
TMPDIR="/tmp/duckdb-build" TEMP="/tmp/duckdb-build"
UV_NO_BUILD_ISOLATION="true"
PYTHONPATH="."
UV_CACHE_DIR="/tmp/duckdb-build/uv-cache"
UV_PROJECT_ENVIRONMENT="/tmp/duckdb-build/.venv"
UV_PYTHON=cp314t
CIBW_ENVIRONMENT_WINDOWS: >
CMAKE_BUILD_TYPE=Release CMAKE_C_COMPILER_LAUNCHER="" CMAKE_CXX_COMPILER_LAUNCHER=""
CFLAGS="-Wno-attributes" CXXFLAGS="-Wno-attributes"
SCCACHE_BASEDIR="/tmp/duckdb-build"
TMPDIR="C:/tmp/duckdb-build" TEMP="C:/tmp/duckdb-build"
UV_NO_BUILD_ISOLATION="true"
PYTHONPATH="."
UV_CACHE_DIR="C:/tmp/duckdb-build/uv-cache"
UV_PROJECT_ENVIRONMENT="C:/project/.venv"
UV_PYTHON=cp314t

CIBW_ENVIRONMENT_PASS: SCCACHE_GHA_ENABLED ACTIONS_RUNTIME_TOKEN ACTIONS_RESULTS_URL ACTIONS_CACHE_SERVICE_V2 SCCACHE_C_CUSTOM_CACHE_BUSTER SCCACHE_LOG SCCACHE_LOG_LEVEL SCCACHE_NO_DAEMON RUST_LOG SCCACHE_BASEDIR TMPDIR TEMP PIP_CACHE_DIR UV_PYTHON UV_PROJECT_ENVIRONMENT PYTHONPATH UV_NO_BUILD_ISOLATION UV_CACHE_DIR

# Use pyproject.toml settings - remove overrides to let pyproject.toml before-build work
# Just install sccache since that's platform-specific and not in pyproject.toml
CIBW_BEFORE_BUILD_LINUX: >
mkdir -p /tmp/duckdb-build /tmp/pip-cache &&
if [ "$(uname -m)" = "aarch64" ]; then ARCH=aarch64; else ARCH=x86_64; fi &&
curl -L https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-${ARCH}-unknown-linux-musl.tar.gz | tar xz &&
cp sccache-v0.10.0-${ARCH}-unknown-linux-musl/sccache /usr/bin &&
sccache --show-stats &&
echo "Installing build dependencies..." &&
uv pip install --system scikit-build-core 'pybind11[global]>=2.6.0' setuptools-scm 'cmake>=3.29.0' 'ninja>=1.10' &&
echo "Current directory: $(pwd)" &&
echo "Directory contents:" && ls -la &&
echo "Testing duckdb_packaging import:" &&
python -c "import sys; print('Python path:', sys.path); import duckdb_packaging.build_backend; print('Import successful')"
CIBW_BEFORE_BUILD_MACOS: >
mkdir -p /tmp/duckdb-build /tmp/duckdb-build/uv-cache /tmp/pip-cache &&
echo "Installing build dependencies..." &&
uv pip install scikit-build-core 'pybind11[global]>=2.6.0' setuptools-scm 'cmake>=3.29.0' 'ninja>=1.10' &&
brew install sccache
CIBW_BEFORE_BUILD_WINDOWS: >
(mkdir "C:\tmp\duckdb-build" 2>nul & mkdir "C:\tmp\duckdb-build\uv-cache" 2>nul & mkdir "C:\tmp\pip-cache" 2>nul) &&
del "C:\Strawberry\c\bin\ccache.exe" &&
echo "Installing build dependencies..." &&
uv pip install scikit-build-core "pybind11[global]>=2.6.0" setuptools-scm "cmake>=3.29.0" "ninja>=1.10" &&
choco install sccache
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
name: wheel-${{ matrix.python }}-${{ matrix.platform.os }}_${{ matrix.platform.arch }}
path: wheelhouse/*.whl
compression-level: 0
Loading