Skip to content

Commit

Permalink
Merge pull request #116 from duckdb/main
Browse files Browse the repository at this point in the history
Merge main into v1.1.3
  • Loading branch information
samansmink authored Nov 25, 2024
2 parents 83f847f + 46a8dd6 commit 5121955
Show file tree
Hide file tree
Showing 10 changed files with 650 additions and 94 deletions.
26 changes: 25 additions & 1 deletion .github/workflows/TestCITools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,31 @@ jobs:
override_ci_tools_repository: ${{ github.repository }}
ci_tools_version: ${{ github.sha }}
extra_toolchains: 'parser_tools;fortran;omp;go;python3'
custom_toolchain_script: true

extension-template-capi:
name: Extension template (C API)
uses: ./.github/workflows/_extension_distribution.yml
with:
extension_name: capi_quack
override_repository: duckdb/extension-template-c
override_ref: main
duckdb_version: v1.1.3
override_ci_tools_repository: ${{ github.repository }}
ci_tools_version: ${{ github.sha }}
extra_toolchains: 'python3'

extension-template-rust:
name: Extension template (Rust)
uses: ./.github/workflows/_extension_distribution.yml
with:
extension_name: rusty_quack
override_repository: duckdb/extension-template-rs
override_ref: main
duckdb_version: v1.1.3
override_ci_tools_repository: ${{ github.repository }}
ci_tools_version: ${{ github.sha }}
extra_toolchains: 'rust;python3'
exclude_archs: 'windows_amd64_rtools;windows_amd64_mingw' # TODO: remove once fixed upstream

delta-extension-main:
name: Rust builds (using Delta extension)
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/_extension_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ on:
duckdb_version:
required: true
type: string
# The version of the https://github.com/duckdb/extension-ci-tools submodule of the extension. In most cases will be identical to `duckdb_version`.
# Passing this explicitly is required because of https://github.com/actions/toolkit/issues/1264
ci_tools_version:
required: true
type: string
# Override the repo for the CI tools (for testing CI tools itself)
override_ci_tools_repository:
required: false
type: string
default: "duckdb/extension-ci-tools"
# ';' separated list of architectures to exclude, for example: 'linux_amd64;osx_arm64'
exclude_archs:
required: false
Expand Down Expand Up @@ -47,7 +57,7 @@ on:
matrix_parse_script:
required: false
type: string
default: "./duckdb/scripts/modify_distribution_matrix.py"
default: "./extension-ci-tools/scripts/modify_distribution_matrix.py"

jobs:
generate_matrix:
Expand All @@ -57,18 +67,15 @@ jobs:
deploy_matrix: ${{ steps.parse-matrices.outputs.deploy_matrix }}
steps:
- uses: actions/checkout@v4
name: Checkout Extension CI tools
with:
fetch-depth: 0
submodules: 'true'

- name: Checkout DuckDB to version
run: |
cd duckdb
git checkout ${{ inputs.duckdb_version }}
path: 'extension-ci-tools'
ref: ${{ inputs.ci_tools_version }}
repository: ${{ inputs.override_ci_tools_repository }}

- id: parse-matrices
run: |
python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --deploy_matrix --output deploy_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
python3 ${{ inputs.matrix_parse_script }} --input extension-ci-tools/config/distribution_matrix.json --deploy_matrix --output deploy_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
deploy_matrix="`cat deploy_matrix.json`"
echo deploy_matrix=$deploy_matrix >> $GITHUB_OUTPUT
echo `cat $GITHUB_OUTPUT`
Expand All @@ -92,7 +99,7 @@ jobs:
cd duckdb
git checkout ${{ inputs.duckdb_version }}
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}}${{startsWith(matrix.duckdb, 'wasm') && '.wasm' || ''}}
path: |
Expand Down
122 changes: 53 additions & 69 deletions .github/workflows/_extension_distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ on:
matrix_parse_script:
required: false
type: string
default: "./duckdb/scripts/modify_distribution_matrix.py"
default: "./extension-ci-tools/scripts/modify_distribution_matrix.py"
# Enable building the DuckDB Shell
build_duckdb_shell:
required: false
Expand All @@ -76,11 +76,6 @@ on:
required: false
type: string
default: ""
# If set, the setup will look for a script in `./scripts/custom-toolchain-script.sh` to run
custom_toolchain_script:
required: false
type: boolean
default: false
rust_logs:
required: false
type: boolean
Expand All @@ -105,6 +100,7 @@ on:
required: false
type: boolean
default: false

