Skip to content

Commit

Permalink
Update duckdb-rs to DuckDB v1.0.0 (#336)
Browse files Browse the repository at this point in the history
* Update Rust to v1.0.0

* Remove define again

* Update crates/libduckdb-sys/build.rs

Co-authored-by: Murali S <[email protected]>

* Update build.rs

* Remove patch again

* Disable Windows for now

---------

Co-authored-by: Murali S <[email protected]>
  • Loading branch information
Mytherin and muralisoundararajan authored Jul 10, 2024
1 parent 88dd455 commit 15ead11
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 3,122 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
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 }
#- {
Expand All @@ -38,7 +37,7 @@ jobs:
name: Download duckdb
with:
repository: "duckdb/duckdb"
tag: "v0.10.1"
tag: "v1.0.0"
fileName: ${{ matrix.duckdb }}
out-file-path: .

Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
]

[workspace.package]
version = "0.10.2"
version = "1.0.0"
authors = ["wangfenjin <[email protected]>"]
edition = "2021"
repository = "https://github.com/wangfenjin/duckdb-rs"
Expand All @@ -19,8 +19,8 @@ license = "MIT"
categories = ["database"]

[workspace.dependencies]
duckdb = { version = "0.10.2", path = "crates/duckdb" }
libduckdb-sys = { version = "0.10.2", path = "crates/libduckdb-sys" }
duckdb = { version = "1.0.0", path = "crates/duckdb" }
libduckdb-sys = { version = "1.0.0", path = "crates/libduckdb-sys" }
duckdb-loadable-macros = { version = "0.1.1", path = "crates/duckdb-loadable-macros" }
autocfg = "1.0"
bindgen = { version = "0.69", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion crates/duckdb/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "duckdb"
version = "0.10.2"
version = "1.0.0"
authors.workspace = true
edition.workspace = true
repository.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/libduckdb-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libduckdb-sys"
version = "0.10.2"
version = "1.0.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
Expand Down
Binary file modified crates/libduckdb-sys/duckdb.tar.gz
Binary file not shown.
3,107 changes: 1 addition & 3,106 deletions crates/libduckdb-sys/src/bindgen_bundled_version.rs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions crates/libduckdb-sys/update_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_sources(extensions):
)

subprocess.check_call(
'find "' + SCRIPT_DIR + '/../target" -type f -name bindgen.rs -exec rm {} \;',
'find "' + SCRIPT_DIR + '/../../target" -type f -name bindgen.rs -exec rm {} \;',
shell=True,
)

Expand All @@ -87,14 +87,14 @@ def get_sources(extensions):
print(
'find "'
+ SCRIPT_DIR
+ '/../target" -type f -name "bindgen.rs" -exec cp {} "'
+ '/../../target" -type f -name "bindgen.rs" -exec cp {} "'
+ SRC_DIR
+ '/bindgen_bundled_version.rs" \;'
)
subprocess.check_call(
'find "'
+ SCRIPT_DIR
+ '/../target" -type f -name "bindgen.rs" -exec cp {} "'
+ '/../../target" -type f -name "bindgen.rs" -exec cp {} "'
+ SRC_DIR
+ '/bindgen_bundled_version.rs" \;',
shell=True,
Expand Down
8 changes: 4 additions & 4 deletions crates/libduckdb-sys/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ CUR_DIR=$(pwd -P)
echo "$SCRIPT_DIR"
cd "$SCRIPT_DIR" || { echo "fatal error" >&2; exit 1; }
cargo clean
mkdir -p "$SCRIPT_DIR/../target" "$SCRIPT_DIR/duckdb"
mkdir -p "$SCRIPT_DIR/../../target" "$SCRIPT_DIR/duckdb"
export DUCKDB_LIB_DIR="$SCRIPT_DIR/duckdb"
export DU_INCLUDE_DIR="$DUCKDB_LIB_DIR"

# Download and extract amalgamation
DUCKDB_VERSION=v0.10.2
DUCKDB_VERSION=v1.0.0
git submodule update --init --checkout
cd "$SCRIPT_DIR/duckdb-sources" || { echo "fatal error" >&2; exit 1; }
git fetch
Expand All @@ -22,9 +22,9 @@ python3 "$SCRIPT_DIR/update_sources.py"
rm -f "$SCRIPT_DIR/src/bindgen_bundled_version.rs"
cargo update
# Just to make sure there is only one bindgen.rs file in target dir
find "$SCRIPT_DIR/../target" -type f -name bindgen.rs -exec rm {} \;
find "$SCRIPT_DIR/../../target" -type f -name bindgen.rs -exec rm {} \;
env LIBDUCKDB_SYS_BUNDLING=1 cargo test --features "extensions-full buildtime_bindgen"
find "$SCRIPT_DIR/../target" -type f -name bindgen.rs -exec cp {} "$SCRIPT_DIR/src/bindgen_bundled_version.rs" \;
find "$SCRIPT_DIR/../../target" -type f -name bindgen.rs -exec cp {} "$SCRIPT_DIR/src/bindgen_bundled_version.rs" \;

# Sanity checks
cd "$SCRIPT_DIR/.." || { echo "fatal error" >&2; exit 1; }
Expand Down
4 changes: 2 additions & 2 deletions upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ fi

echo "Start to upgrade from $duckdb_rs_version to $duckdb_version"

sed -i '' "s/$duckdb_rs_version/$duckdb_version/g" Cargo.toml libduckdb-sys/upgrade.sh libduckdb-sys/Cargo.toml .github/workflows/rust.yaml
./libduckdb-sys/upgrade.sh
sed -i '' "s/$duckdb_rs_version/$duckdb_version/g" Cargo.toml crates/libduckdb-sys/upgrade.sh crates/libduckdb-sys/Cargo.toml .github/workflows/rust.yaml
./crates/libduckdb-sys/upgrade.sh

0 comments on commit 15ead11

Please sign in to comment.