From c9f516cb04d2cd21e1ad1f72b83a67497f4255a3 Mon Sep 17 00:00:00 2001 From: Marc Boeker Date: Sat, 23 Dec 2023 10:20:18 +0100 Subject: [PATCH] Add Windows amd64 support --- .github/workflows/deps.yaml | 21 ++++++++++++++++++++- Makefile | 35 +++++++++++++++++++++++++++++++++++ deps/windows_amd64/vendor.go | 3 +++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 deps/windows_amd64/vendor.go diff --git a/.github/workflows/deps.yaml b/.github/workflows/deps.yaml index c3f1be49..8f04897e 100644 --- a/.github/workflows/deps.yaml +++ b/.github/workflows/deps.yaml @@ -83,9 +83,23 @@ jobs: name: linux_arm64 path: deps/linux_arm64/libduckdb.a retention-days: 1 + windows_amd64: + needs: prepare + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + - shell: bash + run: make deps.windows.amd64 + - uses: actions/upload-artifact@v3 + with: + name: windows_amd64 + path: deps/windows_amd64/libduckdb.a + retention-days: 1 commit: runs-on: ubuntu-latest - needs: [darwin_amd64, darwin_arm64, linux_amd64, linux_arm64] + needs: [darwin_amd64, darwin_arm64, linux_amd64, linux_arm64, windows_amd64] steps: - uses: actions/checkout@v3 with: @@ -96,6 +110,7 @@ jobs: rm -f deps/darwin_arm64/libduckdb.a rm -f deps/linux_amd64/libduckdb.a rm -f deps/linux_arm64/libduckdb.a + rm -f deps/windows_amd64/libduckdb.a rm -f duckdb.h - uses: actions/download-artifact@v3 with: @@ -117,6 +132,10 @@ jobs: with: name: linux_arm64 path: deps/linux_arm64 + - uses: actions/download-artifact@v3 + with: + name: windows_amd64 + path: deps/windows_amd64 - name: Push static libraries uses: stefanzweifel/git-auto-commit-action@v4 with: diff --git a/Makefile b/Makefile index 69fd8db9..7c297794 100644 --- a/Makefile +++ b/Makefile @@ -76,3 +76,38 @@ deps.linux.arm64: ar rvs ../libduckdb.a *.o && \ cd .. && \ mv libduckdb.a ../deps/linux_arm64/libduckdb.a + +.PHONY: deps.windows.amd64 +deps.windows.amd64: + if [ "$(shell uname -s | tr '[:upper:]' '[:lower:]')" != "windows" ]; then echo "Error: must run build on Windows"; false; fi + + git clone -b v${DUCKDB_VERSION} --depth 1 https://github.com/duckdb/duckdb.git + cd duckdb && \ + mkdir -p build && \ + cmake -G "MinGW Makefiles" \ + -DENABLE_EXTENSION_AUTOLOADING=1 \ + -DENABLE_EXTENSION_AUTOINSTALL=1 \ + -DBUILD_EXTENSIONS=parquet \ + -DDUCKDB_EXTENSION_CONFIGS="./.github/config/bundled_extensions.cmake" \ + -DBUILD_SHELL=0 \ + -DBUILD_BENCHMARK=0 \ + -DBUILD_JDBC=0 \ + -DBUILD_TPCH=0 \ + -DBUILD_TPCDS=0 \ + -DBUILD_ODBC=0 \ + -DBUILD_PYTHON=0 \ + -DDISABLE_UNITY=1 \ + -DBUILD_AUTOCOMPLETE=1 \ + -DBUILD_HTTPFS=1 \ + -DBUILD_JSON=1 \ + -DBUILD_INET=1 \ + -DBUILD_FTS=1 \ + -DCMAKE_BUILD_TYPE=Release -B build && \ + cd build && \ + MAKEFLAGS=-j2 cmake --build . --config Release && \ + cd .. && \ + mkdir -p lib && \ + find ./build -name '*.obj' | xargs cp {} -t ./lib && \ + cd lib && \ + gcc-ar rvs libduckdb.a *.obj + mv libduckdb.a ../../deps/windows_amd64/libduckdb.a diff --git a/deps/windows_amd64/vendor.go b/deps/windows_amd64/vendor.go new file mode 100644 index 00000000..bbf9e273 --- /dev/null +++ b/deps/windows_amd64/vendor.go @@ -0,0 +1,3 @@ +// Package windows_amd64 is required to provide support for vendoring modules +// DO NOT REMOVE +package windows_amd64