rfd icon indicating copy to clipboard operation
rfd copied to clipboard

Major compilation time regression going from 1.71.0 to 1.72.0 with feature xdg-portal in release mode

Open wiiznokes opened this issue 11 months ago • 14 comments

compilation is stuck indefinitely on rfd:

   Compiling rfd v0.11.4
    Building [=======================> ] 425/427: rfd 
rustc --version
rustc 1.73.0-nightly (864bdf784 2023-07-25)

in Cargo.toml: rfd = { version = "0.11.4", default-features = false, features = ["xdg-portal"] }

I'm on Fedora 38, Gnome.

it's weird because one month before that, my project worked successfully , event if i havn't change anything

wiiznokes avatar Jul 27 '23 21:07 wiiznokes

my CPU is at 100% utilization

wiiznokes avatar Jul 27 '23 21:07 wiiznokes

meet the same problems when running cargo b -r --verbose also set default-features = false, features = ["xdg-portal"]

Sherlock-Holo avatar Aug 07 '23 07:08 Sherlock-Holo

rfd takes 10min to build.... why it takes too long time, I am using i7-9700 and althrough it is an old CPU but it still an i7

Sherlock-Holo avatar Aug 07 '23 07:08 Sherlock-Holo

Please run with --timings and supply the output: For example this is my output for stable 1.71.0 (cargo build --release --timings --no-default-features --features xdg-portalr): image

PolyMeilex avatar Aug 07 '23 10:08 PolyMeilex

image

rfd v0.11.4 562.8s 561.9s (100%) ashpd, pollster, urlencoding, xdg-portal

rustc 1.73.0-nightly (f3623871c 2023-08-06) when I build my project, the rfd takes 562s

Sherlock-Holo avatar Aug 08 '23 03:08 Sherlock-Holo

Same issue for me on Arch + i9-12900HK:

rfd = { version = "0.11.4", default_features = false, features = [
  "xdg-portal",
] }

takes about 10 minutes to build.

teh-cmc avatar Aug 26 '23 08:08 teh-cmc

Same issue for me on Arch + i9-12900HK:

rfd = { version = "0.11.4", default_features = false, features = [
  "xdg-portal",
] }

takes about 10 minutes to build.

Are you on nightly as well?

Also does this happen on master as well?

PolyMeilex avatar Aug 26 '23 09:08 PolyMeilex

Latest stable (1.72).

I cannot run any more tests right now, but something extremely fishy seems to be going on... This seems to only be a problem when rfd is used as a transitive dependency (?!) :exploding_head:

I also have no clue why it's appearing twice for the same exact version now... image

I'll have to run more tests later :shrug:

teh-cmc avatar Aug 26 '23 10:08 teh-cmc

Ok, got it, reproduced by building this code snippet in release:

use ashpd::desktop::file_chooser::SaveFileRequest;
use std::future::Future;

struct SomeStruct;

pub trait SomeTrait {
    fn some_method(self) -> Box<dyn Future<Output = ()>>;
}

impl SomeTrait for SomeStruct {
    fn some_method(self) -> Box<dyn Future<Output = ()>> {
        Box::new(async move {
            SaveFileRequest::default().send().await.ok();
        })
    }
}

It takes 96.0s Not sure if I can do anything about that tbh, will report in aspd for now, but rustc bug report is probably more appropriate.

PolyMeilex avatar Aug 28 '23 22:08 PolyMeilex

So... it works in 1.71 And will not work until 1.73 probably, rustc issue https://github.com/rust-lang/rust/issues/115297

PolyMeilex avatar Aug 29 '23 16:08 PolyMeilex

I can confirm that compilation works again on nightly. Should work in 1.73 then :D

mo8it avatar Sep 14 '23 15:09 mo8it

Thanks, good to know

PolyMeilex avatar Sep 14 '23 17:09 PolyMeilex

Most likely fixed in new rust version https://blog.rust-lang.org/2023/09/19/Rust-1.72.1.html

PolyMeilex avatar Sep 19 '23 19:09 PolyMeilex

Above PR seems to confirm that this issue can be closed now. :-)

bjorn avatar Nov 10 '23 08:11 bjorn