tracker icon indicating copy to clipboard operation
tracker copied to clipboard

Clicksnap build failing with rust >=1.80.0

Open JedMeister opened this issue 10 months ago • 2 comments

It looks like clicksnap needs to be updated for rust >= v1.80.0

Building clicksnap with latest rust using cargo build gives me this error:

   Compiling http-body v0.4.5
   Compiling form_urlencoded v1.2.0
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
   |
   = note: this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to version `>=0.3.35` by calling `cargo update`

   Compiling aho-corasick v1.1.1
For more information about this error, try `rustc --explain E0282`.
error: could not compile `time` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

As suggested, I tried updating the clicksnap deps with:

cargo update

but trying to build clicksnap again resulted in a ton of build errors. I didn't go through them all, but it looked like most (if not all) related to thirtyfour.

So I tried just updating time to the specific version mentioned in the initial error message via:

cargo update --precise 0.3.35  time

That worked around the issue and clicksnap built fine, but it'd be nice to fix it...

JedMeister avatar Feb 12 '25 01:02 JedMeister

Fwiw it runs fine on 1.76.0, possibly any version 1.76 <= version < 1.80

You can install the old version with

rustup install 1.76.0

and then compile / run with

cargo +1.76.0 build or cargo +1.76.0 run


I'll have a look at this at some point, but since we already have rustup installed I wouldn't consider this a time sensitive issue.

OnGle avatar Feb 12 '25 04:02 OnGle

Fwiw it runs fine on 1.76.0, possibly any version 1.76 <= version < 1.80

Yeah I actually tried that first 😁 But then thought I'd see if just updating that one dependency would also resolve it.

You can install the old version with

rustup install 1.76.0

and then compile / run with

cargo +1.76.0 build or cargo +1.76.0 run

Good to know. FWIW to test on an older version of rust I used:

rustup default 1.76.0

Also, you probably already know this, but I also read that it can be configured per project via a toolchain override file.

I'll have a look at this at some point, but since we already have rustup installed I wouldn't consider this a time sensitive issue.

Yeah no rush, I just thought I'd note it here.

JedMeister avatar Feb 14 '25 04:02 JedMeister

Hey @ongle, I've just been setting up a new TKLDev and hit this issue again while running bt-iso (it sets up clicksnap if it's not installed). I'll just hardcode the rust version in the install script for now but it'd be great to fix this; or at least provide a "lock" file (assuming rust does that).

   Compiling time v0.3.29
   Compiling rustls-webpki v0.101.6
error[E0282]: type annotations needed for `Box<_>`
  --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/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
   |
   = note: this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to version `>=0.3.35` by calling `cargo update`

   Compiling serde_derive v1.0.188
For more information about this error, try `rustc --explain E0282`.
error: could not compile `time` (lib) due to 1 previous error

JedMeister avatar Jun 16 '25 04:06 JedMeister

Fix here: https://github.com/turnkeylinux/clicksnap/pull/104

OnGle avatar Jun 16 '25 06:06 OnGle

Fix here: turnkeylinux/clicksnap#104

PR merged and issue closed :)

JedMeister avatar Jun 16 '25 06:06 JedMeister