Skip to content

Commit

Permalink
Update MSRV to 1.71 and add CI test (#589)
Browse files Browse the repository at this point in the history
Update MSRV in Cargo.toml and Readme to be up to date with the
dependencies that we're using, plus add a test to check that we don't
deviate from it.

The dependency causing the bump is `env_logger` with a MSRV of 1.71
(released July 2023)
https://github.com/rust-cli/env_logger/blob/9303b0c0393c33046a791b0a6497b0f03ef1f434/Cargo.toml#L8

The issue seems to also be affecting other crates in the workspace that
don't depend on that crate because the MSRV bump is due to some cargo
changes regarding `dep:` features and so it seems to affect the version
resolution of the entire workspace.

Note that this required a small change to exporters, apparently older
rust versions have trouble disambiguating the `csv` crate with the `csv`
module.
  • Loading branch information
dani-garcia authored Feb 13, 2024
1 parent 8ea2f79 commit 42ca1b0
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 16 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/minimum-rust-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Minimum Rust Version

on:
pull_request:
push:
branches:
- "main"
- "rc"
- "hotfix-rc"
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
msrv:
name: Check MSRV for - ${{ matrix.settings.os }} - ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
settings:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install rust
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # stable
with:
# Important: When updating this, make sure to update the Readme file
# and also the `rust-version` field in all the `Cargo.toml`.
toolchain: 1.71.0
targets: ${{ matrix.settings.target }}

- name: Cache cargo registry
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
key: msrv-${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }}

- name: cargo check MSRV
run: cargo check -p bitwarden --all-features
2 changes: 1 addition & 1 deletion crates/bitwarden-c/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bitwarden-c"
version = "0.1.0"
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[lib]
crate-type = ["lib", "staticlib", "cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bitwarden-cli"
version = "0.1.0"
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[dependencies]
clap = { version = "4.4.18", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Internal crate for the bitwarden crate. Do not use.
"""
keywords = ["bitwarden"]
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-exporters/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use thiserror::Error;
use uuid::Uuid;

mod csv;
use csv::export_csv;
use crate::csv::export_csv;
mod json;
use json::export_json;
mod encrypted_json;
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-generators/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Internal crate for the bitwarden crate. Do not use.
"""
keywords = ["bitwarden"]
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[features]
mobile = ["uniffi"] # Mobile-specific features
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ JSON bindings for the Bitwarden Secret Manager SDK
keywords = ["bitwarden", "secrets manager"]
categories = ["api-bindings"]
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[features]
internal = ["bitwarden/internal"] # Internal testing methods
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-napi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ N-API bindings for the Bitwarden Secrets Manager SDK
"""
keywords = ["bitwarden", "secrets manager"]
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bitwarden-py"
version = "0.1.0"
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[lib]
name = "bitwarden_py"
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-uniffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bitwarden-uniffi"
version = "0.1.0"
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[features]
docs = ["dep:schemars"] # Docs
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bitwarden-wasm"
version = "0.1.0"
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Bitwarden Secrets Manager SDK
"""
keywords = ["bitwarden", "secrets-manager"]
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[features]
default = ["secrets"]
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bitwarden = { "*", features = ["secrets"] }

## Minimum Supported Rust Version

Rust **1.57** or higher.
Rust **1.71** or higher.

## Example

Expand Down
2 changes: 1 addition & 1 deletion crates/bw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bw"
version = "0.0.2"
edition = "2021"
rust-version = "1.60"
rust-version = "1.71"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
Expand Down
2 changes: 1 addition & 1 deletion crates/bws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bws"
version = "0.4.0"
edition = "2021"
rust-version = "1.60"
rust-version = "1.71"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
Expand Down
2 changes: 1 addition & 1 deletion crates/sdk-schemas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "sdk-schemas"
version = "0.1.0"
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[features]
internal = [
Expand Down
2 changes: 1 addition & 1 deletion crates/uniffi-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "uniffi-bindgen"
version = "0.1.0"
edition = "2021"
rust-version = "1.57"
rust-version = "1.71"

[[bin]]
# This can be whatever name makes sense for your project, but the rest of this tutorial assumes uniffi-bindgen.
Expand Down

0 comments on commit 42ca1b0

Please sign in to comment.