From 8cfe12a50b5d9c819f342fce4863b77f8246b820 Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Fri, 17 May 2024 10:12:27 +0200 Subject: [PATCH 1/5] Bump duckdb further --- duckdb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duckdb b/duckdb index 148a1025..7ca1d378 160000 --- a/duckdb +++ b/duckdb @@ -1 +1 @@ -Subproject commit 148a1025d1d486d4c2751728bb6ac70e4f3bea61 +Subproject commit 7ca1d378437718e86d9f2788e5b165bac532e63c From 5ba84e59cbd59f654f42f9b4ee517ac026d4a452 Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Fri, 17 May 2024 10:16:20 +0200 Subject: [PATCH 2/5] Fix for wasm --- Makefile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 7425caef..a7dd80dc 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ all: release +DUCKDB_SRCDIR ?= "./duckdb/" + MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) PROJ_DIR := $(dir $(MKFILE_PATH)) @@ -53,6 +55,7 @@ EXTENSION_FLAGS=\ -DDUCKDB_EXTENSION_${EXTENSION_NAME}_LOAD_TESTS=1 \ -DDUCKDB_EXTENSION_${EXTENSION_NAME}_INCLUDE_PATH="$(PROJ_DIR)spatial/include" \ -DDUCKDB_EXTENSION_${EXTENSION_NAME}_TEST_PATH="$(PROJ_DIR)test" +-DDUCKDB_EXTENSION_${EXTENSION_NAME}_LINKED_LIBS="../../deps/local/lib/*.a" #### Add more of the DuckDB in-tree extensions here that you need (also feel free to remove them when not needed) EXTRA_EXTENSIONS_FLAG=-DBUILD_EXTENSIONS="parquet;json" @@ -153,27 +156,26 @@ clean: #cd duckdb && make clean #cd duckdb && make clean-python +# WASM config VCPKG_EMSDK_FLAGS=-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$(EMSDK)/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -WASM_COMPILE_TIME_COMMON_FLAGS=-DWASM_LOADABLE_EXTENSIONS=1 -DBUILD_EXTENSIONS_ONLY=1 -DSKIP_EXTENSIONS="parquet;json" $(VCPKG_EMSDK_FLAGS) -DDUCKDB_EXPLICIT_PLATFORM='${DUCKDB_PLATFORM}' +WASM_COMPILE_TIME_COMMON_FLAGS=-DWASM_LOADABLE_EXTENSIONS=1 -DBUILD_EXTENSIONS_ONLY=1 -DSKIP_EXTENSIONS="parquet;json" $(TOOLCHAIN_FLAGS) $(VCPKG_EMSDK_FLAGS) WASM_CXX_MVP_FLAGS= WASM_CXX_EH_FLAGS=$(WASM_CXX_MVP_FLAGS) -fwasm-exceptions -DWEBDB_FAST_EXCEPTIONS=1 -WASM_CXX_THREADS_FLAGS=$(WASM_COMPILE_TIME_EH_FLAGS) -DWITH_WASM_THREADS=1 -DWITH_WASM_SIMD=1 -DWITH_WASM_BULK_MEMORY=1 -DUSE_PTHREADS=1 -pthread -WASM_LINK_TIME_FLAGS=-O3 -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="_${EXT_NAME}_version,_${EXT_NAME}_init" ../../deps/local/lib/*.a +WASM_CXX_THREADS_FLAGS=$(WASM_COMPILE_TIME_EH_FLAGS) -DWITH_WASM_THREADS=1 -DWITH_WASM_SIMD=1 -DWITH_WASM_BULK_MEMORY=1 -pthread +WASM_LINK_TIME_FLAGS=-O3 -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="_${EXT_NAME}_version,_${EXT_NAME}_init" +# WASM targets wasm_mvp: mkdir -p build/wasm_mvp - emcmake cmake $(GENERATOR) $(EXTENSION_FLAGS) $(WASM_COMPILE_TIME_COMMON_FLAGS) -Bbuild/wasm_mvp -DCMAKE_CXX_FLAGS="$(WASM_CXX_MVP_FLAGS) -DDUCKDB_CUSTOM_PLATFORM=wasm_mvp" -S duckdb + emcmake cmake $(GENERATOR) $(EXTENSION_FLAGS) $(WASM_COMPILE_TIME_COMMON_FLAGS) -Bbuild/wasm_mvp -DCMAKE_CXX_FLAGS="$(WASM_CXX_MVP_FLAGS)" -S $(DUCKDB_SRCDIR) -DDUCKDB_EXPLICIT_PLATFORM=wasm_mvp -DDUCKDB_CUSTOM_PLATFORM=wasm_mvp emmake make -j8 -Cbuild/wasm_mvp - cd build/wasm_mvp/extension/${EXT_NAME} && emcc $f -o ../../${EXT_NAME}.duckdb_extension.wasm ${EXT_NAME}.duckdb_extension.wasm.lib $(WASM_LINK_TIME_FLAGS) wasm_eh: mkdir -p build/wasm_eh - emcmake cmake $(GENERATOR) $(EXTENSION_FLAGS) $(WASM_COMPILE_TIME_COMMON_FLAGS) -Bbuild/wasm_eh -DCMAKE_CXX_FLAGS="$(WASM_CXX_EH_FLAGS) -DDUCKDB_CUSTOM_PLATFORM=wasm_eh" -S duckdb + emcmake cmake $(GENERATOR) $(EXTENSION_FLAGS) $(WASM_COMPILE_TIME_COMMON_FLAGS) -Bbuild/wasm_eh -DCMAKE_CXX_FLAGS="$(WASM_CXX_EH_FLAGS)" -S $(DUCKDB_SRCDIR) -DDUCKDB_EXPLICIT_PLATFORM=wasm_eh -DDUCKDB_CUSTOM_PLATFORM=wasm_eh emmake make -j8 -Cbuild/wasm_eh - cd build/wasm_eh/extension/${EXT_NAME} && emcc $f -o ../../${EXT_NAME}.duckdb_extension.wasm ${EXT_NAME}.duckdb_extension.wasm.lib $(WASM_LINK_TIME_FLAGS) wasm_threads: mkdir -p ./build/wasm_threads - emcmake cmake $(GENERATOR) $(EXTENSION_FLAGS) $(WASM_COMPILE_TIME_COMMON_FLAGS) -Bbuild/wasm_threads -DCMAKE_CXX_FLAGS="$(WASM_CXX_THREADS_FLAGS) -DDUCKDB_CUSTOM_PLATFORM=wasm_threads" -DCMAKE_C_FLAGS="-pthread" -S duckdb + emcmake cmake $(GENERATOR) $(EXTENSION_FLAGS) $(WASM_COMPILE_TIME_COMMON_FLAGS) -Bbuild/wasm_threads -DCMAKE_CXX_FLAGS="$(WASM_CXX_THREADS_FLAGS)" -S $(DUCKDB_SRCDIR) -DDUCKDB_EXPLICIT_PLATFORM=wasm_threads -DDUCKDB_CUSTOM_PLATFORM=wasm_threads emmake make -j8 -Cbuild/wasm_threads - cd build/wasm_threads/extension/${EXT_NAME} && emcc $f -o ../../${EXT_NAME}.duckdb_extension.wasm ${EXT_NAME}.duckdb_extension.wasm.lib $(WASM_LINK_TIME_FLAGS) -sSHARED_MEMORY=1 -pthread From 4d0564894b3ffb7d82f761bee91a715f528eccab Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Fri, 17 May 2024 11:01:43 +0200 Subject: [PATCH 3/5] No vcpkg --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a7dd80dc..e0424224 100644 --- a/Makefile +++ b/Makefile @@ -158,7 +158,7 @@ clean: # WASM config VCPKG_EMSDK_FLAGS=-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$(EMSDK)/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -WASM_COMPILE_TIME_COMMON_FLAGS=-DWASM_LOADABLE_EXTENSIONS=1 -DBUILD_EXTENSIONS_ONLY=1 -DSKIP_EXTENSIONS="parquet;json" $(TOOLCHAIN_FLAGS) $(VCPKG_EMSDK_FLAGS) +WASM_COMPILE_TIME_COMMON_FLAGS=-DWASM_LOADABLE_EXTENSIONS=1 -DBUILD_EXTENSIONS_ONLY=1 -DSKIP_EXTENSIONS="parquet;json" $(VCPKG_EMSDK_FLAGS) WASM_CXX_MVP_FLAGS= WASM_CXX_EH_FLAGS=$(WASM_CXX_MVP_FLAGS) -fwasm-exceptions -DWEBDB_FAST_EXCEPTIONS=1 WASM_CXX_THREADS_FLAGS=$(WASM_COMPILE_TIME_EH_FLAGS) -DWITH_WASM_THREADS=1 -DWITH_WASM_SIMD=1 -DWITH_WASM_BULK_MEMORY=1 -pthread From 4b1f4f5df0a04b084026f879edd8628b3d938bec Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Fri, 17 May 2024 11:29:37 +0200 Subject: [PATCH 4/5] Apply also z_optimizer.patch --- duckdb | 2 +- spatial/src/spatial/core/optimizer_rules.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/duckdb b/duckdb index 7ca1d378..197b79bf 160000 --- a/duckdb +++ b/duckdb @@ -1 +1 @@ -Subproject commit 7ca1d378437718e86d9f2788e5b165bac532e63c +Subproject commit 197b79bfafe6519b0704209c2a3b2eea6b632baf diff --git a/spatial/src/spatial/core/optimizer_rules.cpp b/spatial/src/spatial/core/optimizer_rules.cpp index 0f2f7e58..21472b84 100644 --- a/spatial/src/spatial/core/optimizer_rules.cpp +++ b/spatial/src/spatial/core/optimizer_rules.cpp @@ -267,13 +267,13 @@ class RangeJoinSpatialPredicateRewriter : public OptimizerExtension { } } - static void Optimize(ClientContext &context, OptimizerExtensionInfo *info, unique_ptr &plan) { + static void Optimize(OptimizerExtensionInput &input, unique_ptr &plan) { - TryOptimize(context, info, plan); + TryOptimize(input.context, input.info.get(), plan); // Recursively optimize the children for (auto &child : plan->children) { - Optimize(context, info, child); + Optimize(input, child); } } }; From e96976413531866db5b98ac4a92dab53ea24820d Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Fri, 17 May 2024 16:24:47 +0200 Subject: [PATCH 5/5] Use own _extension_distribution.yml --- .../workflows/MainDistributionPipeline.yml | 2 +- .github/workflows/_extension_distribution.yml | 381 ++++++++++++++++++ 2 files changed, 382 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/_extension_distribution.yml diff --git a/.github/workflows/MainDistributionPipeline.yml b/.github/workflows/MainDistributionPipeline.yml index aaa76bc6..43eb3ff9 100644 --- a/.github/workflows/MainDistributionPipeline.yml +++ b/.github/workflows/MainDistributionPipeline.yml @@ -24,7 +24,7 @@ concurrency: jobs: duckdb-stable-build: name: Build extension binaries - uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main + uses: ./.github/workflows/_extension_distribution.yml with: duckdb_version: main extension_name: spatial diff --git a/.github/workflows/_extension_distribution.yml b/.github/workflows/_extension_distribution.yml new file mode 100644 index 00000000..8bcf9ac3 --- /dev/null +++ b/.github/workflows/_extension_distribution.yml @@ -0,0 +1,381 @@ +# Reusable workflow for building DuckDB extensions using a standardized environment +# +# The workflow: +# - builds the extension using the CI workflow from the corresponding DuckDB version +# - uploads the extensions as gh actions artifacts in the following format: +# --extension- +# +# note: extensions are simply uploaded to GitHub actions, deploying the extensions is done a separate step. More info on +# this can be found in https://github.com/duckdb/extension-template + +name: Extension distribution +on: + workflow_call: + inputs: + # The name with which the extension will be built + extension_name: + required: true + type: string + # DuckDB version to build against, should in most cases be identical to + duckdb_version: + required: true + type: string + # ';' separated list of architectures to exclude, for example: 'linux_amd64;osx_arm64' + exclude_archs: + required: false + type: string + default: "" + # Postfix added to artifact names. Can be used to guarantee unique names when this workflow is called multiple times + artifact_postfix: + required: false + type: string + default: "" + # Override the default vcpkg commit used by this version of DuckDB + vcpkg_commit: + required: false + type: string + default: "a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6" + # Override the default script producing the matrices. Allows specifying custom matrices. + matrix_parse_script: + required: false + type: string + default: "./duckdb/scripts/modify_distribution_matrix.py" + # Enable building the DuckDB Shell + build_duckdb_shell: + required: false + type: boolean + default: true + +jobs: + generate_matrix: + name: Generate matrix + runs-on: ubuntu-latest + outputs: + linux_matrix: ${{ steps.set-matrix-linux.outputs.linux_matrix }} + windows_matrix: ${{ steps.set-matrix-windows.outputs.windows_matrix }} + osx_matrix: ${{ steps.set-matrix-osx.outputs.osx_matrix }} + wasm_matrix: ${{ steps.set-matrix-wasm.outputs.wasm_matrix }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: 'true' + + - name: Checkout DuckDB to version + run: | + cd duckdb + git checkout ${{ inputs.duckdb_version }} + + - id: parse-matrices + run: | + python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --select_os linux --output linux_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty + python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --select_os osx --output osx_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty + python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --select_os windows --output windows_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty + python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --select_os wasm --output wasm_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty + + - id: set-matrix-linux + run: | + linux_matrix="`cat linux_matrix.json`" + echo linux_matrix=$linux_matrix >> $GITHUB_OUTPUT + echo `cat $GITHUB_OUTPUT` + + - id: set-matrix-osx + run: | + osx_matrix="`cat osx_matrix.json`" + echo osx_matrix=$osx_matrix >> $GITHUB_OUTPUT + echo `cat $GITHUB_OUTPUT` + + - id: set-matrix-windows + run: | + windows_matrix="`cat windows_matrix.json`" + echo windows_matrix=$windows_matrix >> $GITHUB_OUTPUT + echo `cat $GITHUB_OUTPUT` + + - id: set-matrix-wasm + run: | + wasm_matrix="`cat wasm_matrix.json`" + echo wasm_matrix=$wasm_matrix >> $GITHUB_OUTPUT + echo `cat $GITHUB_OUTPUT` + + linux: + name: Linux + runs-on: ubuntu-latest + container: ${{ matrix.container }} + needs: generate_matrix + if: ${{ needs.generate_matrix.outputs.linux_matrix != '{}' && needs.generate_matrix.outputs.linux_matrix != '' }} + strategy: + matrix: ${{fromJson(needs.generate_matrix.outputs.linux_matrix)}} + env: + VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_triplet }} + VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + GEN: Ninja + BUILD_SHELL: ${{ inputs.build_duckdb_shell && '1' || '0' }} + DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} + + steps: + - name: Install required ubuntu packages + if: ${{ matrix.duckdb_arch == 'linux_amd64' || matrix.duckdb_arch == 'linux_arm64' }} + run: | + apt-get update -y -qq + apt-get install -y -qq software-properties-common + add-apt-repository ppa:git-core/ppa + apt-get update -y -qq + apt-get install -y -qq ninja-build make gcc-multilib g++-multilib libssl-dev wget openjdk-8-jdk zip maven unixodbc-dev libc6-dev-i386 lib32readline6-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip build-essential checkinstall libffi-dev curl libz-dev openssh-client + + - name: Install Git 2.18.5 + if: ${{ matrix.duckdb_arch == 'linux_amd64' || matrix.duckdb_arch == 'linux_arm64' }} + run: | + wget https://github.com/git/git/archive/refs/tags/v2.18.5.tar.gz + tar xvf v2.18.5.tar.gz + cd git-2.18.5 + make + make prefix=/usr install + git --version + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: 'true' + + - name: Checkout DuckDB to version + run: | + cd duckdb + git checkout ${{ inputs.duckdb_version }} + + - name: Setup ManyLinux2014 + if: ${{ matrix.duckdb_arch == 'linux_amd64_gcc4' }} + run: | + ./duckdb/scripts/setup_manylinux2014.sh general aws-cli ccache ssh python_alias openssl + + - name: Setup Ccache + uses: hendrikmuhs/ccache-action@v1.2.11 # Note: pinned due to GLIBC incompatibility in later releases + continue-on-error: true + with: + key: ${{ github.job }}-${{ matrix.duckdb_arch }} + + - name: Setup Ubuntu + if: ${{ matrix.duckdb_arch == 'linux_amd64' || matrix.duckdb_arch == 'linux_arm64' }} + uses: ./duckdb/.github/actions/ubuntu_18_setup + with: + aarch64_cross_compile: ${{ matrix.duckdb_arch == 'linux_arm64' && 1 }} + + - name: Setup vcpkg + uses: lukka/run-vcpkg@v11.1 + with: + vcpkgGitCommitId: ${{ inputs.vcpkg_commit }} + + - name: Build extension + env: + GEN: ninja + CC: ${{ matrix.duckdb_arch == 'linux_arm64' && 'aarch64-linux-gnu-gcc' || '' }} + CXX: ${{ matrix.duckdb_arch == 'linux_arm64' && 'aarch64-linux-gnu-g++' || '' }} + DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} + run: | + make release + + - name: Test extension + if: ${{ matrix.duckdb_arch != 'linux_arm64'}} + run: | + make test + + - uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}} + path: | + build/release/extension/${{ inputs.extension_name }}/${{ inputs.extension_name }}.duckdb_extension + + macos: + name: MacOS + runs-on: macos-latest + needs: generate_matrix + if: ${{ needs.generate_matrix.outputs.osx_matrix != '{}' && needs.generate_matrix.outputs.osx_matrix != '' }} + strategy: + matrix: ${{fromJson(needs.generate_matrix.outputs.osx_matrix)}} + env: + VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_triplet }} + OSX_BUILD_ARCH: ${{ matrix.osx_build_arch }} + GEN: Ninja + BUILD_SHELL: ${{ inputs.build_duckdb_shell && '1' || '0' }} + DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: 'true' + + - name: Install Ninja + run: | + brew install ninja + + - name: Setup Ccache + uses: hendrikmuhs/ccache-action@main + continue-on-error: true + with: + key: ${{ github.job }}-${{ matrix.duckdb_arch }} + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Checkout DuckDB to version + run: | + cd duckdb + git checkout ${{ inputs.duckdb_version }} + + - name: Setup vcpkg + uses: lukka/run-vcpkg@v11.1 + with: + vcpkgGitCommitId: ${{ inputs.vcpkg_commit }} + + - name: Build extension + shell: bash + env: + DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} + run: | + make release + + - name: Test Extension + if: ${{ matrix.osx_build_arch == 'x86_64'}} + shell: bash + run: | + make test + + - uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}} + path: | + build/release/extension/${{ inputs.extension_name }}/${{ inputs.extension_name }}.duckdb_extension + + windows: + name: Windows + runs-on: windows-latest + needs: generate_matrix + if: ${{ needs.generate_matrix.outputs.windows_matrix != '{}' && needs.generate_matrix.outputs.windows_matrix != '' }} + strategy: + matrix: ${{fromJson(needs.generate_matrix.outputs.windows_matrix)}} + env: + GEN: Ninja + VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_triplet }} + BUILD_SHELL: ${{ inputs.build_duckdb_shell && '1' || '0' }} + DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} + CC: ${{ matrix.duckdb_arch == 'windows_amd64_rtools' && 'gcc' || '' }} + CXX: ${{ matrix.duckdb_arch == 'windows_amd64_rtools' && 'g++' || '' }} + + steps: + - name: Keep \n line endings + shell: bash + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: 'true' + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - uses: r-lib/actions/setup-r@v2 + if: matrix.duckdb_arch == 'windows_amd64_rtools' + with: + r-version: 'devel' + update-rtools: true + rtools-version: '42' # linker bug in 43 + + - name: Checkout DuckDB to version + run: | + cd duckdb + git checkout ${{ inputs.duckdb_version }} + + - name: Setup Ccache + uses: hendrikmuhs/ccache-action@main + continue-on-error: true + with: + key: ${{ github.job }}-${{ matrix.duckdb_arch }} + + - name: Setup vcpkg + uses: lukka/run-vcpkg@v11.1 + with: + vcpkgGitCommitId: ${{ inputs.vcpkg_commit }} + + - name: Fix for MSVC issue + shell: bash + env: + OVERLAY_TRIPLET_SRC: ${{ github.workspace }}/vcpkg/triplets/community/x64-windows-static-md.cmake + OVERLAY_TRIPLET_DST: ${{ github.workspace }}/overlay_triplets/x64-windows-static-md.cmake + run: | + mkdir overlay_triplets + cp $OVERLAY_TRIPLET_SRC $OVERLAY_TRIPLET_DST + echo "set(VCPKG_PLATFORM_TOOLSET_VERSION "14.39")" >> $OVERLAY_TRIPLET_DST + + - name: Build & test extension + env: + VCPKG_OVERLAY_TRIPLETS: "${{ github.workspace }}/overlay_triplets" + 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 + with: + if-no-files-found: error + name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}} + path: | + build/release/extension/${{ inputs.extension_name }}/${{ inputs.extension_name }}.duckdb_extension + + wasm: + name: DuckDB-Wasm + runs-on: ubuntu-latest + needs: generate_matrix + if: ${{ needs.generate_matrix.outputs.wasm_matrix != '{}' && needs.generate_matrix.outputs.wasm_matrix != '' }} + strategy: + matrix: ${{fromJson(needs.generate_matrix.outputs.wasm_matrix)}} + env: + VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_triplet }} + VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + GEN: Ninja + DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: 'true' + + - name: Checkout DuckDB to version + run: | + cd duckdb + git checkout ${{ inputs.duckdb_version }} + + - uses: mymindstorm/setup-emsdk@v13 + with: + version: 'latest' + + - name: Setup vcpkg + uses: lukka/run-vcpkg@v11.1 + with: + vcpkgGitCommitId: ${{ inputs.vcpkg_commit }} + + - name: Setup Ccache + uses: hendrikmuhs/ccache-action@main + continue-on-error: true + with: + key: ${{ github.job }}-${{ matrix.duckdb_arch }} + + - name: Build Wasm module + run: | + make ${{ matrix.duckdb_arch }} + + - uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}} + path: | + build/${{ matrix.duckdb_arch }}/extension/${{ inputs.extension_name }}/${{ inputs.extension_name }}.duckdb_extension.wasm