Skip to content

Attempt fixing ubuntu #2

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

Closed
wants to merge 6 commits into from
Closed
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
225 changes: 128 additions & 97 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,113 +8,144 @@ on:
env:
RUST_BACKTRACE: 1
jobs:
test:
name: Test ${{ matrix.target }}
strategy:
fail-fast: true
matrix:
include:
- { 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,
#os: windows-latest,
#host: -x86_64-pc-windows-gnu,
#}
# test:
# name: Test ${{ matrix.target }}
# strategy:
# fail-fast: true
# matrix:
# include:
# - { 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,
# #os: windows-latest,
# #host: -x86_64-pc-windows-gnu,
# #}

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
# This has a matcher for test panics, so we use it even though elsewhere
# we use actions-rs/toolchain.
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable${{ matrix.host }}
targets: ${{ matrix.target }}
components: 'rustfmt, clippy'
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v2
# # This has a matcher for test panics, so we use it even though elsewhere
# # we use actions-rs/toolchain.
# - uses: hecrj/setup-rust-action@v1
# with:
# 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: "v1.2.0"
fileName: ${{ matrix.duckdb }}
out-file-path: .
# # download libduckdb
# - uses: robinraju/[email protected]
# name: Download duckdb
# with:
# repository: "duckdb/duckdb"
# tag: "v1.2.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
# # 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
if: matrix.os == 'ubuntu-latest'
# - run: cargo fmt --all -- --check
# if: matrix.os == 'ubuntu-latest'

- name: run cargo clippy
if: matrix.os == 'ubuntu-latest'
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
run: |
cargo clippy --all-targets --workspace --all-features -- -D warnings -A clippy::redundant-closure
# - name: run cargo clippy
# if: matrix.os == 'ubuntu-latest'
# env:
# DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
# DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
# LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
# run: |
# cargo clippy --all-targets --workspace --all-features -- -D warnings -A clippy::redundant-closure


# 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
# # 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: 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 "modern-full vtab-full vtab-loadable"
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
# - name: Run cargo-test
# if: matrix.os == 'windows-latest'
# run: cargo test --features "modern-full vtab-full vtab-loadable"
# env:
# DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
# DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb

- name: Build loadable extension
run: cargo build --example hello-ext --features="vtab-loadable"
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
# - name: Build loadable extension
# run: cargo build --example hello-ext --features="vtab-loadable"
# env:
# DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
# DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
# LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb

- name: Build loadable extension
run: cargo build --example hello-ext-capi --features="vtab-loadable loadable-extension"
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
# - name: Build loadable extension
# run: cargo build --example hello-ext-capi --features="vtab-loadable loadable-extension"
# env:
# DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
# DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
# LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb

Windows:
name: Windows build from source
needs: test
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: ~/.cargo/registry/index
key: index-${{ runner.os }}-${{ github.run_number }}
restore-keys: |
index-${{ runner.os }}-
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
targets: x86_64-pc-windows-msvc
# Windows:
# name: Windows build from source
# needs: test
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/cache@v3
# with:
# path: ~/.cargo/registry/index
# key: index-${{ runner.os }}-${{ github.run_number }}
# restore-keys: |
# index-${{ runner.os }}-
# - uses: hecrj/setup-rust-action@v1
# with:
# rust-version: stable
# targets: x86_64-pc-windows-msvc

- run: cargo install cargo-examples
# - run: cargo install cargo-examples

Sanitizer:
name: Address Sanitizer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Need nightly rust.
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
components: rust-src
- name: Tests with asan
env:
RUSTFLAGS: -Zsanitizer=address -C debuginfo=0
RUSTDOCFLAGS: -Zsanitizer=address
ASAN_OPTIONS: "detect_stack_use_after_return=1:detect_leaks=1"
# Work around https://github.com/rust-lang/rust/issues/59125 by
# disabling backtraces. In an ideal world we'd probably suppress the
# leak sanitization, but we don't care about backtraces here, so long
# as the other tests have them.
RUST_BACKTRACE: "0"
run: |
# TODO switch back to modern-full once polars is fixed
cargo -Z build-std test --features "chrono serde_json url r2d2 uuid extensions-full" --target x86_64-unknown-linux-gnu --package duckdb
- name: publish crates --dry-run
uses: katyo/publish-crates@v2
with:
path: './'
args: --allow-dirty --all-features
dry-run: true
ignore-unpublished-changes: true
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "crates/libduckdb-sys/duckdb-sources"]
path = crates/libduckdb-sys/duckdb-sources
url = https://github.com/duckdb/duckdb
url = https://github.com/Maxxen/duckdb.git
2 changes: 1 addition & 1 deletion crates/libduckdb-sys/duckdb-sources
Submodule duckdb-sources updated 272 files
Binary file modified crates/libduckdb-sys/duckdb.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/libduckdb-sys/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mkdir -p "$SCRIPT_DIR/../../target" "$SCRIPT_DIR/duckdb"
export DUCKDB_LIB_DIR="$SCRIPT_DIR/duckdb"

# Download and extract amalgamation
DUCKDB_VERSION=v1.2.0
DUCKDB_VERSION=v1.2.1
git submodule update --init --checkout
cd "$SCRIPT_DIR/duckdb-sources"
git fetch
Expand Down
Loading