Skip to content

Commit a161902

Browse files
authored
Merge branch 'main' into enable-union-test
2 parents caa2842 + efeec66 commit a161902

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+12526
-12136
lines changed

.cargo/config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[target.'cfg(all())']
2+
rustflags = [
3+
"-Dclippy::all",
4+
"-Dnonstandard-style",
5+
"-Drust-2018-idioms",
6+
]

.github/.codecov.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CD
22

33
on:
44
push:
5-
tags: [ '*' ]
5+
tags: ["*"]
66
env:
77
RUST_BACKTRACE: 1
88
jobs:
@@ -11,19 +11,13 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14-
# This has a matcher for test panics, so we use it even though elsewhere
15-
# we use actions-rs/toolchain.
16-
- uses: hecrj/setup-rust-action@v1
17-
with:
18-
rust-version: stable${{ matrix.host }}
19-
targets: ${{ matrix.target }}
20-
components: 'rustfmt, clippy'
14+
- uses: actions-rust-lang/setup-rust-toolchain@v1
2115

2216
# cargo publish
2317
- name: publish crates
2418
uses: katyo/publish-crates@v2
2519
with:
26-
path: './'
20+
path: "./"
2721
args: --no-verify --allow-dirty --all-features
2822
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
2923
ignore-unpublished-changes: true

.github/workflows/rust.yaml

Lines changed: 35 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88
env:
99
RUST_BACKTRACE: 1
1010
jobs:
@@ -14,32 +14,29 @@ jobs:
1414
fail-fast: true
1515
matrix:
1616
include:
17-
- { target: x86_64-pc-windows-msvc, os: windows-latest, duckdb: libduckdb-windows-amd64.zip }
18-
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, duckdb: libduckdb-linux-amd64.zip }
19-
#- { target: x86_64-apple-darwin, os: macos-latest }
20-
#- {
21-
#target: x86_64-pc-windows-gnu,
22-
#os: windows-latest,
23-
#host: -x86_64-pc-windows-gnu,
24-
#}
25-
17+
- {
18+
target: x86_64-pc-windows-msvc,
19+
os: windows-latest,
20+
duckdb: libduckdb-windows-amd64.zip,
21+
}
22+
- {
23+
target: x86_64-unknown-linux-gnu,
24+
os: ubuntu-latest,
25+
duckdb: libduckdb-linux-amd64.zip,
26+
}
2627
runs-on: ${{ matrix.os }}
2728
steps:
2829
- uses: actions/checkout@v2
29-
# This has a matcher for test panics, so we use it even though elsewhere
30-
# we use actions-rs/toolchain.
31-
- uses: hecrj/setup-rust-action@v1
30+
- uses: actions-rust-lang/setup-rust-toolchain@v1
3231
with:
33-
rust-version: stable${{ matrix.host }}
34-
targets: ${{ matrix.target }}
35-
components: 'rustfmt, clippy'
32+
target: ${{ matrix.target }}
3633

3734
# download libduckdb
3835
- uses: robinraju/[email protected]
3936
name: Download duckdb
4037
with:
4138
repository: "duckdb/duckdb"
42-
tag: "v1.1.1"
39+
tag: "v1.3.1"
4340
fileName: ${{ matrix.duckdb }}
4441
out-file-path: .
4542

@@ -54,37 +51,22 @@ jobs:
5451
- run: cargo fmt --all -- --check
5552
if: matrix.os == 'ubuntu-latest'
5653

57-
# TODO: remove
58-
- name: Workaround for https://github.com/pola-rs/polars/issues/19063
59-
run: |
60-
cargo update [email protected] --precise 2.5.0
61-
6254
- name: run cargo clippy
6355
if: matrix.os == 'ubuntu-latest'
6456
env:
6557
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
6658
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
6759
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
68-
run: |
69-
cargo clippy --all-targets --workspace --all-features -- -D warnings -A clippy::redundant-closure
70-
60+
run: cargo clippy --all-targets --all-features --locked -- -D warnings
7161

72-
- name: Run cargo-tarpaulin
62+
- name: Dry-run release of crates
7363
if: matrix.os == 'ubuntu-latest'
74-
uses: actions-rs/[email protected]
64+
uses: katyo/publish-crates@v2
7565
with:
76-
# Intentionally omit time feature until we're on time 0.3, at which
77-
# point it should be added to `bundled-full`.
78-
args: '--features "buildtime_bindgen modern-full vtab-full vtab-loadable" --avoid-cfg-tarpaulin' # TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320)
79-
version: 0.22.0
80-
env:
81-
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
82-
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
83-
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
84-
85-
- name: Upload to codecov.io
86-
if: matrix.os == 'ubuntu-latest'
87-
uses: codecov/codecov-action@v1
66+
path: "./"
67+
args: --allow-dirty --all-features
68+
dry-run: true
69+
ignore-unpublished-changes: true
8870

