fix(duckdb): statically link Windows worker runtime

Closes #5313
This commit is contained in:
t8y2
2026-08-04 15:08:04 +08:00
parent 947cc16d92
commit cd5c222f95
7 changed files with 289 additions and 4 deletions
+13 -3
View File
@@ -447,6 +447,10 @@ jobs:
with:
toolchain: nightly-2026-07-22
components: rust-src
- uses: actions/setup-python@v5
if: runner.os == 'Windows'
with:
python-version: "3.13"
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
with:
version: "v0.10.0"
@@ -460,14 +464,14 @@ jobs:
-e CARGO_INCREMENTAL=0 \
-e CARGO_TARGET_DIR=/workspace/target/duckdb-driver \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
-w /workspace/agents/drivers/duckdb \
"${{ matrix.manylinux_image }}" \
bash -lc '
mkdir -p "$HOME"
curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.97.1
source "$HOME/.cargo/env"
cargo build \
--manifest-path agents/drivers/duckdb/Cargo.toml \
--manifest-path Cargo.toml \
--locked \
--release \
--bin dbx-duckdb-driver \
@@ -478,18 +482,24 @@ jobs:
if [ "${{ matrix.win7 }}" = "true" ]; then
BUILD_STD=(-Z build-std=std,panic_abort)
fi
pushd agents/drivers/duckdb
cargo build \
--manifest-path agents/drivers/duckdb/Cargo.toml \
--manifest-path Cargo.toml \
--locked \
--release \
--bin dbx-duckdb-driver \
--target "${{ matrix.target }}" \
"${BUILD_STD[@]}"
popd
fi
mkdir -p release-native
cp \
"target/duckdb-driver/${{ matrix.target }}/release/dbx-duckdb-driver${{ matrix.extension }}" \
"release-native/dbx-agent-duckdb-${{ matrix.platform }}${{ matrix.extension }}"
if [ "${{ runner.os }}" = "Windows" ]; then
python agents/scripts/validate_windows_pe_dependencies.py \
"release-native/dbx-agent-duckdb-${{ matrix.platform }}${{ matrix.extension }}"
fi
if [ -n "${{ matrix.manylinux_image }}" ]; then
docker run --rm \
--user "$(id -u):$(id -g)" \
+51
View File
@@ -148,6 +148,51 @@ jobs:
}
Get-FileHash -LiteralPath $installer.FullName -Algorithm SHA256
duckdb-windows-driver:
needs: changes
if: needs.changes.outputs.duckdb_windows == 'true'
runs-on: windows-2022
timeout-minutes: 60
env:
CARGO_INCREMENTAL: "0"
CARGO_TARGET_DIR: ${{ github.workspace }}/target/duckdb-driver
RUSTC_WRAPPER: sccache
steps:
- uses: actions/checkout@v5
- name: Setup Rust for Windows 7
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2026-07-22
components: rust-src
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
with:
version: "v0.10.0"
- name: Build DuckDB Windows driver
shell: bash
run: |
pushd agents/drivers/duckdb
cargo build \
--locked \
--release \
--bin dbx-duckdb-driver \
--target x86_64-win7-windows-msvc \
-Z build-std=std,panic_abort
popd
- name: Validate DuckDB Windows driver
shell: bash
run: |
DRIVER="target/duckdb-driver/x86_64-win7-windows-msvc/release/dbx-duckdb-driver.exe"
python agents/scripts/validate_windows_pe_dependencies.py "$DRIVER"
"$DRIVER" < /dev/null
rust-fmt-clippy:
needs: changes
if: needs.changes.outputs.rust == 'true'
@@ -370,6 +415,7 @@ jobs:
rust_full: ${{ steps.rust-mode.outputs.full }}
jdbc: ${{ steps.filter.outputs.jdbc }}
agents: ${{ steps.filter.outputs.agents }}
duckdb_windows: ${{ steps.filter.outputs.duckdb_windows }}
nix: ${{ steps.filter.outputs.nix }}
windows_win7_bundle: ${{ steps.filter.outputs.windows_win7_bundle }}
github_scripts: ${{ steps.filter.outputs.github_scripts }}
@@ -421,6 +467,11 @@ jobs:
- '.github/scripts/bump-agent-versions.test.mjs'
- '.github/workflows/agents-release.yml'
- '.github/workflows/ci.yml'
duckdb_windows:
- 'agents/drivers/duckdb/**'
- 'agents/scripts/validate_windows_pe_dependencies.py'
- '.github/workflows/agents-release.yml'
- '.github/workflows/ci.yml'
nix:
# These advisory checks validate the pnpm and Cargo dependency closures.
- 'package.json'