marschall-lab / panacus

Panacus is a tool for computing statistics for GFA-formatted pangenome graphs
MIT License
87 stars 6 forks source link

compiler error in rustc-serialize #19

Open subwaystation opened 8 months ago

subwaystation commented 8 months ago

Hi @danydoerr :)

When compiling with

cargo --version
cargo 1.76.0 (c84b36747 2024-01-18)

I get the following error:

cargo build --release
   Compiling thiserror-impl v1.0.40
   Compiling getrandom v0.2.9
   Compiling io-lifetimes v1.0.10
   Compiling num_cpus v1.15.0
   Compiling clap_derive v4.5.3
   Compiling serde_json v1.0.114
   Compiling rustc-serialize v0.3.24
   Compiling regex v1.7.3
   Compiling strum_macros v0.25.3
   Compiling time v0.3.34
   Compiling rustix v0.37.19
   Compiling rand_core v0.6.4
   Compiling rayon-core v1.11.0
error[E0310]: the parameter type `T` may not live long enough
    --> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustc-serialize-0.3.24/src/serialize.rs:1155:5
     |
1155 |     fn decode<D: Decoder>(d: &mut D) -> Result<Cow<'static, T>, D::Error> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |     |
     |     the parameter type `T` must be valid for the static lifetime...
     |     ...so that the type `T` will meet its required lifetime bounds...
     |
note: ...that is required by this bound
    --> /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/borrow.rs:180:30
help: consider adding an explicit lifetime bound
     |
1151 | impl<'a, T: ?Sized + 'static> Decodable for Cow<'a, T>
     |                    +++++++++

   Compiling rand_chacha v0.3.1
   Compiling rand v0.8.5
   Compiling rayon v1.7.0
For more information about this error, try `rustc --explain E0310`.
error: could not compile `rustc-serialize` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Any ideas? THanks!

danydoerr commented 8 months ago

It seems that rustc-serialize is broken.

I am aware of this, and already implemented a fix. But it will take a couple of weeks until I push another release.

subwaystation commented 8 months ago

Understandable! Dirty quick fix: Delete Cargo.lock. Rebuilding and then it worked for me.

danydoerr commented 8 months ago

Fantastic! Thanks. In the updated version, there won't be any dependency to rustc-serialize