Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 783768 - dev-lang/rust-1.51.0-r2: No space left on device
Summary: dev-lang/rust-1.51.0-r2: No space left on device
Status: CONFIRMED
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:
: 788094 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-04-18 12:27 UTC by Andrew Nowa Ammerlaan
Modified: 2024-02-14 10:26 UTC (History)
16 users (show)

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


Attachments
build.log (build.log.lzma,420.63 KB, text/plain)
2021-05-16 19:49 UTC, Erik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Nowa Ammerlaan gentoo-dev 2021-04-18 12:27:27 UTC
Compiling rust-1.51.0 fails on a 16G tmpfs with No Space left on Device:

ABI_X86="32 64"
CPU_FLAGS_X86="sse2"
LLVM_TARGETS="AMDGPU X86"
All other USE flags disabled.

Seems to me that the CHECKREQS_DISK_BUILD should be a bit higher.

Currently re-trying with a 20G tmpfs, will report back when it's done
Comment 1 tt_1 2021-04-18 12:33:21 UTC
propably due to your multilib setup, the calculation did work just fine for me with the same setup of 16gb tmpfs ramdisk
Comment 2 Andrew Nowa Ammerlaan gentoo-dev 2021-04-18 12:38:43 UTC
Could we then maybe have something like:
M=$(( $(usex abi_x86_32 some-extra-bytes 0) + ${M} )) ?
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-04-18 12:40:02 UTC
 * Final size of build directory: 12793912 KiB ( 12.2 GiB)
 * Final size of installed tree:    367192 KiB (358.5 MiB)

while it's checking for 7G...
Comment 4 Andrew Nowa Ammerlaan gentoo-dev 2021-04-18 13:13:48 UTC
With the configuration mentioned above I have:

* Final size of build directory: 17293288 KiB ( 16.4 GiB)
* Final size of installed tree:    464408 KiB (453.5 MiB)
Comment 5 tt_1 2021-04-18 13:48:46 UTC
its a bit off, yes: 

>>> Running pre-merge checks for dev-lang/rust-1.51.0-r2
 * Checking for at least 7424 MiB disk space at "/var/tmp/portage/dev-lang/rust-1.51.0-r2/temp" ...                                                                          [ ok ]

[removed log]

 * Final size of build directory: 11160124 KiB ( 10.6 GiB)
 * Final size of installed tree:    337776 KiB (329.8 MiB)


with these useflags: 

[ebuild   R   ~] dev-lang/rust-1.51.0-r2:stable/1.51::gentoo  USE="rustfmt system-llvm -clippy -debug (-doc) (-libressl) (-miri) -nightly -parallel-compiler -rls -system-bootstrap -test -wasm" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="sse2" LLVM_TARGETS="AArch64 (X86) -AMDGPU -ARM -AVR -BPF -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -WebAssembly -XCore" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
Comment 6 Larry the Git Cow gentoo-dev 2021-04-18 20:47:08 UTC
The bug has been referenced in the following commit(s):

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

commit d9b6bf437b114de25fcc7807bfb97736ede1305c
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-04-18 20:46:21 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-04-18 20:46:35 +0000

    dev-lang/rust: account for enabled llvm_targets in requirements check
    
    Bug: https://bugs.gentoo.org/783768
    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 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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

commit dd6c8840fda3cd0afc628c4f753d41ead44cc0e7
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-04-18 20:03:22 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-04-18 20:46:34 +0000

    dev-lang/rust: bump build disk requirements for 1.51.0-r2
    
    Bug: https://bugs.gentoo.org/783768
    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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 7 Georgy Yakovlev archtester gentoo-dev 2021-04-18 20:47:57 UTC