jobs:
generate_matrix:
name: Generate matrix
Expand All @@ -115,57 +111,20 @@ jobs:
osx_matrix: ${{ steps.set-matrix-osx.outputs.osx_matrix }}
wasm_matrix: ${{ steps.set-matrix-wasm.outputs.wasm_matrix }}
steps:
- uses: actions/checkout@v4
name: Checkout override repository
if: ${{inputs.override_repository != ''}}
with:
repository: ${{ inputs.override_repository }}
ref: ${{ inputs.override_ref }}
fetch-depth: 0
submodules: 'true'

- uses: actions/checkout@v4
name: Checkout current repository
if: ${{inputs.override_repository == ''}}
with:
fetch-depth: 0
submodules: 'true'

- uses: actions/checkout@v4
name: Checkout Extension CI tools
with:
path: 'extension-ci-tools'
ref: ${{ inputs.ci_tools_version }}
repository: ${{ inputs.override_ci_tools_repository }}

- name: Checkout DuckDB to version
if: ${{inputs.duckdb_version != ''}}
run: |
DUCKDB_GIT_VERSION=${{ inputs.duckdb_version }} make set_duckdb_version
- name: Tag extension
if: ${{inputs.extension_tag != ''}}
run: |
git tag ${{ inputs.extension_tag }}
- name: Tag DuckDB extension
if: ${{inputs.duckdb_tag != '' && (inputs.duckdb_version == 'main' || inputs.duckdb_version[0] == 'v') }}
run: |
echo "When duckdb_tag is provied an explcit git ref is expected" && exit 1
- name: Tag DuckDB extension
if: ${{inputs.duckdb_tag != ''}}
run: |
DUCKDB_TAG=${{ inputs.duckdb_tag }} make set_duckdb_tag
- id: parse-matrices
run: |
mkdir build
make output_distribution_matrix | tail -n +2 > build/distribution_matrix.json
python3 ${{ inputs.matrix_parse_script }} --input build/distribution_matrix.json --select_os linux --output build/linux_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
python3 ${{ inputs.matrix_parse_script }} --input build/distribution_matrix.json --select_os osx --output build/osx_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
python3 ${{ inputs.matrix_parse_script }} --input build/distribution_matrix.json --select_os windows --output build/windows_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
python3 ${{ inputs.matrix_parse_script }} --input build/distribution_matrix.json --select_os wasm --output build/wasm_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
python3 ${{ inputs.matrix_parse_script }} --input extension-ci-tools/config/distribution_matrix.json --select_os linux --output build/linux_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
python3 ${{ inputs.matrix_parse_script }} --input extension-ci-tools/config/distribution_matrix.json --select_os osx --output build/osx_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
python3 ${{ inputs.matrix_parse_script }} --input extension-ci-tools/config/distribution_matrix.json --select_os windows --output build/windows_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
python3 ${{ inputs.matrix_parse_script }} --input extension-ci-tools/config/distribution_matrix.json --select_os wasm --output build/wasm_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
- id: set-matrix-linux
run: |
Expand Down Expand Up @@ -283,6 +242,8 @@ jobs:
echo "OPENSSL_DIR=/duckdb_build_dir/build/release/vcpkg_installed/${{ matrix.vcpkg_triplet }}" >> docker_env.txt
echo "OPENSSL_USE_STATIC_LIBS=true" >> docker_env.txt
echo "DUCKDB_PLATFORM=${{ matrix.duckdb_arch }}" >> docker_env.txt
echo "DUCKDB_GIT_VERSION=${{ inputs.duckdb_version }}" >> docker_env.txt
echo "LINUX_CI_IN_DOCKER=1" >> docker_env.txt
echo "TOOLCHAIN_FLAGS=${{ matrix.duckdb_arch == 'linux_arm64' && '-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_Fortran_COMPILER=aarch64-linux-gnu-gfortran' || '' }}" >> docker_env.txt
- name: Generate timestamp for Ccache entry
Expand All @@ -304,16 +265,37 @@ jobs:
restore-keys: |
ccache-extension-distribution-${{ matrix.duckdb_arch }}-
- name: Build extension
- name: Run configure (outside Docker)
shell: bash
env:
DUCKDB_GIT_VERSION: ${{ inputs.duckdb_version }}
LINUX_CI_IN_DOCKER: 0
run: |
make configure_ci
- name: Run configure (inside Docker)
shell: bash
run: |
docker run --env-file=docker_env.txt -v `pwd`:/duckdb_build_dir -v `pwd`/ccache_dir:/ccache_dir duckdb/${{ matrix.duckdb_arch }} make configure_ci
- name: Build extension (inside Docker)
run: |
docker run --env-file=docker_env.txt -v `pwd`:/duckdb_build_dir -v `pwd`/ccache_dir:/ccache_dir duckdb/${{ matrix.duckdb_arch }} make release
- name: Test extension
- name: Test extension (inside docker)
if: ${{ matrix.duckdb_arch != 'linux_arm64' && inputs.skip_tests == false }}
run: |
docker run --env-file=docker_env.txt -v `pwd`:/duckdb_build_dir -v `pwd`/ccache_dir:/ccache_dir duckdb/${{ matrix.duckdb_arch }} make test
docker run --env-file=docker_env.txt -v `pwd`:/duckdb_build_dir -v `pwd`/ccache_dir:/ccache_dir duckdb/${{ matrix.duckdb_arch }} make test_release
- uses: actions/upload-artifact@v3
- name: Test extension (outside docker)
if: ${{ matrix.duckdb_arch != 'linux_arm64' && inputs.skip_tests == false }}
env:
DUCKDB_GIT_VERSION: ${{ inputs.duckdb_version }}
LINUX_CI_IN_DOCKER: 0
run: |
make test_release
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}}
path: |
Expand Down Expand Up @@ -362,7 +344,7 @@ jobs:

