From e3d8af4acd126f85bd7a3f22c6535a96632fe863 Mon Sep 17 00:00:00 2001 From: Haydn Vestal Date: Tue, 4 Aug 2026 09:36:21 +0530 Subject: [PATCH 1/3] add a CI configuration --- .github/workflows/ci.yml | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4d6a116 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Bootstrap local path dependencies + shell: bash + run: | + set -euo pipefail + + declare -A seen + queue=("$PWD") + seen["$PWD"]=1 + + while ((${#queue[@]})); do + dir="${queue[0]}" + queue=("${queue[@]:1}") + + while IFS= read -r cargo; do + while IFS= read -r dep; do + [[ -n "$dep" ]] || continue + dep_dir="$(cd "$dir/.." && pwd)/$dep" + + if [[ ! -d "$dep_dir" ]]; then + echo "Cloning dependency repo: $dep" + git clone --depth 1 "https://github.com/TinyChain-Inc/$dep.git" "$dep_dir" + fi + + if [[ -z "${seen[$dep_dir]+x}" ]]; then + queue+=("$dep_dir") + seen["$dep_dir"]=1 + fi + done < <( + grep -hoE 'path[[:space:]]*=[[:space:]]*"\.\./[^"]+"' "$cargo" \ + | sed -E 's/.*"\.\.\/([^"]+)".*/\1/' \ + | sort -u || true + ) + done < <(find "$dir" -name Cargo.toml -type f) + done + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo registry + build + uses: Swatinem/rust-cache@v2 + + - name: Run tests + run: cargo test --verbose From d9e2a76a702d7bdc63554b0bf5bbdcf67fca9eff Mon Sep 17 00:00:00 2001 From: Haydn Vestal Date: Tue, 4 Aug 2026 09:36:22 +0530 Subject: [PATCH 2/3] fix clippy warnings --- examples/example.rs | 4 ++-- src/plan.rs | 1 + src/table/table_state.rs | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/example.rs b/examples/example.rs index f06282d..764dcd4 100644 --- a/examples/example.rs +++ b/examples/example.rs @@ -206,14 +206,14 @@ async fn main() -> Result<(), io::Error> { ], ); - let row1 = vec![ + let row1 = [ 1.into(), "one".to_string().into(), 9.into(), "nine".to_string().into(), ]; - let row2 = vec![ + let row2 = [ 2.into(), "two".to_string().into(), 8.into(), diff --git a/src/plan.rs b/src/plan.rs index 1ca7f9c..00bb5ad 100644 --- a/src/plan.rs +++ b/src/plan.rs @@ -204,6 +204,7 @@ impl<'a, K: Clone + Eq + Hash + fmt::Debug> QueryPlan<'a, K> { let mut covered_range = Columns::with_capacity(index.len()); for (i, col_name) in index.columns()[present..].iter().enumerate() { + #[allow(clippy::collapsible_if)] // Keep nested form for stable-toolchain compatibility. if let Some(order_col) = order.get(supported_order.len() + i) { if col_name != order_col { break; diff --git a/src/table/table_state.rs b/src/table/table_state.rs index 593d1ad..79b1e0a 100644 --- a/src/table/table_state.rs +++ b/src/table/table_state.rs @@ -362,7 +362,7 @@ where let mut deletes = IndexStack::with_capacity(self.auxiliary.len() + 1); - for (_name, index) in self.auxiliary.iter_mut() { + for index in self.auxiliary.values_mut() { let index_key = borrow_columns( &row, self.primary.schema().columns(), @@ -442,7 +442,7 @@ where pub(super) async fn upsert(&mut self, row: Vec) -> Result { let mut inserts = IndexStack::with_capacity(self.auxiliary.len() + 1); - for (_name, index) in self.auxiliary.iter_mut() { + for index in self.auxiliary.values_mut() { let index_key = clone_columns( &row, self.primary.schema().columns(), From d79f3068b613236ddf3a16c219c3589c284dbd6d Mon Sep 17 00:00:00 2001 From: Haydn Vestal Date: Tue, 11 Aug 2026 09:18:06 +0530 Subject: [PATCH 3/3] update the example to match the latest freqfs::Cache --- examples/example.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example.rs b/examples/example.rs index 764dcd4..d67dfa6 100644 --- a/examples/example.rs +++ b/examples/example.rs @@ -192,7 +192,7 @@ async fn main() -> Result<(), io::Error> { let path = setup_tmp_dir().await?; // initialize the cache - let cache = Cache::::new(BLOCK_SIZE, None); + let cache = Cache::::new(BLOCK_SIZE, None, 0, std::time::Duration::from_secs(3)); // load the directory and file paths into memory (not file contents, yet) let dir = cache.load(path.clone())?;