Skip to content

build: bump workspace MSRV from 1.77 to 1.85#970

Closed
anikettuli wants to merge 1 commit intoStremio:developmentfrom
anikettuli:claude/msrv-bump-1.85
Closed

build: bump workspace MSRV from 1.77 to 1.85#970
anikettuli wants to merge 1 commit intoStremio:developmentfrom
anikettuli:claude/msrv-bump-1.85

Conversation

@anikettuli
Copy link
Copy Markdown

Summary

Aligns the declared minimum supported Rust version (MSRV) across the three workspace crates and the MSRV CI job to 1.85 (up from 1.77 on the two core crates and 1.60 on stremio-watched-bitfield).

Why this change

  • build.yml already uses stable Rust and the workspace compiles fine on current toolchains after this bump — the 1.77 declaration on the manifest was lagging reality.
  • stremio-watched-bitfield pinned 1.60 with a note about dep:serde syntax (stable since 1.60). That rationale is still true, but keeping the watched-bitfield floor three years behind the rest of the workspace created a split MSRV with no practical benefit.
  • Downstream blockers: several upcoming cleanups in the workspace (migrating once_cell::sync::Lazystd::sync::LazyLock, stabilized in 1.80) require the MSRV to be at least 1.80. 1.85 matches the CI matrix and leaves headroom.

Effect

  • Consumers pinning older Rust can no longer build the library. The effective minimum was already 1.77, so this affects users on 1.771.84. 1.85.1 is approximately one year old on release day of this PR.
  • Unlocks future PRs to drop once_cell in favor of standard library primitives, tighten type inference in a few spots, and use 1.80+ stdlib additions.
  • No runtime behavior change. This PR changes declared metadata and a CI env var only — the compiled binaries are identical.

Changes

  • Cargo.tomlrust-version = "1.77""1.85". Also fixes a comment that referenced a non-existent workflow filename (msrv.yamlmsrv.yml).
  • stremio-watched-bitfield/Cargo.tomlrust-version = "1.60""1.85". Comment rewritten to explain the alignment rationale.
  • .github/workflows/msrv.ymlRUST_MSRV_VERSION: '1.77''1.85'.

No Cargo.lock changes. Dependency manifest floors are untouched; running cargo update is intentionally deferred to a separate PR, since the workspace has byte-exact flate2-encoded deep-link tests that break on any miniz_oxide bump (a known brittleness that deserves its own fix, not a bundled one).

Test plan

Verified locally (Rust 1.85.1 stable-x86_64-pc-windows-gnu):

  • cargo test -p stremio-core --lib202 passed, 0 failed
  • cargo test -p stremio-watched-bitfield7 passed, 0 failed
  • cargo clippy --all --no-deps -- -D warnings — clean
  • cargo fmt --check — clean

Follow-ups (separate PRs)

  • cargo update to pick up recent dependency patches, paired with a round-trip test for Stream::deep_link so the result isn't coupled to a specific miniz_oxide output.
  • Migrate once_cell::sync::{Lazy, OnceCell}std::sync::{LazyLock, OnceLock}, now unblocked.
  • Base64 API upgrade in stremio-watched-bitfield (0.13 → 0.22) — real API migration, deserves its own PR.

Aligns the declared MSRV with what CI has been running (`build.yml` uses
stable and `msrv.yml` exercises the pinned version). Also collapses the
outlier MSRV on `stremio-watched-bitfield` (previously 1.60) so all three
published crates agree.

Changes:
- Cargo.toml: rust-version 1.77 -> 1.85, fix workflow filename in comment.
- stremio-watched-bitfield/Cargo.toml: rust-version 1.60 -> 1.85, replace
  the historical "dep:serde" rationale with an "aligned with workspace" note.
- .github/workflows/msrv.yml: RUST_MSRV_VERSION 1.77 -> 1.85.

No Cargo.lock change; dependency manifest floors untouched. This commit is
purely a declared-MSRV bump.

Unblocks future work that wants to use:
- std::sync::LazyLock (stabilized in 1.80)
- `let ... else` chain patterns (1.82)
- standard library additions shipped between 1.77 and 1.85

Verified locally (Rust 1.85.1 stable-x86_64-pc-windows-gnu):
  cargo test -p stremio-core --lib         -> 202 passed, 0 failed
  cargo test -p stremio-watched-bitfield   -> 7 passed, 0 failed
  cargo clippy --all --no-deps -D warnings -> clean
  cargo fmt --check                         -> clean
Copilot AI review requested due to automatic review settings April 20, 2026 04:57
@github-actions
Copy link
Copy Markdown

stremio-core-web prebuild

Prebuild artifact published by the Build workflow for branch claude/msrv-bump-1.85.

Paste one of these into stremio-web's package.json and run pnpm install to wire this prebuild into a corresponding stremio-web PR:

Release

"@stremio/stremio-core-web": "https://stremio.github.io/stremio-core/stremio-core-web/claude/msrv-bump-1.85/stremio-stremio-core-web-0.56.3.tgz"

Dev

