gentoo-rust
gentoo-rust copied to clipboard
Cargo segfaults on some builds
I cannot build some packages, namely app-misc/bat-0.7.1
and dev-util/racer-9999
, because Cargo segfaults:
* Package: app-misc/bat-0.7.1
* Repository: rust
* USE: abi_x86_64 amd64 elibc_glibc fetch-crates kernel_linux userland_GNU
* FEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox
bat: Thu Sep 27 20:21:40 2018: 5 minutes, 27 seconds
bat: 1 times
bat: 5 minutes, 27 seconds for 1 merges
]0;emerge 22:57:00 1|1 bat 05:27 (root@ripper) * FEATURES='assume-digests binpkg-logs cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr'
* CFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -flto=32 -fipa-pta -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu'
* CXXFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -flto=32 -fipa-pta -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu'
* FFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -flto=32 -fipa-pta -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu'
* FCFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -flto=32 -fipa-pta -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu'
* F77FLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -flto=32 -fipa-pta -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu'
* LDFLAGS='-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -march=native -O3 -fgraphite-identity -floop-nest-optimize -flto=32 -fipa-pta -fuse-linker-plugin -pipe'
* MAKEOPTS='-j32 -l32'
* gcc (Gentoo 8.2.0-r4 p1.5) 8.2.0
* Linux ripper 4.19.0-gentoo #1 SMP PREEMPT Mon Oct 22 17:27:06 CEST 2018 x86_64 AMD Ryzen Threadripper 1950X 16-Core Processor AuthenticAMD GNU/Linux
>>> Unpacking source...
>>> Unpacking v0.7.1.tar.gz to /var/tmp/portage/app-misc/bat-0.7.1/work
>>> Source unpacked in /var/tmp/portage/app-misc/bat-0.7.1/work
>>> Preparing source in /var/tmp/portage/app-misc/bat-0.7.1/work/bat-0.7.1 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-misc/bat-0.7.1/work/bat-0.7.1 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-misc/bat-0.7.1/work/bat-0.7.1 ...
/var/tmp/portage/app-misc/bat-0.7.1/temp/environment: line 1008: 6632 Segmentation fault (core dumped) cargo build -v -j $(makeopts_jobs) $(usex debug "" --release)
* ERROR: app-misc/bat-0.7.1::rust failed (compile phase):
* cargo build failed
*
* Call stack:
* ebuild.sh, line 119: Called src_compile
* environment, line 1259: Called cargo_src_compile
* environment, line 1011: Called die
* The specific snippet of code:
* cargo build -v -j $(makeopts_jobs) $(usex debug "" --release) || die "cargo build failed"
*
* If you need support, post the output of `emerge --info '=app-misc/bat-0.7.1::rust'`,
* the complete build log and the output of `emerge -pqv '=app-misc/bat-0.7.1::rust'`.
* The complete build log is located at '/var/tmp/portage/app-misc/bat-0.7.1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/app-misc/bat-0.7.1/temp/environment'.
* Working directory: '/var/tmp/portage/app-misc/bat-0.7.1/work/bat-0.7.1'
* S: '/var/tmp/portage/app-misc/bat-0.7.1/work/bat-0.7.1'
I find it strange, because I can build some others, like sys-apps/exa-0.8.0
or sys-apps/fd-7.2.0
just fine, plus I can build bat and racer just fine with cargo install
.
I run dev-lang/rust-bin-9999
with dev-util/cargo-9999
.
Which versions of rust
and cargo
do you use? What's in /var/tmp/portage/app-misc/bat-0.7.1/temp/environment
?
As stated before, I use dev-lang/rust-bin-9999
with dev-util/cargo-9999
, recompiled just now.
/var/tmp/portage/app-misc/bat-0.7.1/temp/environment
:
https://gist.github.com/6c7e77e88f8f59347d3ba35d251223d6
Just tried emerge --verbose bat
, also failed. But it's not segfault, it says
warning: spurious network error (2 tries remaining): curl error: Could not resolve host: github.com
which is a bug in the ebuild, just like #340. It tries to download dependencies by cargo itself instead of putting them into SRC_URI
.
Seems like my problems were caused by the same thing, since they stopped after pulling your change.
Unfortunately, other packages now started to segfault—namely dev-util/cbindgen-0.6.7
and dev-util/racer-9999
(again)…
Well, I installed racer
successfully with rust-bin-9999
and cargo
installed as part of it via USE=cargo
. Could you try updating cargo
and/or rust
and try again? Also launch emerge
with --verbose
option, maybe it will give you more info about the error.
I had Cargo as an independent package (not a part of rust-bin
, which was emerged without cargo
USE-flag).
I gave your way a go and now everything seems to be in order.