ActivityWatch / aw-watcher-window-wayland

Window and AFK watcher for some Wayland compositors
Mozilla Public License 2.0
60 stars 14 forks source link

Build fails with "the parameter type `T` may not live long enough" #37

Closed emmggi closed 4 months ago

emmggi commented 4 months ago

My build fails on error[E0310]: the parameter typeTmay not live long enough

Endeavour OS (Arch) + Gnome, package from AUR.

Log

done.
==> Starting prepare()...
==> Starting pkgver()...
==> Updated version: aw-watcher-window-wayland-git r34.56b4296-1
==> Sources are ready.
==> Making package: aw-watcher-window-wayland-git r34.56b4296-1 (четвртак, 13. јун 2024. 11:07:32 CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
   Compiling libc v0.2.139
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.51
   Compiling unicode-ident v1.0.6
   Compiling quote v1.0.23
   Compiling syn v1.0.109
   Compiling cfg-if v1.0.0
   Compiling log v0.4.17
   Compiling bitflags v1.3.2
   Compiling pkg-config v0.3.26
   Compiling once_cell v1.17.1
   Compiling pin-project-lite v0.2.9
   Compiling itoa v1.0.5
   Compiling memchr v2.5.0
   Compiling cc v1.0.79
   Compiling futures-core v0.3.26
   Compiling serde_derive v1.0.152
   Compiling bytes v1.4.0
   Compiling tokio v1.25.0
   Compiling slab v0.4.8
   Compiling serde v1.0.152
   Compiling mio v0.8.6
   Compiling socket2 v0.4.7
   Compiling openssl-sys v0.9.83
   Compiling num_cpus v1.15.0
   Compiling futures-task v0.3.26
   Compiling tracing-core v0.1.30
   Compiling num-traits v0.2.15
   Compiling indexmap v1.9.2
   Compiling cfg-if v0.1.10
   Compiling futures-util v0.3.26
   Compiling openssl v0.10.48
   Compiling foreign-types-shared v0.1.1
   Compiling fnv v1.0.7
   Compiling http v0.2.9
   Compiling foreign-types v0.3.2
   Compiling tracing v0.1.37
   Compiling num-integer v0.1.45
   Compiling pin-utils v0.1.0
   Compiling futures-io v0.3.26
   Compiling xml-rs v0.8.4
   Compiling hashbrown v0.12.3
   Compiling serde_json v1.0.93
   Compiling native-tls v0.2.11
   Compiling futures-channel v0.3.26
   Compiling ryu v1.0.12
   Compiling httparse v1.8.0
   Compiling tinyvec_macros v0.1.1
   Compiling futures-sink v0.3.26
   Compiling tokio-util v0.7.7
   Compiling tinyvec v1.6.0
   Compiling openssl-macros v0.1.0
   Compiling wayland-scanner v0.24.1
   Compiling maybe-uninit v2.0.0
   Compiling try-lock v0.2.4
   Compiling openssl-probe v0.1.5
   Compiling percent-encoding v2.2.0
   Compiling void v1.0.2
   Compiling h2 v0.3.15
   Compiling form_urlencoded v1.1.0
   Compiling want v0.3.0
   Compiling unicode-normalization v0.1.22
   Compiling http-body v0.4.5
   Compiling serde_derive_internals v0.26.0
   Compiling rand v0.4.6
   Compiling time v0.1.45
   Compiling io-lifetimes v1.0.5
   Compiling schemars v0.8.12
   Compiling tower-service v0.3.2
   Compiling iana-time-zone v0.1.53
   Compiling unicode-bidi v0.3.10
   Compiling httpdate v1.0.2
   Compiling nix v0.15.0
   Compiling hyper v0.14.24
   Compiling idna v0.3.0
   Compiling chrono v0.4.23
   Compiling schemars_derive v0.8.12
   Compiling rand v0.3.23
   Compiling tokio-native-tls v0.3.1
   Compiling dyn-clone v1.0.10
   Compiling nix v0.11.1
   Compiling gcc v0.3.55
   Compiling rustix v0.36.8
   Compiling rustc-serialize v0.3.24
error[E0310]: the parameter type `T` may not live long enough
    --> /home/rp/.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
    --> /usr/src/debug/rust/rustc-1.78.0-src/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>
     |                    +++++++++

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...
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: aw-watcher-window-wayland-git-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
aw-watcher-window-wayland-git - exit status 4
emmggi commented 4 months ago

Oh now I see. Gnome is not supported.

emmggi commented 4 months ago

I installed this through AUR, the gnome extension and a few other watchers.