marhkb / pods

Keep track of your podman containers
GNU General Public License v3.0
728 stars 12 forks source link

Pods 1.2.2 fails to build from source #691

Closed SoftExpert closed 1 year ago

SoftExpert commented 1 year ago

Hello,

When rebuilding from source with the AUR package we are getting the following errors, and the build fails:

   Compiling pods v1.2.2 (/~/git/AUR/pods/src/pods-1.2.2)
error[E0282]: type annotations needed for `std::result::Result<_, E>`
   --> src/view/container/commit_page.rs:187:47
    |
187 |             clone!(@weak self as obj => move |user_info| {
    |                                               ^^^^^^^^^
188 |                 match user_info {
189 |                     Ok(user_info) => obj.imp().author_entry_row.set_text(user_info.name()),
    |                                                                          --------- type must be known at this point
    |
help: consider giving this closure parameter an explicit type, where the placeholders `_` are specified
    |
187 |             clone!(@weak self as obj => move |user_info: std::result::Result<_, E>| {
    |                                                        +++++++++++++++++++++++++++

error[E0282]: type annotations needed for `std::result::Result<_, E>`
   --> src/model/action.rs:416:39
    |
416 |             clone!(@weak obj => move |result| if let Ok(result) = result {
    |                                       ^^^^^^
417 |                 match result.as_ref() {
    |                       ------ type must be known at this point
    |
help: consider giving this closure parameter an explicit type, where the placeholders `_` are specified
    |
416 |             clone!(@weak obj => move |result: std::result::Result<_, E>| if let Ok(result) = result {
    |                                             +++++++++++++++++++++++++++

error[E0282]: type annotations needed for `std::result::Result<std::result::Result<_, E>, E>`
   --> src/model/action.rs:498:56
    |
498 |             clone!(@weak obj, @weak container => move |result| if let Ok(result) = result {
    |                                                        ^^^^^^
...
506 |                             stream::Abortable::new(ar.into_inner(), abort_registration),
    |                                                    -- type must be known at this point
    |
help: consider giving this closure parameter an explicit type, where the placeholders `_` are specified
    |
498 |             clone!(@weak obj, @weak container => move |result: std::result::Result<std::result::Result<_, E>, E>| if let Ok(result) = result {
    |                                                              +++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0282]: type annotations needed for `std::result::Result<_, E>`
   --> src/model/client.rs:179:43
    |
179 |                 clone!(@weak obj => move |info| match info {
    |                                           ^^^^
180 |                     Ok(info) => {
181 |                         obj.set_version(info.version.unwrap().version);
    |                                         ---- type must be known at this point
    |
help: consider giving this closure parameter an explicit type, where the placeholders `_` are specified
    |
179 |                 clone!(@weak obj => move |info: std::result::Result<_, E>| match info {
    |                                               +++++++++++++++++++++++++++

error[E0282]: type annotations needed for `std::result::Result<T, _>`
   --> src/view/container/health_check_page.rs:233:51
    |
233 |                 clone!(@weak self as obj => move |result| if let Err(e) = result {
    |                                                   ^^^^^^
...
237 |                         &e.to_string()
    |                          - type must be known at this point
    |
help: consider giving this closure parameter an explicit type, where the placeholders `_` are specified
    |
233 |                 clone!(@weak self as obj => move |result: std::result::Result<T, _>| if let Err(e) = result {
    |                                                         +++++++++++++++++++++++++++

error[E0282]: type annotations needed for `std::result::Result<T, E>`
   --> src/view/repo_tag/add_dialog.rs:112:67
    |
112 | ...                   clone!(@weak obj => move |result| match result {
    |                                                 ^^^^^^
...
118 | ...                           obj.set_error(&e.to_string());
    |                                              - type must be known at this point
    |
help: consider giving this closure parameter an explicit type, where the placeholders `_` are specified
    |
112 |                                         clone!(@weak obj => move |result: std::result::Result<T, E>| match result {
    |                                                                         +++++++++++++++++++++++++++

error[E0282]: type annotations needed for `std::option::Option<std::result::Result<push_page::RegistryAuth, E>>`
   --> src/view/repo_tag/push_page.rs:146:55
    |
146 | ...                   clone!(@weak obj => move |maybe| {
    |                                                 ^^^^^
...
174 | ...                                       &e.to_string()
    |                                            - type must be known at this point
    |
help: consider giving this closure parameter an explicit type, where the placeholders `_` are specified
    |
146 |                             clone!(@weak obj => move |maybe: std::option::Option<std::result::Result<push_page::RegistryAuth, E>>| {
    |                                                            ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0282]: type annotations needed for `std::result::Result<T, _>`
   --> src/view/repo_tag/row.rs:190:55
    |
190 |                     clone!(@weak self as obj => move |result| if let Err(e) = result {
    |                                                       ^^^^^^
...
198 |                             &e.to_string()
    |                              - type must be known at this point
    |
help: consider giving this closure parameter an explicit type, where the placeholders `_` are specified
    |
190 |                     clone!(@weak self as obj => move |result: std::result::Result<T, _>| if let Err(e) = result {
    |                                                             +++++++++++++++++++++++++++

For more information about this error, try `rustc --explain E0282`.
error: could not compile `pods` (bin "pods") due to 8 previous errors
FAILED: src/pods 
/usr/bin/env CARGO_HOME=/~/git/AUR/pods/src/build/cargo-home /usr/bin/cargo build --manifest-path /~/git/AUR/pods/src/pods-1.2.2/Cargo.toml --target-dir /~/git/AUR/pods/src/build/src --release && cp src/release/pods src/pods
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
    Aborting...

Here is the relevant build context:

export RUSTUP_TOOLCHAIN=stable
arch-meson "$pkgname-$pkgver" build
meson compile -C build

Any idea of what is wrong with this version ?

Best regards, SoftExpert

marhkb commented 1 year ago

Yes this is known. It's a rust compiler regression introduced in 1.70.0.

https://github.com/rust-lang/rust/issues/112225

You either have to wait for the fix to be released or use 1.69.0 in the meantime.

marhkb commented 1 year ago

rust 1.71 has been released, which fixes this.