Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for windows #248

Merged
merged 18 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 20 additions & 1 deletion .github/workflows/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,23 @@ jobs:
name: freebsd_amd64
path: deps/freebsd_amd64/libduckdb.a
retention-days: 1
windows_amd64:
needs: prepare
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- shell: bash
run: make deps.windows.amd64
- uses: actions/upload-artifact@v4
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, freebsd_amd64]
needs: [darwin_amd64, darwin_arm64, linux_amd64, linux_arm64, freebsd_amd64, windows_amd64]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -118,6 +132,7 @@ jobs:
rm -f deps/linux_amd64/libduckdb.a
rm -f deps/linux_arm64/libduckdb.a
rm -f deps/freebsd_amd64/libduckdb.a
rm -f deps/windows_amd64/libduckdb.a
rm -f duckdb.h
- uses: actions/download-artifact@v4
with:
Expand All @@ -143,6 +158,10 @@ jobs:
with:
name: freebsd_amd64
path: deps/freebsd_amd64
- uses: actions/download-artifact@v4
with:
name: windows_amd64
path: deps/windows_amd64
- name: Push static libraries
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
shell: bash
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
go: ["1.23"]
fail-fast: false
steps:
Expand All @@ -23,6 +23,11 @@ jobs:
go-version: ${{ matrix.go }}
- name: "Run tests"
run: make test
- uses: actions/upload-artifact@v4
with:
name: test
path: go-duckdb.test.exe
retention-days: 1

test_examples:
name: Test examples
Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,23 @@ deps.freebsd.amd64: duckdb
cd duckdb && \
CFLAGS="-O3" CXXFLAGS="-O3" ${DUCKDB_COMMON_BUILD_FLAGS} gmake bundle-library -j 2
cp duckdb/build/release/libduckdb_bundle.a deps/freebsd_amd64/libduckdb.a

.PHONY: deps.windows.amd64
deps.windows.amd64: duckdb
if [ "$(shell uname -s | tr '[:upper:]' '[:lower:]')" != "mingw64_nt-10.0-20348" ]; then echo "Error: must run build on windows"; false; fi
mkdir -p deps/windows_amd64

# Copied from the DuckDB repository and fixed for Windows. Ideally, `make bundle-library` should also work for Windows.
cd duckdb && \
${DUCKDB_COMMON_BUILD_FLAGS} GENERATOR="-G \"MinGW Makefiles\"" gmake release -j 2
cd duckdb/build/release && \
mkdir -p bundle && \
cp src/libduckdb_static.a bundle/. && \
cp third_party/*/libduckdb_*.a bundle/. && \
cp extension/*/lib*_extension.a bundle/.
cd duckdb/build/release/bundle && \
find . -name '*.a' -exec ${AR} -x {} \;
cd duckdb/build/release/bundle && \
${AR} cr ../libduckdb_bundle.a *.obj

cp duckdb/build/release/libduckdb_bundle.a deps/windows_amd64/libduckdb.a
Loading
Loading