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.89k stars 281 forks source link

[BUG] currently nightly compiler cannot build plotters due to bug in pathfinder (simd) #554

Closed jonaspleyer closed 6 months ago

jonaspleyer commented 8 months ago

There is a bug in the most recent pathfinder version which currently prohibits building this package for with the newest nightly compiler. This means docs.rs will fail to build if a new version is to be published. There are multiple ways to deal with this bug:

  1. Wait until the bugfix is pushed upstream
  2. Do not build with the ttf feature (which enables the dependency). Check also #553 which enables all features for docs.rs specifically!
  3. Try to roll back to another working version of pathfinder (I have not tested this yet).

My hope is that the bugfix is pushed upstream soon and a new version of pathfinder is released.

Error message

rustup update nightly
cargo +nightly build
error[E0635]: unknown feature `stdsimd`
  --> /home/jonas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pathfinder_simd-0.5.2/src/lib.rs:12:49
   |
12 | #![cfg_attr(pf_rustc_nightly, feature(simd_ffi, stdsimd))]
   |                                                 ^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `pathfinder_simd` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
CDaut commented 8 months ago

Any news on this? It appears the bugfix is pushed into upstream on the pathfinder repo.

jonaspleyer commented 8 months ago

I believe that there is no new verison published on crates.io yet. You can open an issue at their repo or wait until a new version is published. If you can, simply omit the ttf feature which enables the dependency in the first place.

swfsql commented 8 months ago

fyi you can also temporarily add a patch in case you're producing a binary:

# Cargo.toml
[patch.crates-io]
pathfinder_simd = { git = "https://github.com/servo/pathfinder.git", rev = "dc6034f" }
pathfinder_geometry = { git = "https://github.com/servo/pathfinder.git", rev = "dc6034f" }

edit: you may also need to delete or update the Cargo.lock file

CDaut commented 8 months ago

That works, thank you!

atouchet commented 7 months ago

A new version of pathfinder_simd has been published. This should hopefully be fixed now.

jayvdb commented 7 months ago

Yup, it is fixed.

bionicles commented 6 months ago

here's what i'm getting in attempting to build plotters 0.3.5 today on nightly

pathfinder_simd = { version = "0.5", optional = true }
plotters = { version = "0.3", optional = true }
error[E0557]: feature has been removed
  --> /home/bion/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pathfinder_simd-0.5.2/src/lib.rs:11:61
   |
11 | #![cfg_attr(pf_rustc_nightly, feature(link_llvm_intrinsics, platform_intrinsics))]
   |                                                             ^^^^^^^^^^^^^^^^^^^ feature has been removed
   |
   = note: SIMD intrinsics use the regular intrinsics ABI now
error[E0635]: unknown feature `stdsimd`
  --> /home/bion/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pathfinder_simd-0.5.2/src/lib.rs:12:49
   |
12 | #![cfg_attr(pf_rustc_nightly, feature(simd_ffi, stdsimd))]
   |                                                 ^^^^^^^

this works:

pathfinder_simd = { version = "0.5.3" } # removed the optional from pathfinder_simd (force this version)
plotters = { version = "0.3.5", optional = true }

and this works, so the issue is not with the minor version numbers, it's with "optional"

pathfinder_simd = { version = "0.5" }
plotters = { version = "0.3", optional = true }
ripytide commented 6 months ago

@bionicles what happens if you do pathfinder_simd = { version = "0.5.3", optional = true }?

bionicles commented 6 months ago

seems fixed, i can't repro the issue anymore, now plotters is working off of 0.5.3 even if I cargo clean, with minor versions present or absent, could be related to nightly 1.80 or just my cargo having some memory to use 0.5.3 now, plotters can get the pathfinder_simd on nightly so this issue could be closed I reckon

ripytide commented 6 months ago

It was probably stuck on 0.5.2 in the Cargo.lock, cargo update would have likely also fixed it.

jonaspleyer commented 6 months ago

I am closing this issue.