ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.81k stars 889 forks source link

Compilation error for cln-grpc on rustc 1.80.0+ #7642

Open sr-gi opened 2 weeks ago

sr-gi commented 2 weeks ago

Trying to compile cln-grpc (which happens as part of the node installation) on a rust compiler >= 1.80.0 fails due to the time crate:

error[E0282]: type annotations needed for `Box<_>`
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.29/src/format_description/parse/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
help: consider giving `items` an explicit type, where the placeholders `_` are specified
   |
83 |     let items: Box<_> = format_items
   |

This is related to https://github.com/time-rs/time/issues/693 and can be solved by updating time to 0.3.36, which can be done via cargo update -p time. However, that is just a workaround, it'd be best if the dependency is updated itself in the corresponding Cargo.toml.

CLN does not directly import time thought, it is a dependency tree of the following crates used by cln-grpc:

I've been doing some digging but none of them require the specific version that CLN is installing (0.3.29), so I'm not sure which needs to be updated. The least restrictive one seems to be asn1-rs, which only has a restriction on the minor revision, not the patch, but that does not explain why 0.3.29 is picked.