(In reply to tt_1 from comment #5)
> its a bit off, yes: 
> 
> >>> Running pre-merge checks for dev-lang/rust-1.51.0-r2
>  * Checking for at least 7424 MiB disk space at
> "/var/tmp/portage/dev-lang/rust-1.51.0-r2/temp" ...                         
> [ ok ]
> 
> [removed log]
> 
>  * Final size of build directory: 11160124 KiB ( 10.6 GiB)
>  * Final size of installed tree:    337776 KiB (329.8 MiB)
> 
> 
> with these useflags: 
> 
> [ebuild   R   ~] dev-lang/rust-1.51.0-r2:stable/1.51::gentoo  USE="rustfmt
> system-llvm -clippy -debug (-doc) (-libressl) (-miri) -nightly
> -parallel-compiler -rls -system-bootstrap -test -wasm" ABI_X86="(64) -32
> (-x32)" CPU_FLAGS_X86="sse2" LLVM_TARGETS="AArch64 (X86) -AMDGPU -ARM -AVR
> -BPF -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ
> -WebAssembly -XCore" 0 KiB
> 
> Total: 1 package (1 reinstall), Size of downloads: 0 KiB

if you are doing cross - it's completely unaccounted for in requirements check.
Comment 8 tt_1 2021-04-18 20:52:53 UTC
> if you are doing cross - it's completely unaccounted for in requirements
> check.

that's ok by me, no problem here.
Comment 9 Manfred Knick 2021-04-24 11:10:56 UTC
$ grep "/var/tmp" /etc/fstab

  tmpfs   /var/tmp   tmpfs   size=16G   02           <--- /var/tmp/portage/


Enlarging from already provided 12G to 16G (!) 
allowed in-memory-emerge to succeed again.

To me, this greed of size feels insane in the first place.
Comment 10 Jan Sever 2021-04-26 10:02:31 UTC
What? 16G only for compiling a compiler? Are Mozilla's developers mad? I remember being able to compile the whole system (incl. FF&TB&LO) within 16G (booting into memory and compiling chrooted) a year ago.

Of course I had to do a lot of precautions because of rust: removing all unneeded packages, compiling rust within 9G (that time) into binary packages and merging into a complete system afterwards. The same applied for libreoffice then.

Hence I bought another 16G memory module (to avoid these limitations) and thought it would always be enough and now I'm hitting the limits again since rust parallel compilation also requires a huge amount of memory.

Can anyone teach their developers to program? If gcc was programmed the same way (taking exponentially larger disk space with every release), we would compile now within far more than 100G!
Comment 11 Manfred Knick 2021-04-26 12:19:32 UTC
(In reply to Jan Sever from comment #10)

In the last years,
I have changed my re-build of the whole System to :


nice emerge -e  --usepkg n --keep-going --exclude "sys-devel/gcc"  system

nice emerge -e  --usepkg n --keep-going 
     --exclude "sys-devel/gcc
                dev-lang/rust
                dev-qt/qtwebengine   
                app-office/libreoffice
                www-client/firefox
                mail-client/thunderbird"
     world

nice emerge -1  --usepkg n --keep-going --jobs 1  --quiet-build y
                dev-lang/rust
                dev-qt/qtwebengine
                app-office/libreoffice
                www-client/firefox
                mail-client/thunderbird

in order to keep building "in-memory" working.
Comment 12 Andrew Nowa Ammerlaan gentoo-dev 2021-04-26 13:18:41 UTC
Pro-Tip: Set USE="system-llvm system-bootstrap"

system-llvm saves about 2G, and system-bootstrap saves about another 1G, (according to the values in the ebuild)
Comment 13 Michael Hofmann 2021-04-26 23:43:43 UTC
I emerged Rust yesterday on my amd64 machine:

# emerge --oneshot -av rust

[ebuild   R    ] dev-lang/rust-1.51.0-r2:stable/1.51::gentoo  USE="-clippy -debug (-doc) (-libressl) (-miri) (-nightly) (-parallel-compiler) -rls -rustfmt (-system-bootstrap) (-system-llvm) -test -wasm" CPU_FLAGS_X86="sse2" LLVM_TARGETS="(X86) -AArch64 -AMDGPU -ARM -AVR -BPF -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -WebAssembly -XCore" 0 KiB

emerge told me: Checking for at least 11520 MiB...

A script was running that reported used disk space in /var/tmp/portage every 20 seconds. It reported up to 7.5 GB used disk space, but not more. Emerge seems to estimate 50% more disk space than required.
Comment 14 Michael Hofmann 2021-04-26 23:50:40 UTC
Please ignore my last post. I was wrong. 

Emerge told me: Checking for at least 11520 MiB...

and up to 13.7 GB were used. Emerge *underestimated* disk space by 20%.
Comment 15 Georgy Yakovlev archtester gentoo-dev 2021-04-27 06:25:44 UTC
I tried very hard to make calculations accurate but some variables still sneak in and screw up the results.

can do better, but ENEEDMOARDATA

now, to calculate all possible flags and combinations rust needs to be built a lot of times.

we have 14 useflags, 17 llvm targets, multilib flag and 5 supported arches, not counting debug flags and -march flags variants. also not counting that on systems with 64K page size each inode takes at least 64K in tmpfs, and not 4K like one may think.

that's 32 build variants.

to test all build combinations and measure all possible values unconditionally the stupid brute force way we need to build rust factorial(32) times.

that's 263130836933693530167218012160000000 times.

let that sink in.

I'd be done by the heat death of the universe, maybe, just maybe.


ok, let's calculate more realistic scenario.
function currently checks 11 scenarios.

that's "just" 39916800 build variants.
I can still take some shortcuts and reduce number of rebuilds, and ofc some space values are easy to predict, but even low number of combinations (4) requires to do a full rebuild about 20 times.


rant over.

if you want it to be more accurate, I'd appreciate if you post the following info:
1) real space used ( du -hs /var/tmp/portage/dev-lang/rust* and du -hs --apparent-size /var/tmp/portage/dev-lang/rust* output, ran as root) 
2) ebuild's predicted value.
3) emerge --info. ( I need use-flags, c(xx)flags, rustflags at minimum )
4) any weird info that can help. filesystem type for build dir, page size (if not standard 4K and tmpfs), anything I missed.

