Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please recommend package.rust-version in Cargo.toml #2452

Open
tiran opened this issue Jan 24, 2025 · 1 comment
Open

Please recommend package.rust-version in Cargo.toml #2452

tiran opened this issue Jan 24, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@tiran
Copy link

tiran commented Jan 24, 2025

Please recommend that package maintainers define a MSRV (package.rust-version) in their Cargo.toml. The lack of MSRV makes the lives of downstream / distro packagers harder.

Several Python packages with maturin or setuptools-rust-based build don't specify a MSRV. Their latest release have inadvertently broken backwards compatibility with Rust < 1.78. The problem is not in code. Their Rust code and dependencies build fine with older Rust versions. The incompatibility is caused by a recent change in Cargo.lock. Rust 1.83's Cargo changed the default Cargo.lock version from v3 to v4. Rust < 1.78 does recognize v4 lock files.

Cargo's changelog recommends:

Cargo 1.83 (2024-11-28):
Lockfile format v4 is now the default for creating/updating a lockfile. Rust toolchains 1.78+ support lockfile v4. For compatibility with earlier MSRV, consdier setting the package.rust-version to 1.82 or earlier.

Implementation:

  • recommend rust-version in your documentation https://www.maturin.rs
  • maybe print a warning when Cargo.toml is missing MSRV?

Related issues:

@tiran tiran added the enhancement New feature or request label Jan 24, 2025
@tiran
Copy link
Author

tiran commented Jan 24, 2025

PS: The blake3 maintainer has accepted my PR and released a new version of blake3 with MSRV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant