Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
9.0 Gotcha's
Updating to (B)LFS 9.0 and came across a few compile errors, don't know if anyone else has run into them but here's my solutions.
Doxygen needs git installed even though its not listed as a dependency.
Xkeyboard-config installs a bad keycode for evdev ( keycodes too high ) preventing X starting up, use this sed to remove these codes:
Code:
sed 's|\(<I[3|5].*>\)|//\1|' /usr/share/X11/xkb/keycodes/evdev
JS needs to have the env var SHELL defined and exported, this used to be in the build instructions in the book but seems to have fell out, building in chroot may mean it's not so use
Code:
SHELL=/bin/bash
gtk-doc broken on a number of pkgs, usual gtkdevs shit attitude! ( don't get me started! ).
Polkit needs --enable-libelogind=no if optional dep elogind not installed.
Cups needs this to compile
Code:
sed -i '/stat.h/a #include <asm-generic/ioctls.h>' test/ipptool.c
I'm now using the svn version but the worst 'gotcha' I remember with 9.0 was: (minor) The NINJAJOBS variable didn't work with qtwebengine and (major) the patch applied to qtwebingine resulted in a broken falkon browser. Ksysguard was also broken - nothing but a blank window. Apparently it now also uses qtwebengine. Someone on the mailing list mentioned a broken dolphin but I didn't notice that. That's the longest compile job for me (3:20 hrs/mts) so having to recompile it was a pain. But that fixed it - omitting the patch.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Original Poster
Rep:
Gvfs-1.40.2
If you haven't installed all thre optional deps you need to add:
-Dgcrypt=false -Dgcr=false -Dudisks2=false -Dlogind=false -Dcdda=false -Dsftp=false
to the meson configure.
I hate meson/ninja its more trouble than its worth!
Compiling rust, DONT!
The build system is a "£$%^&* nightmare! Evry minor change results in a complete recompile at 3/4 hours every time, 3 days later I gave up and installed a prebuilt version like so:
Code:
ARCH=$(uname -m)
wget -c https://static.rust-lang.org/dist/rust-1.35.0-$ARCH-unknown-linux-gnu.tar.gz
tar -xvf rust-1.35.0-$ARCH-unknown-linux-gnu.tar.gz
cd rust-1.35.0-$ARCH-unknown-linux-gnu
./install.sh --prefix=/opt/rust
Also the post install for rust includes an unknown command "pathprepend" which doesn't seem to be in any LFS files so change it to:
Code:
mkdir -vp /etc/profile.d/||true
cat > /etc/profile.d/rustc.sh << "EOF"
# Begin /etc/profile.d/rustc.sh
if ! $(echo "$PATH"|grep "/opt/rust/bin");then
PATH="${PATH}:/opt/rust/bin"
fi
# End /etc/profile.d/rustc.sh
EOF
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Original Poster
Rep:
Quote:
Originally Posted by bryan_S
I'm now using the svn version but the worst 'gotcha' I remember with 9.0 was: (minor) The NINJAJOBS variable didn't work with qtwebengine and (major) the patch applied to qtwebingine resulted in a broken falkon browser. Ksysguard was also broken - nothing but a blank window. Apparently it now also uses qtwebengine. Someone on the mailing list mentioned a broken dolphin but I didn't notice that. That's the longest compile job for me (3:20 hrs/mts) so having to recompile it was a pain. But that fixed it - omitting the patch.
I compile Rust on my LFS. It takes me about an hour. I just upgraded my Rust to 1.41 yesterday, in fact.
The thing is to not try to get clever trying to bootstrap it with an existing installed previous version of rust (just let it automatically download binaries into the build tree to get Stage0 off the ground) and don't bother linking against system llvm.
Also, don't compile it as a user then su to root to install it, or it will recompile everything (I've found). If you want to build as a user, use DESTDIR= for the install then chown and copy to $prefix or make the prefix somewhere you own and set environment variables.
Copy config.toml.example to config.toml and edit (uncomment and change settings from their defaults. The following would get you a decent, optimized, non-debug build.
Code:
[build]
# Indicate whether git submodules are managed and updated automatically.
submodules = false
# Enable a build of the extended rust tool set which is not only the compiler
# but also tools such as Cargo. This will also produce "combined installers"
# which are used to install Rust and Cargo together. This is disabled by
# default.
extended = true
[install]
# Instead of installing to /usr/local, install to this path instead.
#prefix = "/usr/local" (defaults to /usr/local which is what I want, but you can change it there)
[rust]
# Number of codegen units to use for each compiler invocation. A value of 0
# means "the number of cores on this machine", and 1+ is passed through to the
# compiler.
codegen-units = 0
# Sets the number of codegen units to build the standard library with,
# regardless of what the codegen-unit setting for the rest of the compiler is.
codegen-units-std = 0
# The "channel" for the Rust build to produce. The stable/beta channels only
# allow using stable features, whereas the nightly and dev channels allow using
# nightly features
channel = "stable"
# Flag indicating whether codegen tests will be run or not. If you get an error
# saying that the FileCheck executable is missing, you may want to disable this.
# Also see the target's llvm-filecheck option.
codegen-tests = false
If you didn't change those codegen-units settings, they default to 1 job which may be why it takes you 4 hours+
Then simply:
Code:
./x.py build
DESTDIR=/some/place ./x.py install
OR, as root, even more simply:
Code:
./x.py build && ./x.py install
I strip the results, but there won't be debugging symbols so it's not that critical.
Note that there is $PREFIX/$libdir/rustlib/uninstall.sh that seems to do the right thing, for uninstalling the previous before installing the new. I've used it several times.
P.S. If you're just going to use it a couple of times, e.g. to compile librsvg and Firefox once, it really doesn't matter, but I compile Firefox very often so it's worth it to me to have a good bootstrapped Rust build.
Last edited by TheRealGrogan; 02-11-2020 at 06:56 PM.
Reason: forgot codegen-tests = false
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Original Poster
Rep:
Thx for the detailed instructions, I actually only needed rust for librsvg for gimp, so unless i need it again i'll probably just stick to the precompiled version.
No problem, I used to feel the same way, that Rust was a horrible pain in the ass to bootstrap. I'd done it with packaging scripting, in Archaroo and Slackware but had difficulty trying to bootstrap it without. Knowing this, for my first one on this new LFS I stepped through the SlackBuild script from Slackware and that worked, but then I later realized that it really doesn't have to be that complicated. Worth sharing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.