Summary: | dev-lang/rust : build ignores -j1 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Toralf Förster <toralf> |
Component: | Current packages | Assignee: | Gentoo Rust Project <rust> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | aleftmail, zeekec |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Toralf Förster
2017-07-24 20:10:24 UTC
Chiming in. This is a big problem on memory-constrained system. Rust builds llvm as part of compilation, and linkage of llvm binaries takes ~3GB of RAM each. With the default parallelism being set to the amount of cores available to the system, and no ability to change that, the compilation eats (on my 4-core system) 12GB. I have "only" 6GB of RAM, and compilation of rust makes the system swap a lot, rendering it effectively unusable for extended time (and, naturally, fails to emerge completely without enough swap on the system). This will become a much more visible problem once www-client/firefox-52.3.0 with non-optional rust dependency gets unmasked. Actually, please disregard me. It seems that the great memory use is due to -ggdb in my CFLAGS (https://bugs.gentoo.org/show_bug.cgi?id=626134), and without that one, the inability to control parallelism is still unpleasant but not as critical as I made it sound. This is a massiv problem for arm, rpi2+3 for instance have quadcore arm cpu but only 1gb of ram. I added swap via usb hd but still this is not cool at all, torturing that poor hd :( *** Bug 635696 has been marked as a duplicate of this bug. *** seems, something like -C codegen-units=1 should go into the eclass ? FWIW I tried RUSTFLAGS="-C codegen-units=1" in make.conf, but that doesn't affect the build of rust itself :-/ From IRC upstream : [19:48] <toralf> Is there any way to control the build of rust in that way that only 1 CPU is used ? [19:48] <shep> frogmella: https://play.rust-lang.org/?gist=a67da374a310f8bd83db42df5e654fa9&version=nightly ? [19:49] <shep> toralf: `cargo build --help` shows ` -j N, --jobs N Number of parallel jobs, defaults to # of CPUs` [19:50] <frogmella> figured I would have to do something like that, thanks! [19:50] <toralf> shep: ok, thx, so I just need a Gentoo dev who wrote that ebuild (https://bugs.gentoo.org/626080) *** This bug has been marked as a duplicate of bug 613794 *** |