that will help, just ranting will not.
Comment 16 Manfred Knick 2021-04-27 07:28:39 UTC
(In reply to Georgy Yakovlev from comment #15)
...
> that will help, just ranting will not.

Georgy, any blame about the current situation 
definitely should not be directed to *you*.

As indicated in comment 11, there is a more general issue:
   Having some "monsters" around, how to cope with them ?

- EWARN like "May need between 8 and 16 GB to compile" ?

- introduce a mechanism (USE flag?) to make sure that 
  these packages can only be emerged in "single job" mode only ?

Because, even if you calculate rust's need exactly to the last byte, and that size is just provided at the time of your calculation = at the beginning of rust's emerge, most probably it will fail against any concurrent emerge starting during rust's lengthy emerge time.
Comment 17 Maciej Mrozowski gentoo-dev 2021-04-27 16:54:38 UTC
 * Final size of build directory: 14768120 KiB ( 14.0 GiB)
 * Final size of installed tree:    334588 KiB (326.7 MiB)

with cpu_flags_x86_sse2 and llvm_targets_NVPTX enabled

My /var/tmp uses zram with lzo, and I'm not sure whether df -h takes into account uncompressed or compressed size.
Comment 18 Georgy Yakovlev archtester gentoo-dev 2021-04-27 17:35:49 UTC
(In reply to Maciej Mrozowski from comment #17)
>  * Final size of build directory: 14768120 KiB ( 14.0 GiB)
>  * Final size of installed tree:    334588 KiB (326.7 MiB)
> 
> with cpu_flags_x86_sse2 and llvm_targets_NVPTX enabled
> 
> My /var/tmp uses zram with lzo, and I'm not sure whether df -h takes into
> account uncompressed or compressed size.

thanks, but 'emerge --info dev-lang/rust' missing =)

need to correlate information about enabled useflags + compiler flags with space used.
zram should not matter, as long as the filesystem size it holds can fit the build dir.
Comment 19 Arfrever Frehtes Taifersar Arahesis 2021-04-27 17:52:48 UTC
(In reply to comment #6)
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=dd6c8840fda3cd0afc628c4f753d41ead44cc0e7
> 
> commit dd6c8840fda3cd0afc628c4f753d41ead44cc0e7
> Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
> AuthorDate: 2021-04-18 20:03:22 +0000
> Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
> CommitDate: 2021-04-18 20:46:34 +0000
> 
>     dev-lang/rust: bump build disk requirements for 1.51.0-r2


That 50% increase of requirement should not be performed on native x86 system:

if use amd64; then
	M=$(( $(usex abi_x86_32 15 10) * ${M} / 10 ))
fi
Comment 20 Larry the Git Cow gentoo-dev 2021-04-27 17:57:42 UTC
The bug has been referenced in the following commit(s):

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

commit 4dd54addce6a0232e66ce13731d389b28e6cabe4
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-04-27 17:56:36 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-04-27 17:56:58 +0000

    dev-lang/rust: only increase space req for multilib builds
    
    Bug: https://bugs.gentoo.org/783768
    Thanks-to: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
    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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 21 Jan Sever 2021-04-29 06:45:00 UTC
Thank you, Manfred, for explaining my thoughts, I definitely didn't blame Georgy, I am deeply sorry if it sounded like: I agree it's impossible and pointless to approximate exactly (I wouldn't mind just mentioning range 8G-16G) and I'm really grateful for the great job the Gentoo folk do.

And yes, Manfred, I know how to workaround, but rust is even taken as a dependency for my system set (along with spidermonkey); I rather don't understand why so much disk space is needed; system-llvm is unfortunately masked - I understand why, bundling...
Comment 22 Ionen Wolkens gentoo-dev 2021-05-04 07:57:44 UTC
*** Bug 788094 has been marked as a duplicate of this bug. ***
Comment 23 Joakim Tjernlund 2021-05-04 08:48:25 UTC
yes, rust uses far to much disk space for being a compiler. It is not reasonable to use that much.
Comment 24 Erik Quaeghebeur 2021-05-11 06:10:30 UTC
(In reply to Andrew Ammerlaan from comment #12)
> Pro-Tip: Set USE="system-llvm system-bootstrap"
How can I activate these? They seem masked.
Comment 25 Andrew Nowa Ammerlaan gentoo-dev 2021-05-12 08:03:18 UTC
(In reply to Erik Quaeghebeur from comment #24)
> (In reply to Andrew Ammerlaan from comment #12)
> > Pro-Tip: Set USE="system-llvm system-bootstrap"
> How can I activate these? They seem masked.

Both those flags are masked in package.use.stable.mask, so you'd have to use unstable keywords for dev-lang/rust (and maybe some other deps). Beware that there is of course a good reason for the masking of these flags for stable keywords, it worked just fine for me but you might run into issues.
Comment 26 Erik 2021-05-16 19:49:43 UTC
Created attachment 709176 [details]
build.log

Attached build.log shows that the package checks for 11776 MiB. But the failed build leaves behind a directory of size 15G (14G apparent size). So this was not enough to complete the build.

I will try USE="system-llvm system-bootstrap" as suggested above. If that is problematic, I will try USE="-doc".
Comment 27 Erik 2021-05-17 12:12:48 UTC
The build completed after the configuration changes below.

Added the following lines to /etc/portage/profile/use.mask:
-system-llvm
-system-bootstrap

Added the following use flags to USE= in /etc/portage/make.conf: system-llvm system-bootstrap

Added the following line to /etc/portage/package.use:
dev-lang/rust -doc
Comment 28 Georgy Yakovlev archtester gentoo-dev 2021-05-17 20:10:57 UTC
yeah those flags will reduce space requirements, but remember, those are stable-masked for a reason =) nothing major should happen, but it may fail to build some stuff, but such failures did not happen for quite some time.

I'll re-check USE=doc requirements, looks like it needs to factor other flags enabled, as it builds extra doc for extra components.
Comment 29 Fabio Rossi 2022-06-11 18:06:46 UTC
I get the same problem with rust-1.60 but on my system it eats 60GB!

# emerge -pv virtual/rust

[ebuild     U  ] dev-lang/rust-1.60.0:stable/1.60::gentoo [1.59.0:stable/1.59::gentoo] USE="-clippy -debug -dist -doc (-miri) (-nightly) (-parallel-compiler) (-profiler) -rls -rust-src -rustfmt (-system-bootstrap) (-system-llvm) -test -verify-sig -wasm" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="sse2" LLVM_TARGETS="(X86) -AArch64 -AMDGPU -ARM -AVR -BPF -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -WebAssembly -XCore" 0 KiB
[ebuild     U  ] virtual/rust-1.60.0::gentoo [1.59.0::gentoo] USE="-rustfmt" ABI_X86="32 (64) (-x32)" 0 KiB

and then it fails during compile phase with

-- Installing: /var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/build/x86_64-unknown-linux-gnu/llvm/bin/llvm-reduce
CMake Error at tools/llvm-reduce/cmake_install.cmake:46 (file):
  file INSTALL cannot copy file
  "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/build/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-reduce"
  to
  "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/build/x86_64-unknown-linux-gnu/llvm/bin/llvm-reduce":
  No space left on device.
Call Stack (most recent call first):
  tools/cmake_install.cmake:104 (include)
  cmake_install.cmake:77 (include)


FAILED: CMakeFiles/install.util
cd /var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/build/x86_64-unknown-linux-gnu/llvm/build && /usr/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
thread 'main' panicked at '
command did not execute successfully, got: exit status: 1

build script failed, must exit now', /var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/vendor/cmake/src/lib.rs:885:5
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:116:14
   2: cmake::fail
   3: cmake::run
   4: cmake::Config::build
   5: <bootstrap::native::Llvm as bootstrap::builder::Step>::run
             at ./src/bootstrap/native.rs:378:9
   6: bootstrap::builder::Builder::ensure
             at ./src/bootstrap/builder.rs:1695:23
   7: bootstrap::compile::rustc_cargo_env
             at ./src/bootstrap/compile.rs:711:27
   8: bootstrap::compile::rustc_cargo
             at ./src/bootstrap/compile.rs:655:5
   9: <bootstrap::compile::Rustc as bootstrap::builder::Step>::run
             at ./src/bootstrap/compile.rs:591:9
  10: bootstrap::builder::Builder::ensure
             at ./src/bootstrap/builder.rs:1695:23
  11: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
             at ./src/bootstrap/compile.rs:1098:9
  12: bootstrap::builder::Builder::ensure
             at ./src/bootstrap/builder.rs:1695:23
  13: bootstrap::builder::Builder::compiler
             at ./src/bootstrap/builder.rs:727:9
  14: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
             at ./src/bootstrap/compile.rs:1085:30
  15: bootstrap::builder::Builder::ensure
             at ./src/bootstrap/builder.rs:1695:23
  16: bootstrap::builder::Builder::compiler
             at ./src/bootstrap/builder.rs:727:9
  17: <bootstrap::compile::Std as bootstrap::builder::Step>::make_run
             at ./src/bootstrap/compile.rs:53:23
  18: bootstrap::builder::StepDescription::maybe_run
             at ./src/bootstrap/builder.rs:224:13
  19: bootstrap::builder::StepDescription::run
             at ./src/bootstrap/builder.rs:262:25
  20: bootstrap::builder::Builder::run_step_descriptions
             at ./src/bootstrap/builder.rs:719:9
  21: bootstrap::builder::Builder::execute_cli
             at ./src/bootstrap/builder.rs:699:9
  22: bootstrap::Build::build
             at ./src/bootstrap/lib.rs:622:13
  23: bootstrap::main
             at ./src/bootstrap/bin/main.rs:34:5
  24: core::ops::function::FnOnce::call_once
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    finished in 818.039 seconds
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/./x.py", line 27, in <module>
    bootstrap.main()
  File "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/src/bootstrap/bootstrap.py", line 1325, in main
    bootstrap(help_triggered)
  File "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/src/bootstrap/bootstrap.py", line 1311, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/src/bootstrap/bootstrap.py", line 185, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/build/bootstrap/debug/bootstrap build -vv --config=/var/tmp/portage/
 * ERROR: dev-lang/rust-1.60.0::gentoo failed (compile phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line 127:  Called src_compile
 *   environment, line 3686:  Called die
 * The specific snippet of code:
 *       env $(cat "${S}"/config.env) RUST_BACKTRACE=1 "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die )
 *
 * If you need support, post the output of `emerge --info '=dev-lang/rust-1.60.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/rust-1.60.0::gentoo'`.
 * The complete build log is located at '/var/log/portage/build/dev-lang/rust-1.60.0:20220611-151622.log.gz'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-lang/rust-1.60.0/temp/build.log.gz'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/rust-1.60.0/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src'
 * S: '/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src'
Comment 30 Fabio Rossi 2022-06-24 08:43:15 UTC
(In reply to Fabio Rossi from comment #29)
> I get the same problem with rust-1.60 but on my system it eats 60GB!
> 
> # emerge -pv virtual/rust
> 
> [ebuild     U  ] dev-lang/rust-1.60.0:stable/1.60::gentoo
> [1.59.0:stable/1.59::gentoo] USE="-clippy -debug -dist -doc (-miri)
> (-nightly) (-parallel-compiler) (-profiler) -rls -rust-src -rustfmt
> (-system-bootstrap) (-system-llvm) -test -verify-sig -wasm" ABI_X86="32 (64)
> (-x32)" CPU_FLAGS_X86="sse2" LLVM_TARGETS="(X86) -AArch64 -AMDGPU -ARM -AVR
> -BPF -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ
> -WebAssembly -XCore" 0 KiB
> [ebuild     U  ] virtual/rust-1.60.0::gentoo [1.59.0::gentoo] USE="-rustfmt"
> ABI_X86="32 (64) (-x32)" 0 KiB
> 
> and then it fails during compile phase with
> 
> -- Installing:
> /var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/build/x86_64-
> unknown-linux-gnu/llvm/bin/llvm-reduce
> CMake Error at tools/llvm-reduce/cmake_install.cmake:46 (file):
>   file INSTALL cannot copy file
>  
> "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/build/x86_64-
> unknown-linux-gnu/llvm/build/bin/llvm-reduce"
>   to
>  
> "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/build/x86_64-
> unknown-linux-gnu/llvm/bin/llvm-reduce":
>   No space left on device.
> Call Stack (most recent call first):
>   tools/cmake_install.cmake:104 (include)
>   cmake_install.cmake:77 (include)
> 
> 
> FAILED: CMakeFiles/install.util
> cd
> /var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/build/x86_64-
> unknown-linux-gnu/llvm/build && /usr/bin/cmake -P cmake_install.cmake
> ninja: build stopped: subcommand failed.
> thread 'main' panicked at '
> command did not execute successfully, got: exit status: 1
> 
> build script failed, must exit now',
> /var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/vendor/cmake/src/
> lib.rs:885:5
> stack backtrace:
>    0: rust_begin_unwind
>              at
> /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:
> 498:5
>    1: core::panicking::panic_fmt
>              at
> /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.
> rs:116:14
>    2: cmake::fail
>    3: cmake::run
>    4: cmake::Config::build
>    5: <bootstrap::native::Llvm as bootstrap::builder::Step>::run
>              at ./src/bootstrap/native.rs:378:9
>    6: bootstrap::builder::Builder::ensure
>              at ./src/bootstrap/builder.rs:1695:23
>    7: bootstrap::compile::rustc_cargo_env
>              at ./src/bootstrap/compile.rs:711:27
>    8: bootstrap::compile::rustc_cargo
>              at ./src/bootstrap/compile.rs:655:5
>    9: <bootstrap::compile::Rustc as bootstrap::builder::Step>::run
>              at ./src/bootstrap/compile.rs:591:9
>   10: bootstrap::builder::Builder::ensure
>              at ./src/bootstrap/builder.rs:1695:23
>   11: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
>              at ./src/bootstrap/compile.rs:1098:9
>   12: bootstrap::builder::Builder::ensure
>              at ./src/bootstrap/builder.rs:1695:23
>   13: bootstrap::builder::Builder::compiler
>              at ./src/bootstrap/builder.rs:727:9
>   14: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
>              at ./src/bootstrap/compile.rs:1085:30
>   15: bootstrap::builder::Builder::ensure
>              at ./src/bootstrap/builder.rs:1695:23
>   16: bootstrap::builder::Builder::compiler
>              at ./src/bootstrap/builder.rs:727:9
>   17: <bootstrap::compile::Std as bootstrap::builder::Step>::make_run
>              at ./src/bootstrap/compile.rs:53:23
>   18: bootstrap::builder::StepDescription::maybe_run
>              at ./src/bootstrap/builder.rs:224:13
>   19: bootstrap::builder::StepDescription::run
>              at ./src/bootstrap/builder.rs:262:25
>   20: bootstrap::builder::Builder::run_step_descriptions
>              at ./src/bootstrap/builder.rs:719:9
>   21: bootstrap::builder::Builder::execute_cli
>              at ./src/bootstrap/builder.rs:699:9
>   22: bootstrap::Build::build
>              at ./src/bootstrap/lib.rs:622:13
>   23: bootstrap::main
>              at ./src/bootstrap/bin/main.rs:34:5
>   24: core::ops::function::FnOnce::call_once
>              at
> /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/ops/
> function.rs:227:5
> note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose
> backtrace.
>     finished in 818.039 seconds
> Traceback (most recent call last):
>   File "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/./x.py",
> line 27, in <module>
>     bootstrap.main()
>   File
> "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/src/bootstrap/
> bootstrap.py", line 1325, in main
>     bootstrap(help_triggered)
>   File
> "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/src/bootstrap/
> bootstrap.py", line 1311, in bootstrap
>     run(args, env=env, verbose=build.verbose, is_bootstrap=True)
>   File
> "/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/src/bootstrap/
> bootstrap.py", line 185, in run
>     raise RuntimeError(err)
> RuntimeError: failed to run:
> /var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src/build/bootstrap/
> debug/bootstrap build -vv --config=/var/tmp/portage/
>  * ERROR: dev-lang/rust-1.60.0::gentoo failed (compile phase):
>  *   (no error message)
>  *
>  * Call stack:
>  *     ebuild.sh, line 127:  Called src_compile
>  *   environment, line 3686:  Called die
>  * The specific snippet of code:
>  *       env $(cat "${S}"/config.env) RUST_BACKTRACE=1 "${EPYTHON}" ./x.py
> build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die )
>  *
>  * If you need support, post the output of `emerge --info
> '=dev-lang/rust-1.60.0::gentoo'`,
>  * the complete build log and the output of `emerge -pqv
> '=dev-lang/rust-1.60.0::gentoo'`.
>  * The complete build log is located at
> '/var/log/portage/build/dev-lang/rust-1.60.0:20220611-151622.log.gz'.
>  * For convenience, a symlink to the build log is located at
> '/var/tmp/portage/dev-lang/rust-1.60.0/temp/build.log.gz'.
>  * The ebuild environment file is located at
> '/var/tmp/portage/dev-lang/rust-1.60.0/temp/environment'.
>  * Working directory:
> '/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src'
>  * S: '/var/tmp/portage/dev-lang/rust-1.60.0/work/rustc-1.60.0-src'

I verified that rust-1.60.0 needs

* 13GB without debugging info 
* 22GB with -g1 in CFLAGS
* 80GB with -ggdb in CFLAGS