You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Installing docs with x.py install is very slow. #80684
The underlying command is: sh /home/vext01/source/rust/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/rust-docs-1.51.0-dev-x86_64-unknown-linux-gnu/install.sh --prefix=/home/vext01/source/rust/build/ykrustc-stage2-latest --sysconfdir=build/ykrustc-stage2-latest/etc --datadir=build/ykrustc-stage2-latest/share --docdir=build/ykrustc-stage2-latest/share/doc/rust --bindir=build/ykrustc-stage2-latest/bin --libdir=build/ykrustc-stage2-latest/lib --mandir=build/ykrustc-stage2-latest/share/man --disable-ldconfig
Adding this to the config seems to work around the hang:
I don't remember exactly how long it takes, but it doesn't depend on the speed of the disk. install.sh is just really inefficient. You can see if it's actually hanging by checking the contents of lib/rustlib/install.log this command while it's installing:
I took a look into this. The main issue is that the generated install.sh is very inefficient; it takes about 5 minutes to copy 2500 files (there are more than 2500, but I got bored and cancelled it). @pietroalbini@Mark-Simulacrum what do you think about rewriting this inner loop in Rust so it's not launching so many external processes?
This issue is compounded on macOS, where it seems to be even more inefficient to launch lots of processes from a shell. Sorry I don't have timings, but it takes tens of minutes at least for this step [edit: over an hour]; long enough that I would expect most users who are trying to build our software from source in macOS (it's Zcash, which installs a pinned version of Rust in order to build) are likely to think it's hanging and give up.
I think the problem may largely be that the manifest.in generated for rust-docs component (at least) is a file: list instead of using the directory: command; directory commands should be much more efficient. This change may be a recent(ish) regression; I suspect that fixing that is likely the right solution here.
We solved our problem for Zcash by just not installing rust-docs (passing --without=rust-docs to install.sh). This reduced our total build time on macOS from 95 minutes to 27 minutes! Obviously it doesn't solve the underlying issue.
Activity
emilyalbini commentedon Jan 4, 2021
How long did you let the command run before killing it? I remember installing the docs taking a long time last time I did it.
vext01 commentedon Jan 4, 2021
I left it for half an hour or so IIRC. I'll run it for longer and see if it goes away.
How long do you think it should take to install on a modern SSD?
emilyalbini commentedon Jan 4, 2021
I don't remember exactly how long it takes, but it doesn't depend on the speed of the disk.
install.shis just really inefficient. You can see if it's actually hanging by checking the contents oflib/rustlib/install.logthis command while it's installing:vext01 commentedon Jan 4, 2021
The log file is empty, but I can see new files appearing on the disk (using
findanddiff) so progress must be occurring. Slowly.vext01 commentedon Jan 4, 2021
It's been about 40 minutes now. It seems to be adding files to
build/tmp/empty_dir/is that right?vext01 commentedon Jan 4, 2021
So it's just very slow.
[-]`x.py install` hangs installing docs.[/-][+]Installing docs with `x.py install` is very slow.[/+]jyn514 commentedon Feb 14, 2021
I took a look into this. The main issue is that the generated
install.shis very inefficient; it takes about 5 minutes to copy 2500 files (there are more than 2500, but I got bored and cancelled it). @pietroalbini @Mark-Simulacrum what do you think about rewriting this inner loop in Rust so it's not launching so many external processes?https://github.com/rust-lang/rust-installer/blob/5254dbfd25d5284728ab624dca1969d61427a0db/install-template.sh#L548
daira commentedon Mar 31, 2021
This issue is compounded on macOS, where it seems to be even more inefficient to launch lots of processes from a shell. Sorry I don't have timings, but it takes tens of minutes at least for this step [edit: over an hour]; long enough that I would expect most users who are trying to build our software from source in macOS (it's Zcash, which installs a pinned version of Rust in order to build) are likely to think it's hanging and give up.
Mark-Simulacrum commentedon Mar 31, 2021
I think the problem may largely be that the manifest.in generated for rust-docs component (at least) is a file: list instead of using the directory: command; directory commands should be much more efficient. This change may be a recent(ish) regression; I suspect that fixing that is likely the right solution here.
jyn514 commentedon Mar 31, 2021
Oops I forgot to link back here: we discussed this briefly on Zulip and it was difficult to do in a cross-platform way.
daira commentedon Apr 1, 2021
We solved our problem for Zcash by just not installing rust-docs (passing
--without=rust-docstoinstall.sh). This reduced our total build time on macOS from 95 minutes to 27 minutes! Obviously it doesn't solve the underlying issue.12 remaining items
rust-installer/install-template.sh: improve efficiency, step 1.
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of rust-lang#145809 - he32:installer-perf-fix-1, r=Mark-Si…
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of rust-lang#145809 - he32:installer-perf-fix-1, r=Mark-Si…
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum
Auto merge of #145809 - he32:installer-perf-fix-1, r=Mark-Simulacrum