Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 646092 - dev-lang/rust-1.23.0-r1 fails to build with MAKEOPTS=-l32 -> thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError
Summary: dev-lang/rust-1.23.0-r1 fails to build with MAKEOPTS=-l32 -> thread 'main' pa...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Rust Project
Depends on:
Reported: 2018-01-30 00:04 UTC by Georgy Yakovlev
Modified: 2018-02-07 23:04 UTC (History)
5 users (show)

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

build.log (build.log,37.40 KB, text/x-log)
2018-01-30 00:04 UTC, Georgy Yakovlev

Note You need to log in before you can comment on or make changes to this bug.
Description Georgy Yakovlev archtester gentoo-dev 2018-01-30 00:04:14 UTC
Created attachment 517088 [details]

rust fails to build early.

Please note despite having rust overlay enabled, the only package I use is cargo-ebuild, the rest of overlay is masked. Also gentoo repo configured with 
eclass-overrides =

    Finished dev [unoptimized] target(s) in 18.37 secs
running: /var/tmp/portage/dev-lang/rust-1.23.0-r1/work/rustc-1.23.0-src/build/bootstrap/debug/bootstrap build --verbose --config=/var/tmp/portage/dev-lang/rust-1.23.0-r1/work/rustc-1.23.0-src/config.toml -j32 -l32
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', /checkout/src/libcore/
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Traceback (most recent call last):
  File "./", line 20, in <module>
  File "/var/tmp/portage/dev-lang/rust-1.23.0-r1/work/rustc-1.23.0-src/src/bootstrap/", line 758, in main
  File "/var/tmp/portage/dev-lang/rust-1.23.0-r1/work/rustc-1.23.0-src/src/bootstrap/", line 749, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/var/tmp/portage/dev-lang/rust-1.23.0-r1/work/rustc-1.23.0-src/src/bootstrap/", line 148, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /var/tmp/portage/dev-lang/rust-1.23.0-r1/work/rustc-1.23.0-src/build/bootstrap/debug/bootstrap build --verbose --config=/var/tmp/portage/dev-lang/rust-1.23.0-r1/work/rustc-1.23.0-src/config.toml -j32 -l32
 * ERROR: dev-lang/rust-1.23.0-r1::gentoo failed (compile phase):

reaper ~ # emerge --info rust
Portage 2.3.19 (python 3.5.4-final-0, default/linux/amd64/17.0/desktop/plasma, gcc-6.4.0, glibc-2.25-r9, 4.15.0-gentoo-reaper x86_64)
                         System Settings
System uname: Linux-4.15.0-gentoo-reaper-x86_64-AMD_Ryzen_Threadripper_1950X_16-Core_Processor-with-gentoo-2.4.1
KiB Mem:    65883624 total,  56317424 free
KiB Swap:    8388600 total,   8388600 free
Timestamp of repository gentoo: Mon, 29 Jan 2018 23:07:09 +0000
Head commit of repository gentoo: 4292c0ecf05dc2b2d3032ef42399182b5a0f15b9

Timestamp of repository rust: Mon, 29 Jan 2018 07:49:02 +0000
Head commit of repository rust: 478b6c5273602cfdf10a314df2cbaf96bc9a8e9d

Head commit of repository steam-overlay: 3413c387e5026226d29b04f97c0846f536364ba9

sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo

    location: /var/db/repos/gentoo
    sync-type: git
    priority: -1000

    location: /var/db/repos/gyakovlev
    masters: gentoo

    location: /var/db/repos/rust
    sync-type: git
    masters: gentoo

    location: /var/db/repos/steam-overlay
    sync-type: git
    masters: gentoo
    priority: 50

CFLAGS="-march=native -O2 -pipe"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
EMERGE_DEFAULT_OPTS="--ask-enter-invalid --jobs=16  --load-average 32"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j32 -l32"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
USE="X a52 aac acl acpi activities alsa amd64 bash-completion berkdb branding bzip2 cairo cdda cdr cli consolekit crypt cups cxx dbus declarative djvu dri dts dvd dvdr emboss encode exif fam fbcon firefox flac fortran gdbm gif glamor gpm gtk iconv icu idn introspection ios ipv6 jpeg kde kipi kwallet lcms libnotify lm_sensors lzma lzo mad mng modules mp3 mp4 mpeg multilib ncurses nls nptl numa ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qml qt5 readline seccomp semantic-desktop spell ssl startup-notification svg tiff truetype udev unicode urandom usb vaapi vdpau vim-syntax vorbis wayland webp widgets x264 xattr xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2 fuji" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="amdgpu radeon radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

                        Package Settings

