Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 626742 - dev-lang/rust should check for disk space in /var/tmp/portage
Summary: dev-lang/rust should check for disk space in /var/tmp/portage
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Rust Project
URL:
Whiteboard:
Keywords:
: 654410 671508 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-08-01 07:25 UTC by Vadim A. Misbakh-Soloviov (mva)
Modified: 2021-01-07 18:50 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
rust-1.26.1 with check-reqs (checkreqs.diff,270 bytes, patch)
2018-06-05 18:55 UTC, gibix
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2017-08-01 07:25:00 UTC
Hi there!
I've constantly failing builds of dev-lang/rust (with overflowed /var/tmp/portage tmpfs) on some <8GB RAM machines.
It seems, it is not enough to have 3 GB "disk" space for it to build, so it is needed to add proper disk space check like for firefox and libreoffice.
Comment 1 Sebastian Hamann 2018-05-12 08:48:31 UTC
To add some numbers: My /var/tmp/portage is 4GB, which is not enough for dev-lang/rust-1.25.0. It was sufficient to build dev-lang/rust-1.23.0-r1, though.
Comment 2 tt_1 2018-05-19 11:08:30 UTC
rust-1.26.0 needs at least 6.2G with amd64, but an attempt to fix this via check-reqs.eclass broke the python detection of the ebuilds. 

if you are able to come up with a patch, please attach it.
Comment 3 gibix 2018-06-05 18:55:15 UTC
Created attachment 534992 [details, diff]
rust-1.26.1 with check-reqs
Comment 4 tt_1 2018-06-05 19:27:37 UTC
Please don't enable the check for ram size, the check-reqs eclass doesn't recognize swap space and it would break the build on x86, and propably some other 32bit arches such as armv6/7 

On the other hand, there is a minimum amount of free ram needed for compilation of rustc itself - propably around 750mb should be free on arm, regardless of the amount of swap added, otherwise it may never come to an end. 

Can you provide a better diff, where one can see in which part of the ebuild you're calling the checks? Right now it looks as if you're doing that even before the inherit command, just wonder wether that is a reasonable idea?
Comment 5 gibix 2018-06-05 19:34:23 UTC
yep, I never used check-reqs and I just copied from another ebuild, the variables are set just before the inherit. I saw that is a quite common pattern in ebuilds.

Good to know about x86/arm constraints.
Comment 6 Ben 2018-10-30 20:15:59 UTC
Probably the same issue as https://bugs.gentoo.org/show_bug.cgi?id=654410

I would say the physical/virtual memory checks are hard to gauge due to the aforementioned swap as well as which jobs land on that machine at the time when using -j.

However the disk space check would be good, I just had 1.29.1 fail when 1.28 worked fine in 5GB.  I was okay since rust's main consumer (namely firefox) also had a disk check.  Now that rust now apparently exceeds Firefox's check, I had a nasty surprise.
Comment 7 Michael Cook 2018-11-14 20:51:42 UTC
ran out of space with 6.5 GB /var/tmp/portage It was the only package at that time.
Comment 8 jeremy mills 2018-11-15 01:00:42 UTC
im not sure how much rust actually needs. Less than 12gb i can tell you that. ill try to monitor how much it uses next time it builds but i have a 12gb tmpfs and it builds fine there...well latest has file collisions but thats completely unrelated. not much help i know but i figured id contribute what i know so far.
Comment 9 tt_1 2018-11-15 05:48:49 UTC
Last I tried was rust-1.28.0, it consumed 7.8 Gb in tmpfolder on amd64. No special cflags or debug involved.
Comment 10 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-15 10:37:46 UTC
*** Bug 654410 has been marked as a duplicate of this bug. ***
Comment 11 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-19 15:44:11 UTC
*** Bug 671508 has been marked as a duplicate of this bug. ***
Comment 12 Larry the Git Cow gentoo-dev 2018-11-19 16:42:13 UTC
The bug has been closed via the following commit(s):

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

commit c0718dbc84ed51edd184446fc0d9cde7195e25a0
Author:     Dirkjan Ochtman <djc@gentoo.org>
AuthorDate: 2018-11-19 16:41:47 +0000
Commit:     Dirkjan Ochtman <djc@gentoo.org>
CommitDate: 2018-11-19 16:42:01 +0000

    dev-lang/rust: check reqs, ewarn about cargo symlink
    
    Fixes: https://bugs.gentoo.org/626134
    Fixes: https://bugs.gentoo.org/626742
    Fixes: https://bugs.gentoo.org/663354
    Fixes: https://bugs.gentoo.org/671182
    Signed-off-by: Dirkjan Ochtman <djc@gentoo.org>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11

 dev-lang/rust/rust-1.30.1-r1.ebuild | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
Comment 13 yves.caniou 2021-01-07 09:05:13 UTC
As of today, emerging rust checks for at least 10752 MiB disk space at "/var/tmp/portage/dev-lang/rust-1.47.0-r2/temp", but it seems that it isn't enough space for dev-lang/rust-1.47.0-r2 whose emerge ends with:

Exception in callback PipeLogger._io_loop_done(<Future finis...t on device')>)
handle: <Handle PipeLogger._io_loop_done(<Future finis...t on device')>)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.8/site-packages/portage/util/_async/PipeLogger.py", line 143, in _io_loop_done
    future.result()
  File "/usr/lib/python3.8/site-packages/portage/util/futures/compat_coroutine.py", line 124, in _next
    future = self._generator.send(previous.result())
  File "/usr/lib/python3.8/site-packages/portage/util/_async/PipeLogger.py", line 139, in _io_loop
    log_file.flush()
OSError: [Errno 28] No space left on device

and

tmpfs               12G     12G     0 100% /var/tmp/portage
Comment 14 jeremy mills 2021-01-07 10:08:16 UTC
(In reply to yves.caniou from comment #13)
> As of today, emerging rust checks for at least 10752 MiB disk space at
> "/var/tmp/portage/dev-lang/rust-1.47.0-r2/temp", but it seems that it isn't
> enough space for dev-lang/rust-1.47.0-r2 whose emerge ends with:
> 
> Exception in callback PipeLogger._io_loop_done(<Future finis...t on
> device')>)
> handle: <Handle PipeLogger._io_loop_done(<Future finis...t on device')>)>
> Traceback (most recent call last):
>   File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
>     self._context.run(self._callback, *self._args)
>   File "/usr/lib/python3.8/site-packages/portage/util/_async/PipeLogger.py",
> line 143, in _io_loop_done
>     future.result()
>   File
> "/usr/lib/python3.8/site-packages/portage/util/futures/compat_coroutine.py",
> line 124, in _next
>     future = self._generator.send(previous.result())
>   File "/usr/lib/python3.8/site-packages/portage/util/_async/PipeLogger.py",
> line 139, in _io_loop
>     log_file.flush()
> OSError: [Errno 28] No space left on device
> 
> and
> 
> tmpfs               12G     12G     0 100% /var/tmp/portage

I had to increase it to 14gb and that was still just barely enough. Its not as bad on ~amd64 keywords systems because you can set system-bootstrap system-llvm use flags which make it use far less.
Comment 15 yves.caniou 2021-01-07 18:50:56 UTC
(In reply to jeremy mills from comment #14)

> I had to increase it to 14gb and that was still just barely enough. Its not
> as bad on ~amd64 keywords systems because you can set system-bootstrap
> system-llvm use flags which make it use far less.

I confirm. I increased to more, but "monitored" the disk usage:
tmpfs               19G     13G  6,7G  65% /var/tmp/portage