Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: full
rust_min: 1.82.0 # <- Update this when bumping up MSRV
rust_min: 1.85.0 # <- Update this when bumping up MSRV

jobs:
static_checks:
Expand Down Expand Up @@ -122,14 +122,12 @@ jobs:
toolchain: ${{ env.rust_min }}
- name: Print Rust version
run: rustc --version
- name: Use MSRV Cargo.lock
run: mv Cargo.lock.msrv Cargo.lock
- name: MSRV cargo check with features
run: cargo check --all-targets --all-features --locked
run: cargo check --all-targets --all-features
- name: MSRV cargo check without features
run: cargo check --all-targets --locked -p scylla
run: cargo check --all-targets -p scylla
- name: MSRV cargo check scylla-cql
run: cargo check --all-targets --locked -p scylla-cql
run: cargo check --all-targets -p scylla-cql

# Tests that docstrings generate docs without warnings
cargo_docs:
Expand Down
32 changes: 0 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,38 +78,6 @@ simply add the call at the beginning of the test.
Before sending a pull request, it is a good idea to run `make ci` locally (or `make dockerized-ci` if on macOS).
It will perform a format check, `cargo check`, linter check (clippy), build and `cargo test`.

### min_rust workflow and Cargo.lock.msrv

There is min_rust job defined in rust.yml workflow that checks if the driver compiles with our current MSRV.
Bumping MSRV is generally not considered a breaking change, so our dependencies are free to do it,
and do it regularly. This resulted in failures in this job.
We could pin versions of problematic crates in `Cargo.toml`, but it would affect version selection
for client applications. It would also force people that use non-ancient versions of Rust to use older
versions of dependencies, which is not desirable.

We opted for a different approach. There is `Cargo.lock.msrv` file in repository, which is used only by min_rust job -
it is renamed to `Cargo.lock` before building the driver with `--locked` flag.

This solution is good for us (because we don't have to fix breakage so often) and for users of the driver on modern versions
of Rust - for them the driver will just work.
Users on old versions of Rust will potentially have to pin indirect dependencies to specific versions - but that shouldn't be
that much of a problem, it's just few `cargo update` commands.

If your PR added / removed / updated a dependency, you will need to also update `Cargo.lock.msrv` file.
There are a few scenarios:
- If you just bumped version of one of crates in the workspace: rename `Cargo.lock.msrv` to `Cargo.lock`,
run `cargo check --all-targets --all-features --offline`, rename the file back.
- If you added / removed / updated dependency in one of `Cargo.toml` files it should be enough to
rename `Cargo.lock.msrv` to `Cargo.lock`, run `cargo check --all-targets --all-features`
and rename the file back.
- If previous methods didn't work or you want to recreate the file (which we should do once in a while):
1. Switch to MSRV version (e.g. `rustup install <current-msrv> && rustup default <current-msrv>`). Check `README.md` file for current MSRV.
2. Remove your `Cargo.lock`
3. Run `cargo check --all-targets --all-features`
4. If you got an error about one of dependencies not working with this version of Rust, update it's version in `Cargo.lock`,
using command like `cargo update -p toml_datetime --precise 0.6.3` and go back to step 3.
5. Rename `Cargo.lock` to `Cargo.lock.msrv`.

### Semver checking

Our CI runs cargo semver-checks and labels PRs that introduce breaking changes.
Expand Down
Loading
Loading