Discussion:
[blfs-support] I hate rustc!
Ken Moffat via blfs-support
2018-09-19 19:42:32 UTC
Permalink
I hate trying to build with rust!

Actually, I guess that people on this list probably know that, but
I've found yet another example of the variability in its builds.

Backstory : on -dev in June I had build failures with 1.25.0 which
was apparently trying to link to static libcrmf.a. I took a punt on
installing libssh2 (shared only) and was able to build.

Later, I discovered that our workaround for something ssl-related in
Python2 no longer worked in 2.7.15. That seemed to explain why
libssh2 was now required.

Since then, I've built rustc-1.25.0 at least 9 times without
problems. Earlier this week I built the latest version, 1.29.0, so
that I can test firefox-63-beta. On the machine I was using, I put
it in /opt because I wasn't sure if it would build everything else :
in fact, the only problem was firefox-62.0 (broken by 1.29.0) and I
have a patch to fix that.

Today I'm trying to update on a different machine. Both machines
are running 8.3. Twice the install (technically, the DESTDIR install)
has failed during its stage2 compilation of cargo with a message that
it could not find -lssh2.a and perhaps I needed to add a directory
with an -L flag.

Swore a bit, but decided that if it needs the static lib then I'd
better try giving it to it. Did not help: it finds it, but the link
failed:

/usr/bin/ld: /scratch/working/rustc-1.29.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/liblibssh2_sys-f2e78b83b37f7883.rlib(crypt.o): relocation R_X86_64_32 against `.data' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status

That machine is now powered off before my next attempt.

But looking at this machine, where the install in /opt was fine:

/usr/bin/cargo from rustc-1.25.0 links to libssh2.so.

/opt/new/bin/cargo from rustc-1.29.0 does NOT link to it, and
libssh2.a is not available on this system.

Conclusion: the build is random.

That randomness might also explain my results from comparing
firefox-63beta builds using gcc/g++ and clang/clang++ on the machine
where I managed to install 1.29.0. With clang (vanilla and system
graphite2/harfbuzz) the builds [only, i.e. ./mach build] took around
26 minutes, a similar pair with gcc took just over 32 minutes each.

But then I wanted to do a further test, because I thought that
static libcrmf.a (which I normally hide, and had forgotten about
until I checked the build of seamonkey and failed at that point)
appeared to not be needed now - but I wasn't 100% sure. Did a
further build of firefox beta with gcc, this time it took 24m29!

So, I think that building with rust is not at all predictable.

Interestingly, the firefox builds with clang used significantly less
space, although the sizes of the total installed files were
similar. But since I can't reliably build it ...

ĸen
--
Tout est bien, tout va bien, tout va pour le mieux qu'il soit possible
-- Candide, de Voltaire
(Everything is for the best, in the best of all possible worlds)
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/b
Ken Moffat via blfs-support
2018-09-22 21:53:39 UTC
Permalink
Post by Ken Moffat via blfs-support
I hate trying to build with rust!
Minor update - I might have fixed this issue, but since it doesn't
happen all the time, I'm not going to say that I definitely fixed
it. Added

export LIBSSH2_SYS_USE_PKG_CONFIG=1

just before the DESTDIR install. After 5 failed builds across about
5 days, this time it sailed through. Maybe I got lucky, or maybe I
got lucky when googling (looked for cargo rather than rust, and
found a link from August - so it would not have helped me back in
June when it last happened).

ĸen
--
Tout est bien, tout va bien, tout va pour le mieux qu'il soit possible
-- Candide, de Voltaire
(Everything is for the best, in the best of all possible worlds)
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscri
Michael Shell via blfs-support
2018-09-22 23:47:34 UTC
Permalink
On Sat, 22 Sep 2018 22:53:39 +0100
Post by Ken Moffat via blfs-support
export LIBSSH2_SYS_USE_PKG_CONFIG=1
just before the DESTDIR install.
Thanks Ken! I'm sure this is going to help more than a few folks out
there. If rustc is going to be used for production, the rust developers
better get their act together, IMHO.


Cheers,

Mike
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe:
Ken Moffat via blfs-support
2018-09-23 00:15:23 UTC
Permalink
Post by Michael Shell via blfs-support
On Sat, 22 Sep 2018 22:53:39 +0100
Post by Ken Moffat via blfs-support
export LIBSSH2_SYS_USE_PKG_CONFIG=1
just before the DESTDIR install.
Thanks Ken! I'm sure this is going to help more than a few folks out
there. If rustc is going to be used for production, the rust developers
better get their act together, IMHO.
Cheers,
Mike
Thanks, Mike.

The really worrying thing continues to be that this only happens
from time to time (which is why I'm not convinced that this really
has solved it). Looking back at my notes from June, the problem was
on the intel machine where I did builds at the start of this week
without any problems.

The other worrying thing about building rust is the way that it
builds multiple versions of some of the crates (presumably as
dependencies for different other crates), with all the versions set
in stone. I fear that it is going to keep growing.

But now I've moved on and can start to worry about building
firefox-beta ;-)

ĸen
--
Tout est bien, tout va bien, tout va pour le mieux qu'il soit possible
-- Candide, de Voltaire
(Everything is for the best, in the best of all possible worlds)
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Michael Shell via blfs-support
2018-09-23 00:28:16 UTC
Permalink
On Sun, 23 Sep 2018 01:15:23 +0100
Post by Ken Moffat via blfs-support
The other worrying thing about building rust is the way that it
builds multiple versions of some of the crates (presumably as
dependencies for different other crates), with all the versions set
in stone. I fear that it is going to keep growing.
Ken,

Is there any chance on the horizon that we will be able to find
a way, or the rustc developers will in the future provide a way,
for us to be able to build this thing without a net connection,
or if we just don't want the build process to "phone home" and
start downloading things. I hate stuff like that.


Cheers,

Mike
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information pa
Ken Moffat via blfs-support
2018-09-23 01:27:39 UTC
Permalink
Post by Michael Shell via blfs-support
Is there any chance on the horizon that we will be able to find
a way, or the rustc developers will in the future provide a way,
for us to be able to build this thing without a net connection,
or if we just don't want the build process to "phone home" and
start downloading things. I hate stuff like that.
Cheers,
Mike
Check the -dev archives, somebody made suggestions about that
recently. For us, I still think the idea of documenting what needs
to be downloaded is unmaintainable.

I guess that the best place to look would be fedora's cgit, except
that they have so many packages that I gave up looking for rustc
itself. Arch might have some suggestions, similarly gentoo, but I
don't think either was specific about all the cargo files needed.

Attached is a list of the crates that 1.29.0 reported it was
compiling. Also needs previous versions of rust, etc.

Äžen
--
Tout est bien, tout va bien, tout va pour le mieux qu'il soit possible
-- Candide, de Voltaire
(Everything is for the best, in the best of all possible worlds)
Ken Moffat via blfs-support
2018-09-23 01:32:46 UTC
Permalink
Post by Ken Moffat via blfs-support
Also needs previous versions of rust, etc.
In fact, looking at my latest log from 1.29.0 it only needs the
previous binary version of rust-std, i.e. in my case

https://static.rust-lang.org/dist/2018-08-02/rust-std-1.28.0-x86_64-unknown-linux-gnu.tar.gz

ĸen
--
Tout est bien, tout va bien, tout va pour le mieux qu'il soit possible
-- Candide, de Voltaire
(Everything is for the best, in the best of all possible worlds)
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above informati
Loading...