From 27ef0bb0a210de84828309f9b8a561b516deb4e5 Mon Sep 17 00:00:00 2001 From: Will Jones Date: Thu, 19 Dec 2024 08:43:25 -0800 Subject: [PATCH] ci(rust): check MSRV and upgrade toolchain (#1960) * Upgrades our toolchain file to v1.83.0, since many dependencies now have MSRV of 1.81.0 * Reverts Rust changes from #1946 that were working around this in a dumb way * Adding an MSRV check * Reduce MSRV back to 1.78.0 --- .github/workflows/rust.yml | 40 +++++++++++++++++++++++++++++++++++++- Cargo.toml | 2 +- rust-toolchain.toml | 2 +- rust/lancedb/Cargo.toml | 6 ++---- rust/lancedb/src/query.rs | 2 +- 5 files changed, 44 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bfc3296a..857ff3b7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -185,7 +185,7 @@ jobs: Add-Content $env:GITHUB_PATH "C:\BuildTools\VC\Tools\Llvm\x64\bin" # Add MSVC runtime libraries to LIB - $env:LIB = "C:\BuildTools\VC\Tools\MSVC\$latestVersion\lib\arm64;" + + $env:LIB = "C:\BuildTools\VC\Tools\MSVC\$latestVersion\lib\arm64;" + "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\arm64;" + "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\arm64" Add-Content $env:GITHUB_ENV "LIB=$env:LIB" @@ -238,3 +238,41 @@ jobs: $env:VCPKG_ROOT = $env:VCPKG_INSTALLATION_ROOT cargo build --target aarch64-pc-windows-msvc cargo test --target aarch64-pc-windows-msvc + + msrv: + # Check the minimum supported Rust version + name: MSRV Check - Rust v${{ matrix.msrv }} + runs-on: ubuntu-24.04 + strategy: + matrix: + msrv: ["1.78.0"] # This should match up with rust-version in Cargo.toml + env: + # Need up-to-date compilers for kernels + CC: clang-18 + CXX: clang++-18 + steps: + - uses: actions/checkout@v4 + with: + submodules: 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 }} + - name: Downgrade dependencies + # These packages have newer requirements for MSRV + run: | + cargo update -p aws-sdk-bedrockruntime --precise 1.64.0 + cargo update -p aws-sdk-dynamodb --precise 1.55.0 + cargo update -p aws-config --precise 1.5.10 + cargo update -p aws-sdk-kms --precise 1.51.0 + cargo update -p aws-sdk-s3 --precise 1.65.0 + cargo update -p aws-sdk-sso --precise 1.50.0 + cargo update -p aws-sdk-ssooidc --precise 1.51.0 + cargo update -p aws-sdk-sts --precise 1.51.0 + cargo update -p home --precise 0.5.9 + - name: cargo +${{ matrix.msrv }} check + run: cargo check --workspace --tests --benches --all-features diff --git a/Cargo.toml b/Cargo.toml index 29840e55..3a92bdda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ repository = "https://github.com/lancedb/lancedb" description = "Serverless, low-latency vector database for AI applications" keywords = ["lancedb", "lance", "database", "vector", "search"] categories = ["database-implementations"] -rust-version = "1.80.0" # TODO: lower this once we upgrade Lance again. +rust-version = "1.78.0" [workspace.dependencies] lance = { "version" = "=0.21.0", "features" = [ diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4d2dee85..0193dee3 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.80.0" +channel = "1.83.0" diff --git a/rust/lancedb/Cargo.toml b/rust/lancedb/Cargo.toml index a3ab2f8a..4483b56b 100644 --- a/rust/lancedb/Cargo.toml +++ b/rust/lancedb/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true repository.workspace = true keywords.workspace = true categories.workspace = true -rust-version = "1.75" +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -62,8 +62,6 @@ http = { version = "1", optional = true } # Matching what is in reqwest uuid = { version = "1.7.0", features = ["v4"], optional = true } polars-arrow = { version = ">=0.37,<0.40.0", optional = true } polars = { version = ">=0.37,<0.40.0", optional = true } -# There was a big jump in MSRV for this package, and it's used by Polars. -home = { version = "=0.5.9", optional = true } hf-hub = { version = "0.3.2", optional = true } candle-core = { version = "0.6.0", optional = true } candle-transformers = { version = "0.6.0", optional = true } @@ -91,7 +89,7 @@ fp16kernels = ["lance-linalg/fp16kernels"] s3-test = [] bedrock = ["dep:aws-sdk-bedrockruntime"] openai = ["dep:async-openai", "dep:reqwest"] -polars = ["dep:polars-arrow", "dep:polars", "dep:home"] +polars = ["dep:polars-arrow", "dep:polars"] sentence-transformers = [ "dep:hf-hub", "dep:candle-core", diff --git a/rust/lancedb/src/query.rs b/rust/lancedb/src/query.rs index 25f3ddb3..e9add758 100644 --- a/rust/lancedb/src/query.rs +++ b/rust/lancedb/src/query.rs @@ -339,7 +339,7 @@ pub trait QueryBase { fn limit(self, limit: usize) -> Self; /// Set the offset of the query. - + /// /// By default, it fetches starting with the first row. /// This method can be used to skip the first `offset` rows. fn offset(self, offset: usize) -> Self;