8971
# For windows
9072
- name: Windows extract duckdb
@@ -122,53 +104,28 @@ jobs:
122104
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
123105
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
124106

125-
Windows:
126-
name: Windows build from source
127-
needs: test
128-
runs-on: windows-latest
129-
steps:
130-
- uses: actions/checkout@v2
131-
- uses: actions/cache@v3
132-
with:
133-
path: ~/.cargo/registry/index
134-
key: index-${{ runner.os }}-${{ github.run_number }}
135-
restore-keys: |
136-
index-${{ runner.os }}-
137-
- uses: hecrj/setup-rust-action@v1
138-
with:
139-
rust-version: stable
140-
targets: x86_64-pc-windows-msvc
141-
142-
- run: cargo install cargo-examples
143-
144107
Sanitizer:
145108
name: Address Sanitizer
146-
needs: test
147109
runs-on: ubuntu-latest
148110
steps:
149111
- uses: actions/checkout@v2
150112
# Need nightly rust.
151-
- uses: hecrj/setup-rust-action@v1
113+
- uses: actions-rust-lang/setup-rust-toolchain@v1
152114
with:
153-
rust-version: nightly
154-
components: rust-src
115+
toolchain: nightly
116+
components: "rust-src"
117+
# Install LLVM tools
118+
- name: Install LLVM
119+
run: |
120+
sudo apt-get install -y llvm
155121
- name: Tests with asan
156122
env:
157123
RUSTFLAGS: -Zsanitizer=address -C debuginfo=0
158124
RUSTDOCFLAGS: -Zsanitizer=address
159-
ASAN_OPTIONS: "detect_stack_use_after_return=1:detect_leaks=1"
160-
# Work around https://github.com/rust-lang/rust/issues/59125 by
161-
# disabling backtraces. In an ideal world we'd probably suppress the
162-
# leak sanitization, but we don't care about backtraces here, so long
163-
# as the other tests have them.
164-
RUST_BACKTRACE: "0"
125+
ASAN_OPTIONS: "detect_stack_use_after_return=1:detect_leaks=1:symbolize=1"
126+
# We cannot run "modern-full" with asan as the chrono feature will auto-load relase binaries of
127+
# the ICU-extension, which are not built with ASAN and will cause a crash.
165128
run: |
166-
# TODO switch back to modern-full once polars is fixed
167-
cargo -Z build-std test --features "chrono serde_json url r2d2 uuid extensions-full" --target x86_64-unknown-linux-gnu --package duckdb
168-
- name: publish crates --dry-run
169-
uses: katyo/publish-crates@v2
170-
with:
171-
path: './'
172-
args: --allow-dirty --all-features
173-
dry-run: true
174-
ignore-unpublished-changes: true
129+
export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer)
130+
echo $ASAN_SYMBOLIZER_PATH
131+
cargo -Z build-std test --features "serde_json url r2d2 uuid polars extensions-full" --target x86_64-unknown-linux-gnu --package duckdb

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22
# will have compiled files and executables
33
/target/
44

5-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
6-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
7-
Cargo.lock
8-
95
# These are backup files generated by rustfmt
106
**/*.rs.bk
117

12-
138
# Added by cargo
149

1510
/target

.rustfmt.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Most user should use `duckdb`, but our development may happen in both of these c
99
## Development
1010

1111
### duckdb-c-api
12-
Some features are still not implemented in the c api, so we may need pull request in the [duckdb repo]((https://github.com/duckdb/duckdb).
12+
Some features are still not implemented in the c api, so we may need pull request in the [duckdb repo](https://github.com/duckdb/duckdb).
1313

1414
```shell
1515
# build duckdb
@@ -53,7 +53,7 @@ cd ~/github/duckdb-rs/crates/libduckdb-sys
5353
cargo test --features bundled
5454
```
5555

56-
Currently in [github actions](https://github.com/wangfenjin/duckdb-rs/actions), we always use the bundled file for testing. So if you change the header in duckdb-cpp repo, you need to make the PR merged and updated the [bundled-file](https://github.com/wangfenjin/duckdb-rs/tree/main/crates/libduckdb-sys/duckdb).
56+
Currently in [github actions](https://github.com/duckdb/duckdb-rs/actions), we always use the bundled file for testing. So if you change the header in duckdb-cpp repo, you need to make the PR merged and updated the [bundled-file](https://github.com/duckdb/duckdb-rs/tree/main/crates/libduckdb-sys/duckdb).
5757
You can generated the amalgamated file by:
5858

5959
```shell

0 commit comments

Comments
 (0)