diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index 99fcdc5ece1..79726017b9c 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -39,10 +39,6 @@ jobs: run: | sudo apt update sudo apt install -y protobuf-compiler libssl-dev - # pin the toolchain version to avoid surprises - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: clippy, rustfmt - uses: rui314/setup-mold@v1 - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov @@ -77,6 +73,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: workspaces: java/core/lance-jni -> ../target/rust-maven-plugin/lance-jni + cache-targets: false + cache-workspace-crates: true - name: Set up Java ${{ matrix.java-version }} uses: actions/setup-java@v4 with: diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index eee64e2a9b0..8ba40b6f91f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -33,7 +33,7 @@ env: FORCE_COLOR: "1" # Change this to bust all caches (may be needed periodically if the caches accumulate # a lot of cruft). - CACHE_PREFIX: "1" + CACHE_PREFIX: "2" jobs: lint: @@ -60,6 +60,8 @@ jobs: with: workspaces: python prefix-key: ${{ env.CACHE_PREFIX }} + cache-targets: false + cache-workspace-crates: true - name: Install linting tools run: | pip install ruff==0.11.2 maturin tensorflow tqdm ray[data] pyright datasets polars[pyarrow,pandas] @@ -73,10 +75,6 @@ jobs: run: | sudo apt update sudo apt install -y protobuf-compiler libssl-dev - - name: Install rustfmt - run: rustup component add rustfmt - - name: Install clippy - run: rustup component add clippy - name: Lint Rust run: | ALL_FEATURES=`cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | .features | keys | .[]' | grep -v protoc | sort | uniq | paste -s -d "," -` @@ -117,6 +115,8 @@ jobs: with: workspaces: python prefix-key: ${{ env.CACHE_PREFIX }} + cache-targets: false + cache-workspace-crates: true - uses: ./.github/workflows/build_linux_wheel - uses: ./.github/workflows/run_tests - name: Generate forward compatibility files @@ -132,9 +132,7 @@ jobs: source venv/bin/activate pip install pytest --pre --extra-index-url https://pypi.fury.io/lancedb/ pylance==0.29.1.beta2 pytest python/tests/forward_compat --run-forward - # Make sure wheels are not included in the Rust cache - - name: Delete wheels - run: sudo rm -rf target/wheels + linux-arm: timeout-minutes: 45 runs-on: ubuntu-2404-4x-arm64 @@ -156,6 +154,8 @@ jobs: with: workspaces: python prefix-key: ${{ env.CACHE_PREFIX }} + cache-targets: false + cache-workspace-crates: true - uses: ./.github/workflows/build_linux_wheel with: arm-build: "true" @@ -165,9 +165,6 @@ jobs: sudo apt update -y -qq sudo apt install -y libhdf5-dev - uses: ./.github/workflows/run_tests - # Make sure wheels are not included in the Rust cache - - name: Delete wheels - run: sudo rm -rf target/wheels mac: timeout-minutes: 45 name: Python macOS 3.12 ARM @@ -189,13 +186,13 @@ jobs: with: workspaces: python prefix-key: ${{ env.CACHE_PREFIX }} + cache-targets: false + cache-workspace-crates: true - uses: ./.github/workflows/build_mac_wheel - uses: ./.github/workflows/run_tests with: skip-torch: "true" - # Make sure wheels are not included in the Rust cache - - name: Delete wheels - run: rm -rf target/wheels + windows: runs-on: windows-latest timeout-minutes: 90 @@ -212,6 +209,8 @@ jobs: with: workspaces: python prefix-key: ${{ env.CACHE_PREFIX }} + cache-targets: false + cache-workspace-crates: true - uses: ./.github/workflows/build_windows_wheel - uses: ./.github/workflows/run_tests aws-integtest: @@ -234,12 +233,11 @@ jobs: with: workspaces: python prefix-key: ${{ env.CACHE_PREFIX }} + cache-targets: false + cache-workspace-crates: true - uses: ./.github/workflows/build_linux_wheel - name: Install dependencies run: | pip install ray[data] pip install torch --index-url https://download.pytorch.org/whl/cpu - uses: ./.github/workflows/run_integtests - # Make sure wheels are not included in the Rust cache - - name: Delete wheels - run: sudo rm -rf target/wheels diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a21037734b1..9209f7455b8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -44,10 +44,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: clippy - uses: Swatinem/rust-cache@v2 + with: + cache-targets: false + cache-workspace-crates: true - name: Install dependencies run: | sudo apt update @@ -56,11 +56,9 @@ jobs: run: | ALL_FEATURES=`cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | .features | keys | .[]' | grep -v protoc | sort | uniq | paste -s -d "," -` echo "ALL_FEATURES=${ALL_FEATURES}" >> $GITHUB_ENV - - uses: auguwu/clippy-action@1.4.0 - with: - check-args: --locked --features ${{ env.ALL_FEATURES }} --tests --benches --examples - token: ${{secrets.GITHUB_TOKEN}} - deny: warnings + - name: Clippy + run: cargo clippy --locked --features ${{ env.ALL_FEATURES }} --all-targets -- -D warnings + cargo-deny: name: Check Rust dependencies (cargo-deny) runs-on: ubuntu-24.04 @@ -70,6 +68,7 @@ jobs: with: log-level: warn command: check + linux-build: runs-on: "ubuntu-24.04" timeout-minutes: 60 @@ -85,18 +84,19 @@ jobs: steps: - uses: actions/checkout@v4 # pin the toolchain version to avoid surprises - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - # When using the nightly toolchain, do not surface warnings as check annotations - matcher: ${{ matrix.toolchain != 'nightly'}} + - name: Setup rust toolchain + run: | + rustup toolchain install ${{ matrix.toolchain }} + rustup default ${{ matrix.toolchain }} - uses: rui314/setup-mold@v1 - uses: Swatinem/rust-cache@v2 + with: + cache-targets: false + cache-workspace-crates: true - name: Install dependencies run: | sudo apt update sudo apt install -y protobuf-compiler libssl-dev - rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} - name: Start DynamodDB and S3 run: docker compose -f docker-compose.yml up -d --wait - name: Install cargo-llvm-cov @@ -130,11 +130,15 @@ jobs: timeout-minutes: 75 steps: - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: "stable" + - name: Setup rust toolchain + run: | + rustup toolchain install stable + rustup default stable - uses: rui314/setup-mold@v1 - uses: Swatinem/rust-cache@v2 + with: + cache-targets: false + cache-workspace-crates: true - name: Install dependencies run: | sudo apt -y -qq update @@ -191,7 +195,6 @@ jobs: working-directory: ./rust steps: - uses: actions/checkout@v4 - - uses: Swatinem/rust-cache@v2 - name: Select new xcode # Default XCode right now is 15.0.1, which contains a bug that causes # backtraces to not show properly. See: @@ -202,6 +205,10 @@ jobs: - name: Set up Rust run: | rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - uses: Swatinem/rust-cache@v2 + with: + cache-targets: false + cache-workspace-crates: true - name: Build tests run: | cargo test --locked --features fp16kernels,cli,tensorflow,dynamodb,substrait --no-run @@ -219,6 +226,9 @@ jobs: steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 + with: + cache-targets: false + cache-workspace-crates: true - name: Install Protoc v21.12 working-directory: C:\ run: | @@ -234,6 +244,7 @@ jobs: run: cargo test - name: Check benchmarks run: cargo check --benches + msrv: # Check the minimum supported Rust version name: MSRV Check - Rust v${{ matrix.msrv }} @@ -250,14 +261,17 @@ jobs: with: submodules: true - uses: Swatinem/rust-cache@v2 + with: + cache-targets: false + cache-workspace-crates: true - name: Install dependencies run: | sudo apt update sudo apt install -y protobuf-compiler libssl-dev - name: Install ${{ matrix.msrv }} - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.msrv }} + run: | + rustup toolchain install ${{ matrix.msrv }} + rustup default ${{ matrix.msrv }} - name: cargo +${{ matrix.msrv }} check run: | ALL_FEATURES=`cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | .features | keys | .[]' | grep -v protoc | sort | uniq | paste -s -d "," -` diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 71747395157..0b8973d47df 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,3 +2,4 @@ # Feel free to upgrade to bring in new lints. [toolchain] channel = "1.86.0" +components = ["rustfmt", "clippy", "rust-analyzer"]