sfackler / rust-openssl

OpenSSL bindings for Rust
1.38k stars 740 forks source link

Very long build time of openssl-sys in the vendored configuration on windows #2269

Open R-Goc opened 1 month ago

R-Goc commented 1 month ago

When building gitui which has openssl-sys in the vendored version as a transitive dependency, the build time is very long. The CPU and RAM usage during the build is also extremely low. Compared to the rest of the build which takes around a minute the build for openssl-sys takes 13 minutes. Rust version: 1.79.0 1.82.0 OS/Distro + Version: Windows 11 Beta image I don't recall this being an issue a few months ago when I last build gitui. https://github.com/extrawurst/gitui/issues/2303 I can send more details if needed Initially it seems like the build step is not parallel, though it's probably more than that as even sequential compilation has higher cpu usage than what there is when building this crate.

R-Goc commented 1 month ago

Looking at task manager during build, there is only one instance of cl.exe (not sure why cargo chooses cl, there is clang in path as well, if there is a way to specify clang in config.toml I would prefer that), which is at a very low cpu and mem usage: image it also disappears and reappears quite frequently, with breaks of around 1 second in between.