plotters-rs / plotters

A rust drawing library for high quality data plotting for both WASM and native, statically and realtimely 🦀 📈🚀
https://plotters-rs.github.io/home/
MIT License
3.85k stars 278 forks source link

Release v0.3.3 relies on Rust 1.51 features without raising the minor version #409

Open ridwanabdillahi opened 2 years ago

ridwanabdillahi commented 2 years ago

Release v0.3.3 of the plotters crate addressed an issue about raising the MSRV from 1.46 to 1.56 without incrementing the minor version. See issue here: https://github.com/plotters-rs/plotters/issues/398

This change also included a new dependency on new features such as the unsigned_abs feature which was not stabilized in the Rust compiler until the 1.51 release of the toolchain.

This is currently breaking dependencies such as the http crate which has an MSRV of Rust 1.49 and takes a dependency on the plotters crate. Is there a way to resolve this issue such as removing the dependency on features that were stabilized after the Rust 1.46 release since the minor version is not being incremented in this release?

Example: Building the http crate using the Rust 1.49.0 toolchain, the MSRV for the crate, I get the following compilation error:

error[E0658]: use of unstable library feature 'unsigned_abs'
   --> ...\registry\src\github.com-1ecc6299db9ec823\plotters-0.3.3\src\chart\builder.rs:256:51
    |
256 |         self.label_area_size[pos as usize] = size.unsigned_abs();
    |                                                   ^^^^^^^^^^^^
    |
    = note: see issue #74913 <https://github.com/rust-lang/rust/issues/74913> for more information

   Compiling tinytemplate v1.2.1
error[E0658]: use of unstable library feature 'unsigned_abs'
   --> ...\registry\src\github.com-1ecc6299db9ec823\plotters-0.3.3\src\style\font\font_desc.rs:157:15
    |
157 |         Ok((w.unsigned_abs(), h.unsigned_abs()))
    |               ^^^^^^^^^^^^
    |
    = note: see issue #74913 <https://github.com/rust-lang/rust/issues/74913> for more information

error[E0658]: use of unstable library feature 'unsigned_abs'
   --> ...\registry\src\github.com-1ecc6299db9ec823\plotters-0.3.3\src\style\font\font_desc.rs:157:33
    |
157 |         Ok((w.unsigned_abs(), h.unsigned_abs()))
    |                                 ^^^^^^^^^^^^
    |
    = note: see issue #74913 <https://github.com/rust-lang/rust/issues/74913> for more information

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `plotters`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

The unsigned_abs feature was stabilized in Rust 1.51.0.

This compilation error did not exist in plotters v0.3.1

Monadic-Cat commented 1 year ago

Just gonna add the information that building http without its tests works just fine, since plotters is a dev-dependency via criterion over there.

This should probably be addressed. It's still a problem for anyone who wants to run http's tests on version 1.49 (like their CI). These are the options which come to mind for dealing with this:

(To be clear, I'd be willing to make the PRs for any of these.)

Monadic-Cat commented 1 year ago

Of course, there's the question of whether an MSRV of 1.49 at this point is reasonable. To which I say: "I dunno. I don't really think it is, but this isn't my crate and neither is http."