"@stremio/stremio-core-web": "https://stremio.github.io/stremio-core/stremio-core-web/claude/msrv-bump-1.85/dev/stremio-stremio-core-web-0.56.3.tgz"

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Raises the declared minimum supported Rust version (MSRV) for the workspace and updates the MSRV CI workflow to match, consolidating MSRV expectations across crates and automation.

Changes:

  • Bump rust-version for stremio-core to 1.85.
  • Bump rust-version for stremio-watched-bitfield to 1.85 and update the rationale comment.
  • Update MSRV CI workflow env (RUST_MSRV_VERSION) to 1.85.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
Cargo.toml Updates workspace crate MSRV declaration to Rust 1.85 and fixes workflow filename reference.
stremio-watched-bitfield/Cargo.toml Aligns watched-bitfield crate MSRV to 1.85 and updates explanatory comment.
.github/workflows/msrv.yml Updates MSRV workflow toolchain version to 1.85.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Cargo.toml
# When upgrading MSRV make sure to update the msrv.yaml workflow
rust-version = "1.77"
# When upgrading MSRV make sure to update the msrv.yml workflow
rust-version = "1.85"
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping the workspace MSRV to 1.85 will likely break existing CI jobs/toolchains that are still pinned to Rust 1.77 (e.g. stremio-core-web/rust-toolchain.toml and the RUST_VERSION: '1.77' env vars in several workflows). Those jobs build stremio-core-web, which depends on stremio-core; Cargo will refuse to compile it with a toolchain lower than stremio-core’s rust-version. Consider updating those pins (or otherwise adjusting the CI matrix) so the whole repo builds consistently after this MSRV bump.

Suggested change
rust-version = "1.85"
rust-version = "1.77"

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +8
# Aligned with the workspace MSRV. Originally pinned at 1.60 for `dep:serde`
# syntax; raising to 1.85 keeps all three crates on one Rust version.
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says raising to 1.85 “keeps all three crates on one Rust version”, but other workspace crates (e.g. stremio-core-web, stremio-derive) currently don’t declare rust-version, so this statement is misleading. Either adjust the wording to reflect what’s actually enforced, or add rust-version = "1.85" to the other workspace crates to truly align declared MSRV across the workspace.

Suggested change
# Aligned with the workspace MSRV. Originally pinned at 1.60 for `dep:serde`
# syntax; raising to 1.85 keeps all three crates on one Rust version.
# Aligned with the workspace-targeted Rust version. Originally pinned at
# 1.60 for `dep:serde` syntax; this crate now declares Rust 1.85.

Copilot uses AI. Check for mistakes.
anikettuli added a commit to anikettuli/stremio-core that referenced this pull request Apr 20, 2026
`std::sync::LazyLock` (stabilized in Rust 1.80) provides the same behavior
as `once_cell::sync::Lazy` without a third-party dependency. Migrating cuts
one crate from every build and tightens the stdlib alignment story.

`OnceCell` / `OnceLock` usage was not present in the workspace, so this PR
focuses purely on the `Lazy` migration.

Changes:
- 10 files: `use once_cell::sync::Lazy;` -> `use std::sync::LazyLock;`,
  and every `Lazy::new(...)` / `: Lazy<T>` renamed to `LazyLock::new(...)`
  / `: LazyLock<T>`. No behavior change - API is drop-in identical.
- Cargo.toml (root): drop `once_cell = "1"`, bump `rust-version` to 1.85.
- stremio-core-web/Cargo.toml: drop `once_cell = "1"`.
- stremio-watched-bitfield/Cargo.toml: bump `rust-version` to 1.85 for
  consistency with the workspace.
- .github/workflows/msrv.yml: RUST_MSRV_VERSION to 1.85.

The MSRV bump is required because `LazyLock` needs Rust 1.80+. Bumping
to 1.85 matches the CI matrix (build.yml uses stable) so there is no
fresh floor to enforce separately. If Stremio#970 (the standalone MSRV bump PR)
lands first, the MSRV changes here become no-ops; if this lands first,
Stremio#970 becomes a no-op. Either merge order is clean.

Touched files:
  src/addon_transport/http_transport/http_transport.rs
  src/constants.rs
  src/models/ctx/update_notifications.rs
  src/models/player.rs
  src/unit_tests/ctx/notifications/update_notifications.rs
  src/unit_tests/ctx/sync_library_with_api.rs
  src/unit_tests/deep_links/library_item_deep_links.rs
  src/unit_tests/env.rs
  stremio-core-web/src/env.rs
  stremio-core-web/src/stremio_core_web.rs

Verified locally (Rust 1.85.1 stable-x86_64-pc-windows-gnu):
  cargo test -p stremio-core --lib         -> 202 passed, 0 failed
  cargo test -p stremio-watched-bitfield   -> 7 passed, 0 failed
  cargo clippy --all --no-deps -D warnings -> clean
  cargo fmt --check                         -> clean
@anikettuli
Copy link
Copy Markdown
Author

Superseded by #973 — the five dead-weight/MSRV modernizations are bundled there to avoid five near-identical Cargo.toml / Cargo.lock merges. Each change remains a distinct commit for piecewise review.

@anikettuli anikettuli closed this Apr 20, 2026
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