Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 676278 - dev-lang/rust-1.32.0 - error: Could not compile `core`.
Summary: dev-lang/rust-1.32.0 - error: Could not compile `core`.
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:
: 676882 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-01-26 14:44 UTC by Dmitriy Baranov
Modified: 2019-04-12 05:08 UTC (History)
4 users (show)

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


Attachments
build.log (build.log,21.72 KB, text/plain)
2019-01-26 14:44 UTC, Dmitriy Baranov
Details
emerge --info (einfo,6.09 KB, text/plain)
2019-01-26 14:45 UTC, Dmitriy Baranov
Details
build.log --verbose (build.log,60.29 KB, text/plain)
2019-01-26 16:22 UTC, Dmitriy Baranov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitriy Baranov 2019-01-26 14:44:50 UTC
Created attachment 562870 [details]
build.log

Compile error dev-lang/rust on ~amd64.

Previous version:
https://bugs.gentoo.org/674664
Comment 1 Dmitriy Baranov 2019-01-26 14:45:28 UTC
Created attachment 562872 [details]
emerge --info
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2019-01-26 14:58:10 UTC
Comment on attachment 562870 [details]
build.log

"To learn more, run the command again with --verbose."

Why isn't that enabled by default?
Comment 3 Dmitriy Baranov 2019-01-26 15:17:53 UTC
(In reply to Jeroen Roovers from comment #2)
> Comment on attachment 562870 [details]
> build.log
> 
> "To learn more, run the command again with --verbose."
> 
> Why isn't that enabled by default?

Actually I haven't relevant changes in options for this case.
Comment 4 Dmitriy Baranov 2019-01-26 16:22:18 UTC
Created attachment 562874 [details]
build.log --verbose
Comment 5 Dmitriy Baranov 2019-01-26 16:23:07 UTC
New build.log with added "--verbose":

src_compile() {
	env $(cat "${S}"/config.env)\
		"${EPYTHON}" ./x.py build --verbose --config="${S}"/config.toml -j$(makeopts_jobs) \
		--exclude src/tools/miri || die # https://github.com/rust-lang/rust/issues/52305
}
Comment 6 Matthias Dahl 2019-01-28 13:45:46 UTC
I can confirm this w/ llvm 7.0.1 and gcc 8.2.0 (on ~amd64).

Besides that, building with -system-llvm requires cblas to be installed (which is missing as a dependency from the rust ebuild) otherwise the vendored llvm will error out during the configure phase w/ cmake.
Comment 7 Matthias Dahl 2019-01-28 15:09:56 UTC
One more data point: Compiling rust w/ clang 7.0.1 and system-llvm works just fine on my system whereas using gcc (8.2.0) fails with the stated error.
Comment 8 Dmitriy Baranov 2019-01-30 22:01:06 UTC
(In reply to Matthias Dahl from comment #7)
> One more data point: Compiling rust w/ clang 7.0.1 and system-llvm works
> just fine on my system whereas using gcc (8.2.0) fails with the stated error.

I confirm.
Comment 9 Manfred Knick 2019-01-31 21:03:17 UTC
With sys-devel/gcc-7.4.0 :

  CMake Error at cmake/modules/AddLLVM.cmake:459 (add_library):
    Cannot find source file:

      /usr/include/cblas.h

After emerging virtual/cblas :
-> 
  [ebuild  N     ] app-eselect/eselect-cblas-0.1 
  [ebuild  N     ] sci-libs/gsl-1.16  USE="-cblas-external -static-libs" 
  [ebuild  N    ~] virtual/cblas-3.7 

emerge of 

  [ebuild     U ~] dev-lang/rust-1.32.0 [1.30.1-r1]
  [ebuild     U ~] virtual/rust-1.32.0 [1.30.1]
  [ebuild     U ~] virtual/cargo-1.32.0 [1.30.1]

succeeds right away.

(In reply to Matthias Dahl from comment #6)
> ... (which is missing as a dependency from the rust ebuild) ...
+1
Comment 10 Georgy Yakovlev archtester gentoo-dev 2019-02-01 04:05:38 UTC
guys, cblas is not needed. it's just a bug in cmake files.
if you have to install cblas to build rust it means you have a stale header in system dirs.

since cblas headers are symlinks it means at some point you had cblas installed and removed it, but symlinks are left on the filesystem.
rust's build system finds it and tries to link, but there are no files, just a broken symlink.

find cblas.h and remove it if you don't have cblas installed and rust's llvm fails to build
Comment 11 Larry the Git Cow gentoo-dev 2019-02-01 04:36:57 UTC
The bug has been closed via the following commit(s):

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

commit 9bd888b197bae54fa4b5d6033768f2438180b314
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2019-02-01 04:07:49 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2019-02-01 04:36:41 +0000

    dev-lang/rust: re-add cblas patch
    
    Since some systems have stale cblas.h symlink rust's bundled
    llvm finds cblas.h and tries to link unconditionally. Fix it.
    
    This reverts commit 0e00cd7cc089acdd3114b4aafc34fc921aabe058.
    
    Closes: https://bugs.gentoo.org/676278
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 .../1.32.0-fix-configure-of-bundled-llvm.patch     | 32 ++++++++++++++++++++++
 dev-lang/rust/rust-1.32.0.ebuild                   |  1 +
 2 files changed, 33 insertions(+)
Comment 12 Georgy Yakovlev archtester gentoo-dev 2019-02-01 04:37:47 UTC
pushed a fix, please let me know if it still fails for some reason.
Comment 13 Georgy Yakovlev archtester gentoo-dev 2019-02-01 09:53:58 UTC
*** Bug 676882 has been marked as a duplicate of this bug. ***
Comment 14 Manfred Knick 2019-02-01 10:25:30 UTC
(In reply to Georgy Yakovlev from comment #10)

> ... but symlinks are left
Confirmed.

Re-Produce:
- emerge -1 virtual/cblas
- emerge --depclean

--> leaving behind:

# find . -name *cblas*  | grep -v portage

./include/cblas.h
./lib64/libcblas.a
./lib64/pkgconfig/cblas.pc
./lib64/libcblas.so
./lib64/libcblas.so.0

which belong to sci-libs/gsl-1.16

Bug 677044 - sci-libs/gsl-1.16 : 
             uninstalling, orphaned links are left behind,
             causing breakage
Comment 15 Faraclas 2019-02-01 15:49:40 UTC
I checked my system and I had virtual/cblas installed already.  So there should have not been any 'stale' headers.

elias@eliasgentoo ~ $ eix cblas
[I] app-eselect/eselect-cblas
     Available versions:  0.1
     Installed versions:  0.1(02:32:25 AM 12/02/2017)
     Homepage:            https://www.gentoo.org/proj/en/eselect/
     Description:         C-language BLAS module for eselect

* sci-libs/cblas-reference
     Available versions:  20030223-r6 ~20151113-r2 ~20161223
     Homepage:            http://www.netlib.org/cblas/
     Description:         C wrapper interface to the F77 reference BLAS implementation

[I] virtual/cblas
     Available versions:  1.0 ~3.6 ~3.7
     Installed versions:  1.0(08:47:20 AM 02/01/2019)
     Description:         Virtual for BLAS C implementation

elias@eliasgentoo ~ $ equery depends cblas
 * These packages depend on cblas:
dev-python/numpy-1.14.5 (lapack ? virtual/cblas)
sci-libs/gsl-1.16 (cblas-external ? virtual/cblas)

I am not sure deleting the header is the right solution.
Comment 16 Faraclas 2019-02-01 17:01:11 UTC
Disregard the comment above.  The new patch fixes the issue and build is successful.
Comment 17 Larry the Git Cow gentoo-dev 2019-04-12 05:08:17 UTC
The bug has been referenced in the following commit(s):

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

commit dad9246cf2dd4fc349139ceb963efe11bce75e63
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2019-04-12 05:00:42 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2019-04-12 05:08:02 +0000

    dev-lang/rust: fix cblas headers again, don't build RISCV
    
    Bug: https://bugs.gentoo.org/676278
    Bug: https://bugs.gentoo.org/678186
    Bug: https://bugs.gentoo.org/683128
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 ...Add-additional-headers-only-if-they-exist.patch | 41 ++++++++++++++++++++++
 .../{rust-1.34.0.ebuild => rust-1.34.0-r1.ebuild}  |  3 ++
 2 files changed, 44 insertions(+)