- name: Install Ninja
run: |
brew install ninja autoconf make libtool pkg-config automake autoconf-archive
brew install ninja autoconf make libtool automake autoconf-archive
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
Expand Down Expand Up @@ -439,26 +421,25 @@ jobs:
echo "CPPFLAGS=-I/opt/homebrew/opt/libomp/include" >> $GITHUB_ENV
echo "CXXFLAGS=-I/opt/homebrew/opt/libomp/include" >> $GITHUB_ENV
- name: Run custom toolchain script
if: ${{ inputs.custom_toolchain_script }}
- name: Run configure
shell: bash
env:
DUCKDB_GIT_VERSION: ${{ inputs.duckdb_version }}
run: |
bash scripts/setup-custom-toolchain.sh
make configure_ci
- name: Build extension
shell: bash
env:
DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }}
run: |
make release
- name: Test Extension
if: ${{ matrix.osx_build_arch == 'arm64' && inputs.skip_tests == false }}
shell: bash
run: |
make test
make test_release
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}}
Expand Down Expand Up @@ -583,29 +564,31 @@ jobs:
vcpkgGitCommitId: ${{ inputs.vcpkg_commit }}
vcpkgGitURL: ${{ inputs.vcpkg_url }}

- name: Run custom toolchain script
if: ${{ inputs.custom_toolchain_script }}
- name: Run configure
shell: bash
env:
DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }}
DUCKDB_PLATFORM_RTOOLS: ${{ matrix.duckdb_arch == 'windows_amd64_rtools' && 1 || 0 }}
DUCKDB_GIT_VERSION: ${{ inputs.duckdb_version }}
run: |
bash scripts/setup-custom-toolchain.sh
make configure_ci
- name: Build extension
if: ${{ inputs.skip_tests == true }}
env:
DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }}
DUCKDB_PLATFORM_RTOOLS: ${{ matrix.duckdb_arch == 'windows_amd64_rtools' && 1 || 0 }}
run: |
make release
- name: Build & test extension
- name: Test extension
if: ${{ inputs.skip_tests == false }}
env:
DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }}
DUCKDB_PLATFORM_RTOOLS: ${{ matrix.duckdb_arch == 'windows_amd64_rtools' && 1 || 0 }}
run: |
make test_release
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}}
Expand Down Expand Up @@ -701,17 +684,18 @@ jobs:
with:
key: ${{ github.job }}-${{ matrix.duckdb_arch }}

- name: Run custom toolchain script
if: ${{ inputs.custom_toolchain_script }}
- name: Run configure
shell: bash
env:
DUCKDB_GIT_VERSION: ${{ inputs.duckdb_version }}
run: |
bash scripts/setup-custom-toolchain.sh
make configure_ci
- name: Build Wasm module
run: |
make ${{ matrix.duckdb_arch }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ DuckDB's [Extension Template](https://github.com/duckdb/extension-template/actio
| v0.10.0 | v0.10.0 | no |

Each branch in this repository targets a specific version of DuckDB. Note that these branches will be continually updated to ensure the build environment is functional for that version of DuckDB.
Also note that at some point, support for versions will be dropped. Currently, we aim to support the latest 2 DuckDB versions, to allow extensions devs to transition to a new DuckDB version.
Also note that at some point, support for versions will be dropped. Currently, we aim to support the latest 2 DuckDB versions, to allow extensions devs to transition to a new DuckDB version.
Loading

0 comments on commit 5121955

Please sign in to comment.