dev-lang/rust-1.23.0::gentoo was built with the following:
USE="jemalloc -debug -doc" ABI_X86="(64)"
Comment 1 Georgy Yakovlev archtester gentoo-dev 2018-01-30 02:02:27 UTC
I think it fails due to MAKEOPTS change.

I've tried building with -j16 and it didn't work, trying even less.
Comment 2 Georgy Yakovlev archtester gentoo-dev 2018-01-30 02:15:19 UTC
ok I got it,

it's the -l32 flag make rust build crash, not the -j32 part.

this guy here extracts only -j part of the MAKEOPTS

building past the failure right now with MAKEOPTS="-j32", I've removed -l part.
Comment 3 Georgy Yakovlev archtester gentoo-dev 2018-01-30 03:07:13 UTC
confirming successful merge without -l flag.
Comment 4 Georgy Yakovlev archtester gentoo-dev 2018-01-30 04:06:39 UTC
MAKEOPTS="${MAKEOPTS} -l" does not help.

checking build -h shows this
    -v, --verbose       use verbose output (-vv for very verbose)
    -i, --incremental   use incremental compilation
        --config FILE   TOML configuration file for build
        --build BUILD   build target of the stage0 compiler
        --host HOST     host targets to build
        --target TARGET target targets to build
        --on-fail CMD   command to run on failure
        --stage N       stage to build
        --keep-stage N  stage to keep without recompiling
        --src DIR       path to the root of the rust checkout
    -j, --jobs JOBS     number of jobs to run in parallel
    -h, --help          print this help message

so it does not know what to do with the -l flag, clearly it needs to be filtered out of MAKEOPTS if present.

/var/tmp/portage/dev-lang/rust-1.23.0-r1/work/rustc-1.23.0-src/build/bootstrap/debug/bootstrap build --verbose --config=/var/tmp/portage/dev-lang/rust-1.23.0-r1/work/rustc-1.23.0-src/config.toml -j32 -l << here.
Comment 5 Georgy Yakovlev archtester gentoo-dev 2018-01-30 04:33:02 UTC
a viable solution will be using multiprocessing.eclass

./ build --verbose --config="${S}"/config.toml -j$(makeopts_jobs) || die
Comment 6 Pierre-Yves Bonnetain-Nesterenko 2018-01-30 10:50:13 UTC
(In reply to Georgy Yakovlev from comment #5)
> a viable solution will be using multiprocessing.eclass
> ./ build --verbose --config="${S}"/config.toml -j$(makeopts_jobs) || die

Same problem here. 
Modifying the ebuild to inherit from multiprocessing class and performing the line change does solve the error.
Comment 7 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-01-31 08:24:01 UTC
The GitHub PR looks good to me; people with commit access should feel free to merge or rebase it. I'll get to it, but it might take a few days.
Comment 8 Larry the Git Cow gentoo-dev 2018-01-31 09:56:19 UTC
The bug has been closed via the following commit(s):

commit dca844ed582e369708a7769d4e84abf6e9b5fb0d
Author:     Georgy Yakovlev <>
AuthorDate: 2018-01-30 04:54:54 +0000
Commit:     Lars Wendler <>
CommitDate: 2018-01-31 09:56:11 +0000

    dev-lang/rust: fix MAKEOPTS -l/--load-average build
    Upstream build system does not like -l/--load-average,
    So we cannot use MAKEOPTS as-is. The only relevant option is -j<num>.
    This commit changes to using multiprocessing.eclass makeopts_jobs()
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 dev-lang/rust/rust-1.23.0-r1.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 9 Toralf Förster gentoo-dev 2018-02-07 19:49:49 UTC
Are you sure that dca844ed582e3697 works ?
Last night I got again a high load due to the build of /usr/portage/dev-lang/rust/rust-1.23.0-r1.ebuild at all 12 cores.
Comment 10 Georgy Yakovlev archtester gentoo-dev 2018-02-07 23:04:12 UTC
(In reply to Toralf Förster from comment #9)
> Are you sure that dca844ed582e3697 works ?
> Last night I got again a high load due to the build of
> /usr/portage/dev-lang/rust/rust-1.23.0-r1.ebuild at all 12 cores.

it works by ignoring -l completely as it’s a limitation of upstream build system.
the only option it supports is “-j”
All the fix does is filtering out everything except -jX from MAKEOPTS.
So you can’t really limit launching new jobs based on loadavg. Need to talk to upstream about supporting that.