rfd
rfd copied to clipboard
Major compilation time regression going from 1.71.0 to 1.72.0 with feature xdg-portal in release mode
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
my CPU is at 100% utilization
meet the same problems when running cargo b -r --verbose
also set default-features = false, features = ["xdg-portal"]
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
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
):
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
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.
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?
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...
I'll have to run more tests later :shrug:
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.
So... it works in 1.71 And will not work until 1.73 probably, rustc issue https://github.com/rust-lang/rust/issues/115297
I can confirm that compilation works again on nightly. Should work in 1.73 then :D
Thanks, good to know
Most likely fixed in new rust version https://blog.rust-lang.org/2023/09/19/Rust-1.72.1.html
Above PR seems to confirm that this issue can be closed now. :-)