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

Update MSRV #35

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ description = """
Replacement for crate (macro_rules keyword) in proc-macros
"""
readme = "./README.md"
rust-version = "1.60.0"
rust-version = "1.64.0"

[dependencies]
toml_edit = "0.19"
toml_edit = "0.19.8"
Copy link
Owner

Choose a reason for hiding this comment

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

This doesn't lock the version. Locking would be =0.19.8. However, I'm not sure this is required here.

The problem is that toml_edit bumped the MSRV in a patch release. The MSRV is also computed based on all deps. Meaning that the MSRV of proc-macro-crate is still 1.60.0, but it gets transitively bumped to 1.64.0 because of its deps.

Choose a reason for hiding this comment

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

Your MSRV is at least the MSRV of your dependencies. I'd appreciate if we can lock the dependency here to avoid cascading the breaking change up to your users.

proc-macro-crate is a dependency of parity-scale-codec which is integrated into multihash. multihash is a fundamental crate of the libp2p ecosystem and we are trying to minimize breaking changes there at the moment. We treat bumping MSRV as a breaking change.

For 1.0 of multihash, I want to avoid the dependency on parity-scale-codec, simply because it is unnecessarily part of the public API. It doesn't need access to the internals and can be implemented on top. We've chatted about this in paritytech/parity-scale-codec#405 already :)

Copy link
Owner

Choose a reason for hiding this comment

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

I just checked to pin 0.19.8, but that doesn't help. The problem is that toml_edit itself doesn't has winnow pinned so cargo will still use the latest version.

Copy link

Choose a reason for hiding this comment

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

You can build this crate with older Rust versions still. There are no changes needed here, but your application that wants to be able to build with older Rust versions will have to come with a suitable Cargo.lock that pins toml_edit to an old enough version.

Copy link

Choose a reason for hiding this comment

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

More importantly, if you pin it in this crate's Cargo.toml to ==0.19.8 you will break dependency resolution in other crates depending on this, and which actually require features from toml_edit > 0.19.8. It's generally a bad idea to have upper bounds in Cargo.toml (or even worse exact versions).

Choose a reason for hiding this comment

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

You can build this crate with older Rust versions still. There are no changes needed here, but your application that wants to be able to build with older Rust versions will have to come with a suitable Cargo.lock that pins toml_edit to an old enough version.

Good call, I guess we should just downgrade toml_edit in CI before trying to compile.

once_cell = "1.13.0"

[dev-dependencies]
Expand Down