From 386eaa379db07d93f59023a317afe158561af8fe Mon Sep 17 00:00:00 2001 From: zhangsoledad <787953403@qq.com> Date: Thu, 27 Nov 2025 16:33:58 +0800 Subject: [PATCH 1/4] chore: detaching fork fix --- .github/workflows/rust.yml | 69 ++++++++++++++------------------------ Cargo.toml | 2 +- README.md | 6 ++-- librocksdb-sys/Cargo.toml | 2 +- 4 files changed, 31 insertions(+), 48 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ec62043..1e3bc4d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,48 +9,42 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v6 - name: Install rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: 1.85.0 components: rustfmt - profile: minimal override: true - - name: Run rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - name: Check formatting + run: | + cargo fmt --all -- --check clippy: name: Clippy runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: submodules: true - name: Install rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: 1.85.0 components: clippy - profile: minimal override: true - run: sudo apt update && sudo apt install -y libclang-dev - name: Run clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all --tests -- -A clippy::upper-case-acronyms -A clippy::missing_safety_doc -D warnings + run: | + cargo clippy --all --tests -- -A clippy::upper-case-acronyms -A clippy::missing_safety_doc -D warnings audit: name: Security audit runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/audit-check@v1 + - uses: actions/checkout@v6 + - uses: rustsec/audit-check@v2.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -61,7 +55,7 @@ jobs: steps: - run: sudo apt update && sudo apt install -y valgrind libclang-dev - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: submodules: true - name: run test @@ -93,11 +87,11 @@ jobs: remove-android: 'true' remove-haskell: 'true' - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: submodules: true - name: Install rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: 1.85.0 target: ${{ matrix.target }} @@ -123,36 +117,25 @@ jobs: run: clang --version && env - name: Run librocksdb-sys tests if: runner.os == 'Linux' || runner.os == 'Windows' - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=librocksdb-sys/Cargo.toml -vvvvv + run: | + cargo test --manifest-path=librocksdb-sys/Cargo.toml -vvvvv - name: Run rocksdb tests if: runner.os == 'Linux' || runner.os == 'Windows' - uses: actions-rs/cargo@v1 - with: - command: test + run: | + cargo test - name: Run rocksdb tests (jemalloc) if: runner.os == 'Linux' - uses: actions-rs/cargo@v1 - with: - command: test - args: --features jemalloc + run: | + cargo test --features jemalloc - name: Run rocksdb tests (io-uring) if: runner.os == 'Linux' - uses: actions-rs/cargo@v1 - with: - command: test - args: --features io-uring + run: | + cargo test --features io-uring - name: Run rocksdb tests (portable) if: runner.os == 'Linux' || runner.os == 'macOS' - uses: actions-rs/cargo@v1 - with: - command: test - args: --features portable + run: | + cargo test --features portable - name: Run rocksdb tests (march-native) if: runner.os == 'Linux' - uses: actions-rs/cargo@v1 - with: - command: test - args: --features march-native + run: | + cargo test --features march-native diff --git a/Cargo.toml b/Cargo.toml index 765c73b..b88179b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" authors = ["Tyler Neely ", "David Greenberg ", "Nervos Core Dev "] license = "Apache-2.0" keywords = ["database", "embedded", "LSM-tree", "persistence"] -repository = "https://github.com/nervosnetwork/rust-rocksdb" +repository = "https://github.com/nervosnetwork/ckb-rocksdb" exclude = [ ".gitignore", "*.yml", diff --git a/README.md b/README.md index c7ab87b..0f5fc7c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -rust-rocksdb +ckb-rocksdb ============ -[![Build Status](https://github.com/nervosnetwork/rust-rocksdb/actions/workflows/rust.yml/badge.svg?branch=txn)](https://github.com/nervosnetwork/rust-rocksdb/actions/workflows/rust.yml?query=branch%3Atxn) +[![Build Status](https://github.com/nervosnetwork/ckb-rocksdb/actions/workflows/rust.yml/badge.svg)](https://github.com/nervosnetwork/ckb-rocksdb/actions/workflows/rust.yml?query=branch%3Amaster) [![crates.io](https://img.shields.io/crates/v/ckb-rocksdb.svg)](https://crates.io/crates/ckb-rocksdb) [![documentation](https://docs.rs/ckb-rocksdb/badge.svg)](https://docs.rs/ckb-rocksdb) -[![license](https://img.shields.io/crates/l/ckb-rocksdb.svg)](https://github.com/nervosnetwork/rust-rocksdb/blob/txn/LICENSE) +[![license](https://img.shields.io/crates/l/ckb-rocksdb.svg)](https://github.com/nervosnetwork/ckb-rocksdb/blob/master/LICENSE) [![Discord](https://img.shields.io/badge/chat-on%20Discord-7289DA.svg)](https://discord.com/invite/nervos) diff --git a/librocksdb-sys/Cargo.toml b/librocksdb-sys/Cargo.toml index b86d774..05e98e9 100644 --- a/librocksdb-sys/Cargo.toml +++ b/librocksdb-sys/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Karl Hobley ", "Arkadiy Paronyan Date: Thu, 27 Nov 2025 16:40:50 +0800 Subject: [PATCH 2/4] chore: upgrade toolchain to 1.89.0 --- .github/workflows/rust.yml | 6 +++--- Cargo.toml | 2 +- librocksdb-sys/Cargo.toml | 2 +- librocksdb-sys/build.rs | 2 +- rust-toolchain.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1e3bc4d..70b880b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -13,7 +13,7 @@ jobs: - name: Install rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.85.0 + toolchain: 1.89.0 components: rustfmt override: true - name: Check formatting @@ -31,7 +31,7 @@ jobs: - name: Install rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.85.0 + toolchain: 1.89.0 components: clippy override: true - run: sudo apt update && sudo apt install -y libclang-dev @@ -93,7 +93,7 @@ jobs: - name: Install rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.85.0 + toolchain: 1.89.0 target: ${{ matrix.target }} profile: minimal override: true diff --git a/Cargo.toml b/Cargo.toml index b88179b..8495e56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ exclude = [ "*.md", "benches", ] -rust-version = "1.85.0" +rust-version = "1.89.0" [features] default = ["snappy", "lz4", "zstd", "zlib", "bzip2"] diff --git a/librocksdb-sys/Cargo.toml b/librocksdb-sys/Cargo.toml index 05e98e9..bb1b75c 100644 --- a/librocksdb-sys/Cargo.toml +++ b/librocksdb-sys/Cargo.toml @@ -49,7 +49,7 @@ uuid = { version = "1.0", features = ["v4"] } [build-dependencies] cc = { version = "1.0", features = ["parallel"] } -bindgen = { version = "0.71.1", default-features = false } +bindgen = { version = "0.72.1", default-features = false } glob = "0.3.2" pkg-config = "0.3" rust-ini = "0.21" diff --git a/librocksdb-sys/build.rs b/librocksdb-sys/build.rs index dfedcc5..5454b7a 100644 --- a/librocksdb-sys/build.rs +++ b/librocksdb-sys/build.rs @@ -6,7 +6,7 @@ use std::fs; use std::path::PathBuf; use std::process::Command; -const RUST_TARGET: &str = "1.85.0"; +const RUST_TARGET: &str = "1.89.0"; fn get_flags_from_detect_platform_script() -> Option> { if !cfg!(target_os = "windows") { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c1bc0a6..b67e7d5 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.85.0" +channel = "1.89.0" From 7aca8f24def6914ce28aecaa43c409914011935e Mon Sep 17 00:00:00 2001 From: zhangsoledad <787953403@qq.com> Date: Thu, 27 Nov 2025 17:03:55 +0800 Subject: [PATCH 3/4] chore: fix cippy --- .github/workflows/rust.yml | 12 +----------- librocksdb-sys/snappy | 2 +- librocksdb-sys/tests/ffi.rs | 3 ++- librocksdb-sys/zlib | 2 +- librocksdb-sys/zstd | 2 +- src/ops/multi_get.rs | 16 ++++++++-------- 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 70b880b..6940472 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -37,17 +37,7 @@ jobs: - run: sudo apt update && sudo apt install -y libclang-dev - name: Run clippy run: | - cargo clippy --all --tests -- -A clippy::upper-case-acronyms -A clippy::missing_safety_doc -D warnings - - audit: - name: Security audit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: rustsec/audit-check@v2.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - + make clippy valgrind: name: valgrind diff --git a/librocksdb-sys/snappy b/librocksdb-sys/snappy index 2c94e11..6af9287 160000 --- a/librocksdb-sys/snappy +++ b/librocksdb-sys/snappy @@ -1 +1 @@ -Subproject commit 2c94e11145f0b7b184b831577c93e5a41c4c0346 +Subproject commit 6af9287fbdb913f0794d0148c6aa43b58e63c8e3 diff --git a/librocksdb-sys/tests/ffi.rs b/librocksdb-sys/tests/ffi.rs index 9a46a2b..a418d7d 100644 --- a/librocksdb-sys/tests/ffi.rs +++ b/librocksdb-sys/tests/ffi.rs @@ -20,7 +20,8 @@ non_upper_case_globals, unused_mut, unused_unsafe, - unused_variables + unused_variables, + static_mut_refs )] #[macro_use] diff --git a/librocksdb-sys/zlib b/librocksdb-sys/zlib index cacf7f1..51b7f2a 160000 --- a/librocksdb-sys/zlib +++ b/librocksdb-sys/zlib @@ -1 +1 @@ -Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f +Subproject commit 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf diff --git a/librocksdb-sys/zstd b/librocksdb-sys/zstd index a488ba1..f8745da 160000 --- a/librocksdb-sys/zstd +++ b/librocksdb-sys/zstd @@ -1 +1 @@ -Subproject commit a488ba114ec17ea1054b9057c26a046fc122b3b6 +Subproject commit f8745da6ff1ad1e7bab384bd1f9d742439278e99 diff --git a/src/ops/multi_get.rs b/src/ops/multi_get.rs index d48992c..94d2162 100644 --- a/src/ops/multi_get.rs +++ b/src/ops/multi_get.rs @@ -192,22 +192,22 @@ where pub trait BatchedMultiGetCF { fn batched_multi_get_cf_full<'a, K, I>( - &self, + &'a self, cf: &ColumnFamily, keys: I, sorted_input: bool, readopts: Option<&R>, - ) -> Vec, Error>> + ) -> Vec>, Error>> where K: AsRef<[u8]> + 'a + ?Sized, I: IntoIterator; fn batched_multi_get_cf<'a, K, I>( - &self, + &'a self, cf: &ColumnFamily, keys: I, sorted_input: bool, - ) -> Vec, Error>> + ) -> Vec>, Error>> where K: AsRef<[u8]> + 'a + ?Sized, I: IntoIterator, @@ -216,12 +216,12 @@ pub trait BatchedMultiGetCF { } fn batched_multi_get_cf_opt<'a, K, I>( - &self, + &'a self, cf: &ColumnFamily, keys: I, sorted_input: bool, readopts: &R, - ) -> Vec, Error>> + ) -> Vec>, Error>> where K: AsRef<[u8]> + 'a + ?Sized, I: IntoIterator, @@ -235,12 +235,12 @@ where T: Handle + super::Read, { fn batched_multi_get_cf_full<'a, K, I>( - &self, + &'a self, cf: &ColumnFamily, keys: I, sorted_input: bool, readopts: Option<&ReadOptions>, - ) -> Vec, Error>> + ) -> Vec>, Error>> where K: AsRef<[u8]> + 'a + ?Sized, I: IntoIterator, From fa5818cf536be60c50257a1ac193496b61612cc8 Mon Sep 17 00:00:00 2001 From: zhangsoledad <787953403@qq.com> Date: Thu, 27 Nov 2025 17:50:04 +0800 Subject: [PATCH 4/4] chore: Delete huge unnecessary tools folder --- .github/workflows/rust.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6940472..12e2eb2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -76,6 +76,11 @@ jobs: remove-dotnet: 'true' remove-android: 'true' remove-haskell: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + - name: Delete huge unnecessary tools folder + if: runner.os == 'Linux' + run: rm -rf /opt/hostedtoolcache - name: Checkout sources uses: actions/checkout@v6 with: