-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compile from source on Windows (#65)
* Let the cc crate use its default behaviour for -fPIC * Make sure we pass "/bigobj" when compiling with the MSVC compiler * Fix type error because DuckDB constants were inferred to be i32 on Windows * Use the "duckdb_state" typedef instead of assuming it'll always be c_uint * Make sure we define "DUCKDB_BUILD_LIBRARY" to set dllexport and friends * Windows doesn't allow concurrent writes to a file * Re-enable Windows builds * Update arrow requirement from 17 to 18 (#64) * Update arrow requirement from 17 to 18 Updates the requirements on [arrow](https://github.com/apache/arrow-rs) to permit the latest version. - [Release notes](https://github.com/apache/arrow-rs/releases) - [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG.md) - [Commits](apache/arrow-rs@17.0.0...18.0.0) --- updated-dependencies: - dependency-name: arrow dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * fix build error Change-Id: I252a9021ef57cbcb82e5122f30754415085718c8 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: wangfenjin <[email protected]> * use action to download and extract Change-Id: Ia2057bdf3dad686aa07b64f38cce20faa6d9a898 * fix filepath Change-Id: I91c5abcad6460051000dea430373cf64d7bc44bb * fix windows Change-Id: If0d2dad8c889f6df387550f96712681f63c16c9c * fix windows Change-Id: Ia43544c3683bc6418eddf4e971413d621d629a89 * static set windows Change-Id: I685ff5f761ff0e342bc9afeb053df48ec28f1ad2 * windows Change-Id: I91c9f7325de3de5767baf462d1ac681931c3ab95 * fix Change-Id: Ic8cc0833a7fad865b1c7b671518da043ffb02d57 * fix Change-Id: Ib9a4dc6af13fbe39eff78dd849614b3285690dfe * fix cargo test Change-Id: I3b3f5726507e4a9c94188994fe533ee335c4192e * use path Change-Id: I1bf94c209ad65637be945c5d0a81a640da798f57 * set path Change-Id: I86957007844bc9e20ed2829d04e731176ac5e3ae * Add windows build from source Change-Id: I3d45e79e61b49690a6a58756ccc8b7fb3abcc153 * fix test Change-Id: Ibffbe97225c5d807bb2eaf4b7f80e807b9634405 Co-authored-by: Michael-F-Bryan <[email protected]> Co-authored-by: Michael Bryan <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5c08014
commit 213b1a5
Showing
9 changed files
with
79 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,8 @@ jobs: | |
fail-fast: true | ||
matrix: | ||
include: | ||
#- { target: x86_64-pc-windows-msvc, os: windows-latest } | ||
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest } | ||
- { target: x86_64-pc-windows-msvc, os: windows-latest, duckdb: libduckdb-windows-amd64.zip } | ||
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, duckdb: libduckdb-linux-amd64.zip } | ||
#- { target: x86_64-apple-darwin, os: macos-latest } | ||
#- { | ||
#target: x86_64-pc-windows-gnu, | ||
|
@@ -33,34 +33,80 @@ jobs: | |
rust-version: stable${{ matrix.host }} | ||
targets: ${{ matrix.target }} | ||
components: 'rustfmt, clippy' | ||
# download libduckdb | ||
- uses: robinraju/[email protected] | ||
name: Download duckdb | ||
with: | ||
repository: "duckdb/duckdb" | ||
tag: "v0.4.0" | ||
fileName: ${{ matrix.duckdb }} | ||
out-file-path: . | ||
|
||
# For Linux | ||
- name: Linux extract duckdb | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: ihiroky/extract-action@v1 | ||
with: | ||
file_path: ${{ github.workspace }}/${{ matrix.duckdb }} | ||
extract_dir: libduckdb | ||
- run: cargo fmt --all -- --check | ||
- name: Download DuckDB | ||
run: | | ||
wget https://github.com/duckdb/duckdb/releases/download/v0.4.0/libduckdb-linux-amd64.zip -O libduckdb.zip | ||
unzip libduckdb.zip -d libduckdb | ||
# - run: cargo clippy --all-targets --workspace --features bundled --features modern-full -- -D warnings -A clippy::redundant-closure | ||
if: matrix.os == 'ubuntu-latest' | ||
- run: cargo clippy --all-targets --workspace --features buildtime_bindgen --features modern-full -- -D warnings -A clippy::redundant-closure | ||
if: matrix.os == 'ubuntu-latest' | ||
name: run cargo clippy | ||
env: | ||
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb | ||
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb | ||
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb | ||
- name: Run cargo-tarpaulin | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: actions-rs/[email protected] | ||
with: | ||
# Intentionally omit time feature until we're on time 0.3, at which | ||
# point it should be added to `bundled-full`. | ||
args: '--features "buildtime_bindgen" --features "modern-full" --avoid-cfg-tarpaulin' # TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320) | ||
# args: '--features "bundled" --features "modern-full" --avoid-cfg-tarpaulin' # TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320) | ||
env: | ||
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb | ||
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb | ||
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb | ||
- name: Upload to codecov.io | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: codecov/codecov-action@v1 | ||
|
||
sanitizer: | ||
# For windows | ||
- name: Windows extract duckdb | ||
if: matrix.os == 'windows-latest' | ||
uses: DuckSoft/[email protected] | ||
with: | ||
pathSource: D:\a\duckdb-rs\duckdb-rs\${{ matrix.duckdb }} | ||
pathTarget: ${{ github.workspace }}/libduckdb | ||
|
||
- name: Add path to PATH environment variable | ||
if: matrix.os == 'windows-latest' | ||
uses: myci-actions/export-env-var-powershell@1 | ||
with: | ||
name: PATH | ||
value: $env:PATH;${{ github.workspace }}/libduckdb | ||
- name: Run cargo-test | ||
if: matrix.os == 'windows-latest' | ||
run: cargo test --features "buildtime_bindgen" --features "modern-full" | ||
env: | ||
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb | ||
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb | ||
|
||
Windows: | ||
name: Windows build from source | ||
needs: test | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: stable | ||
targets: x86_64-pc-windows-msvc | ||
- run: cargo test --features "bundled" --features "modern-full" | ||
|
||
Sanitizer: | ||
name: Address Sanitizer | ||
needs: test | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters