earthly / lib

Mozilla Public License 2.0
7 stars 11 forks source link

Rust library does not support projects with MSRV below 1.74.0 by default #56

Closed TomAFrench closed 5 months ago

TomAFrench commented 5 months ago

The rust library currently requires that the version of rust being used is able to build the latest version of cargo-sweep.

https://github.com/earthly/lib/blob/855c98f862a00e864e0fb9af60e4c79ef2f2873b/rust/Earthfile#L170

The current master branch of cargo-sweep only builds on rust 1.74.0+ which is then a soft-MSRV of this library. Users can work around this by installing cargo-sweep before calling INIT, but this is UX which could be improved.

Because we're installing the latest commit of cargo-sweep and cargo-sweep doesn't seem to do any checks its own MSRV, this could update at any point. It's then practically required to install cargo-sweep separately as otherwise you can be rugged at any point. Note that we're not even using the lockfile for cargo-sweep so if any of its dependencies update their MSRV improperly then that also rugs users of this library.

Ideally we'd be locking to a particular version of cargo-sweep with a fixed lockfile to try to avoid unnecessary MSRV bumps. e.g. using

cargo install cargo-sweep@0.7.0 --locked

would allow for installing a consistent version of this dependency which makes it easier for users to rely on the library's default behaviour.

TomAFrench commented 5 months ago

Note that this issue means that the example code for getting started with Rust as listed on the dashboard will error.

image