Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 783468

Summary: =dev-lang/rust-1.51.0 hangs in src_prepare while installing rust-docs for around 10 minutes
Product: Gentoo Linux Reporter: tt_1 <herrtimson>
Component: Current packagesAssignee: Georgy Yakovlev <gyakovlev>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo, rust, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/rust-lang/rust/issues/80684
Whiteboard:
Package list:
Runtime testing required: ---

Description tt_1 2021-04-17 18:43:52 UTC
here is the build log: 

 * rustc-1.51.0-src.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                           [ ok ]
 * rust-1.50.0-x86_64-unknown-linux-gnu.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                       [ ok ]
 * checking ebuild checksums ;-) ...                                                                                                                                             [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                                            [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                                           [ ok ]
 * Checking for at least 9472 MiB disk space at "/var/tmp/portage/dev-lang/rust-1.51.0/temp" ...                                                                                 [ ok ]
 * Checking for at least 9472 MiB disk space at "/var/tmp/portage/dev-lang/rust-1.51.0/temp" ...                                                                                 [ ok ]
 * Using python3.8 to build
>>> Unpacking source...
>>> Unpacking rustc-1.51.0-src.tar.xz to /var/tmp/portage/dev-lang/rust-1.51.0/work
>>> Unpacking rust-1.50.0-x86_64-unknown-linux-gnu.tar.xz to /var/tmp/portage/dev-lang/rust-1.51.0/work
>>> Source unpacked in /var/tmp/portage/dev-lang/rust-1.51.0/work
>>> Preparing source in /var/tmp/portage/dev-lang/rust-1.51.0/work/rustc-1.51.0-src ...
install: creating uninstall script at /var/tmp/portage/dev-lang/rust-1.51.0/work/rust-stage0/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: installing component 'cargo'
install: installing component 'rls-preview'
install: installing component 'rust-analyzer-preview'
install: installing component 'clippy-preview'
install: installing component 'miri-preview'
install: installing component 'rustfmt-preview'
install: installing component 'llvm-tools-preview'
install: installing component 'rust-analysis-x86_64-unknown-linux-gnu'
install: installing component 'rust-std-x86_64-unknown-linux-gnu'
install: installing component 'rust-docs'

the build hangs here for about 10 minutes, while eating around 10% of cpu time from 12 cores, so a bit more than one core. 

there are no consequences for the build, it resumes fine once it has finished. 

please note: this unpacks to a ramdisk: 

$ cat /etc/fstab

tmpfs		/var/tmp/portage		tmpfs	size=16G,uid=portage,gid=portage,mode=775,noatime	0 0

but its the same problem on another machine with ext4 fs
Comment 1 Morton Pellung 2021-04-17 22:47:58 UTC
upstream bug: https://github.com/rust-lang/rust/issues/80684
Comment 2 tt_1 2021-04-18 07:03:44 UTC
given that USE="doc" is broken anyway and thus masked, it seems reasonable to me to pass --without=rust-docs for now to =dev-lang/rust-1.51.0-r1, right?
Comment 3 Georgy Yakovlev archtester gentoo-dev 2021-04-18 10:47:21 UTC
yeah, docs have been failing randomly since 1.47 for some reason, maybe we need to disable compiler-docs to make it work.


USE=-doc should already disable docs, is not it the case?

USE=-doc will set
[build]
docs = false
compiler-docs = false


which should be equivalent to passing --without=rust-docs, is not it?

we try to use mostly config.toml style configuration, and not x.py args
Comment 4 tt_1 2021-04-18 11:03:09 UTC
The ebuild hangs in src_prepare, while installing the components from stage0 into work/rust-stage0/ for bootstraping: 

install: installing component 'rustc'
install: installing component 'cargo'
install: installing component 'rls-preview'
install: installing component 'rust-analyzer-preview'
install: installing component 'clippy-preview'
install: installing component 'miri-preview'
install: installing component 'rustfmt-preview'
install: installing component 'llvm-tools-preview'
install: installing component 'rust-analysis-x86_64-unknown-linux-gnu'
install: installing component 'rust-std-x86_64-unknown-linux-gnu'
install: installing component 'rust-docs' <-- here it keeps hanging for around 10 minutes


According to the upstream issue it does hang as well for much longer when build with USE="+doc", but that would be in src_install I believe. 

to solve this without hotfixing via --without=rust-docs , upstream will have to push out a fixed stage0 tarball, which is propably not going to happen anytime soon.
Comment 5 Georgy Yakovlev archtester gentoo-dev 2021-04-18 11:08:35 UTC
ah that makes sense. it used to install minimal set before IRC, now it seems to install everything.

yeah, that can be easily fixed by only installing cargo, rustc and std, nothing else needed for bootstrap. absolutely no need for docs for bootstrapping.
Comment 6 Larry the Git Cow gentoo-dev 2021-04-18 11:20:07 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c46b01a2fac9c0472ee3cb7438ccdf2aa8287ae8

commit c46b01a2fac9c0472ee3cb7438ccdf2aa8287ae8
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-04-18 11:19:45 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-04-18 11:19:45 +0000

    dev-lang/rust: don't install docs component in bootstrap compiler
    
    Bug: https://bugs.gentoo.org/783468
    Package-Manager: Portage-3.0.18, Repoman-3.0.3
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-lang/rust/rust-1.51.0-r2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 7 Georgy Yakovlev archtester gentoo-dev 2021-04-18 11:21:17 UTC
ok I just used --without=rust-docs as suggested, because I don't have time to test what's needed for bootstrap, maybe clippy or needed for tests.
Comment 8 Larry the Git Cow gentoo-dev 2021-04-18 11:26:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78b40d2e6a9eb40ce44a8b1177bb759aa41d4f45

commit 78b40d2e6a9eb40ce44a8b1177bb759aa41d4f45
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-04-18 11:24:31 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-04-18 11:26:25 +0000

    dev-lang/rust: drop rust-1.51.0
    
    Bug: https://bugs.gentoo.org/782367
    Bug: https://bugs.gentoo.org/782799
    Closes: https://bugs.gentoo.org/783468
    
    Package-Manager: Portage-3.0.18, Repoman-3.0.3
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-lang/rust/rust-1.51.0.ebuild | 617 ---------------------------------------
 1 file changed, 617 deletions(-)
Comment 9 tt_1 2021-04-18 11:44:49 UTC
I'd suggest to leave the bug open and mark as in progress, since there will be an upstream fix for this trickeling down in the next few release cycles. 

also could be helpfull to add a little refering note to profiles/base/package.use.mask , where doc is masked
Comment 10 Georgy Yakovlev archtester gentoo-dev 2021-04-18 20:52:53 UTC
doc is masked for another reason =)
it fails to generate docs in src_compile and build fails, without even reaching src_install and possible delay.

and I don't think we'll ever want to change this part I've added. docs are not needed for bootstrap, no need to install ever.
Comment 11 tt_1 2021-05-05 12:57:36 UTC
the doc use flag has been unmasked for rust-1.51.0-r2, this issue may show again during src_install if USE=+doc is chosen. I don't have any use case for that config, but maybe you want to double check here?
Comment 12 Georgy Yakovlev archtester gentoo-dev 2021-05-05 15:13:26 UTC
patch is simple enough, will try to add it.

https://patch-diff.githubusercontent.com/raw/rust-lang/rust/pull/84289.patch


as for rust-bin, will need to patch generated install.sh
Comment 13 Larry the Git Cow gentoo-dev 2021-05-05 20:16:16 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f5f3024c3ef7506c3b3a496dc725f5e38ce5d626

commit f5f3024c3ef7506c3b3a496dc725f5e38ce5d626
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-05-05 15:19:21 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-05-05 20:15:44 +0000

    dev-lang/rust: greatly reduce documentation installation time
    
    Bug: https://bugs.gentoo.org/783468
    X-Upstream-Issue: https://github.com/rust-lang/rust/issues/80684
    X-Upstream-Fix: https://github.com/rust-lang/rust/pull/84289
    Package-Manager: Portage-3.0.18, Repoman-3.0.3
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-lang/rust/files/1.51.0-slow-doc-install.patch | 92 +++++++++++++++++++++++
 dev-lang/rust/rust-1.51.0-r2.ebuild               |  1 +
 2 files changed, 93 insertions(+)
Comment 14 tt_1 2021-05-09 17:46:35 UTC
(In reply to Georgy Yakovlev from comment #12)
> patch is simple enough, will try to add it.
> 
> https://patch-diff.githubusercontent.com/raw/rust-lang/rust/pull/84289.patch
> 
> 
> as for rust-bin, will need to patch generated install.sh


or you can maybe mask doc use again for rust-bin, until I believe rust-1.53.0 stages are released
Comment 15 Georgy Yakovlev archtester gentoo-dev 2021-05-09 20:50:21 UTC
I think having 10 minute delay, while not nice, still is not a failure.

doc was masked because it failed to build.
I will look at way fixing -bin, just lacking time.
it may be a simple manifest edit.
Comment 16 tt_1 2021-06-25 21:10:38 UTC
should be fixed in rust-bin-1.53.0 then, right?
Comment 17 Georgy Yakovlev archtester gentoo-dev 2021-06-25 22:11:47 UTC
looks like so, I've dropped the patch.
but I usually keep bugs open until affected ebuilds are gone or at least fixed ones are stable.
Comment 18 tt_1 2023-04-22 09:06:36 UTC
old bug, fixed upstream, closing