Skip to content

ci: enable Rust build artifact caching in Python tests#143

Open
beinan wants to merge 4 commits intolance-format:mainfrom
beinan:ci/fix-python-rust-cache
Open

ci: enable Rust build artifact caching in Python tests#143
beinan wants to merge 4 commits intolance-format:mainfrom
beinan:ci/fix-python-rust-cache

Conversation

@beinan
Copy link
Collaborator

@beinan beinan commented Feb 18, 2026

Summary

  • Enable shared Rust dependency cache across all workflows
  • Fix Rust cache configuration to properly cache compiled artifacts
  • Should dramatically reduce build times for Python and Rust tests

Changes

  • Shared cache key: All workflows now use shared-key: "lance-graph-deps" to share a single cache
  • Both workspaces included: Cache covers both crates/lance-graph and crates/lance-graph-python
  • Target caching enabled: Removed cache-targets: false to cache compiled artifacts
  • All workflows updated: python-test.yml, build.yml, rust-test.yml, style.yml

How it works

  1. First workflow to run compiles all dependencies (Arrow, DataFusion, Tokio, aws-lc-sys, etc.) and saves to cache (~145MB)
  2. All subsequent workflows (even different ones) reuse the cached dependencies
  3. Cache is invalidated only when Cargo.lock or Rust toolchain changes

Expected Impact

Before:

  • Every workflow compiles dependencies from scratch
  • Python test: ~24 minutes (5+ min just for Rust build)
  • Wasted time recompiling same dependencies across workflows

After:

  • First run: ~24 minutes (populates cache)
  • Subsequent runs: <2 minutes for Python tests with unchanged Rust code
  • Massive time savings across all PR runs

Test plan

  • Verify workflow runs successfully with proper caching
  • Monitor CI times before/after for performance improvement
  • Confirm cache is shared across different workflows

🤖 Generated with Claude Code

beinan and others added 2 commits February 18, 2026 23:21
Fix Rust cache configuration to properly cache compiled artifacts.
This should significantly reduce the maturin develop step time in CI
by reusing cached builds when Rust code hasn't changed.

Changes:
- Set correct workspace path to crates/lance-graph-python
- Remove cache-targets: false to enable artifact caching (defaults to true)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configure all workflows to share a single Rust dependency cache using
shared-key. This allows different workflows to reuse compiled artifacts
for dependencies like Arrow, DataFusion, Tokio, and aws-lc-sys.

Changes:
- Add shared-key: "lance-graph-deps" to all rust-cache configurations
- Include both crates/lance-graph and crates/lance-graph-python workspaces
- Remove cache-targets: false to enable target directory caching
- Apply to: python-test.yml, build.yml, rust-test.yml, style.yml

Expected impact:
- First workflow run compiles dependencies and populates shared cache
- Subsequent workflows (even different ones) reuse cached dependencies
- Massive time savings: 5+ min build → <1 min for unchanged dependencies

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

beinan and others added 2 commits February 19, 2026 05:55
This trivial change will test if the shared Rust cache is working.
Expected: Build time should drop from 23min to <2min.
Root cause: CARGO_INCREMENTAL=0 was preventing cargo from reusing
any cached compilation artifacts, making rust-cache ineffective.

Setting CARGO_INCREMENTAL=1 allows cargo to:
- Reuse compiled .rlib files from cache
- Skip recompiling unchanged dependencies
- Dramatically reduce build times (5min -> <1min expected)

Applied to: python-test.yml, build.yml, rust-test.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments