mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-31 20:42:34 +08:00
60ddbaf3c2
for many packages as they are now a part of LFS. git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@19328 af4574ff-66df-0310-9fd7-8a98e5e911e0
321 lines
9.6 KiB
XML
321 lines
9.6 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
|
|
<!ENTITY rust-download-http "https://static.rust-lang.org/dist/rustc-&rust-version;-src.tar.gz">
|
|
<!ENTITY rust-download-ftp " ">
|
|
<!ENTITY rust-md5sum "75e779670ac79edf023497a9c37eb35d">
|
|
<!ENTITY rust-size "48 MB">
|
|
<!ENTITY rust-buildsize "4.2 GB (362 MB installed), (add 0.6GB for tests) plus 273MB for ~/.cargo files">
|
|
<!ENTITY rust-time "33 SBU (add 14 SBU for tests, both with 4 processors)">
|
|
]>
|
|
|
|
<sect1 id="rust" xreflabel="rustc-&rust-version;">
|
|
<?dbhtml filename="rust.html"?>
|
|
|
|
<sect1info>
|
|
<othername>$LastChangedBy$</othername>
|
|
<date>$Date$</date>
|
|
</sect1info>
|
|
|
|
<title>Rustc-&rust-version;</title>
|
|
|
|
<indexterm zone="rust">
|
|
<primary sortas="a-rust">Rust</primary>
|
|
</indexterm>
|
|
|
|
<sect2 role="package">
|
|
<title>Introduction to Rust</title>
|
|
|
|
<para>
|
|
The <application>Rust</application> programming language is designed
|
|
to be a safe, concurrent, practical language.
|
|
</para>
|
|
|
|
<para>
|
|
As with many other programming languages, rustc (the rust compiler)
|
|
needs a binary from which to bootstrap. It will download a stage0 binary,
|
|
and several cargo files (these are actually .tar.gz source archives) at
|
|
the start of the build, so you cannot compile it without an internet
|
|
connection.
|
|
</para>
|
|
|
|
<para>
|
|
The current <application>rustbuild</application> build-system will use
|
|
all available processors, although it does not scale well and often falls
|
|
back to just using one core while waiting for a library to compile.
|
|
</para>
|
|
|
|
<para>
|
|
At the moment <application>Rust</application> does not provide any
|
|
guarantees of a stable ABI.
|
|
</para>
|
|
|
|
&lfs81_checked;
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>
|
|
Download (HTTP): <ulink url="&rust-download-http;"/>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download (FTP): <ulink url="&rust-download-ftp;"/>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download MD5 sum: &rust-md5sum;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download size: &rust-size;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Estimated disk space required: &rust-buildsize;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Estimated build time: &rust-time;
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<bridgehead renderas="sect3">Rust Dependencies</bridgehead>
|
|
|
|
<bridgehead renderas="sect4">Required</bridgehead>
|
|
<para role="required">
|
|
<xref linkend="curl"/>,
|
|
<xref linkend="cmake"/>,
|
|
<xref linkend="python2"/>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
|
<para role="optional">
|
|
<xref linkend="gdb"/> (used by debuginfo-gdb in the testsuite)
|
|
</para>
|
|
|
|
<para condition="html" role="usernotes">
|
|
User Notes: <ulink url="&blfs-wiki;/rust"/>
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 role="installation">
|
|
<title>Installation of Rust</title>
|
|
|
|
<note>
|
|
<para>
|
|
This package is updated on a six-weekly release cycle. Because it is
|
|
such a large and slow package to build, and is at the moment only used
|
|
by one package in this book, the BLFS editors take the view that it
|
|
should only be updated when that is necessary.
|
|
</para>
|
|
</note>
|
|
|
|
<para>
|
|
First create a suitable <filename>config.toml</filename> file
|
|
which will configure the build :
|
|
</para>
|
|
|
|
<screen><userinput>cat <<EOF > config.toml
|
|
# see src/bootstrap/config.toml.example for more possible options
|
|
[llvm]
|
|
targets = "X86"
|
|
|
|
[build]
|
|
# install cargo as well as rust
|
|
extended = true
|
|
|
|
[install]
|
|
prefix = "/usr"
|
|
docdir = "share/doc/rustc-1.19.0"
|
|
channel = "stable"
|
|
EOF</userinput></screen>
|
|
|
|
<para>
|
|
Now install <application>Rust</application> by running the following
|
|
commands:
|
|
</para>
|
|
|
|
<screen><userinput>./x.py build</userinput></screen>
|
|
|
|
<para>
|
|
To run the tests issue
|
|
<command>./x.py test --verbose --no-fail-fast >../rustc-testlog</command>:
|
|
as with the build, that will use all available CPUs. This runs many suites
|
|
of tests (in an apparently random order), three may fail:
|
|
compile-fail/issue-37131.rs and run-make/target-without-atomics both try to
|
|
compile for the thumbv6m-none-eabi target, but the BLFS build does not cater for
|
|
that, and all 105 tests in debuginfo-gdb will fail if
|
|
<application>gdb</application> has not been installed.
|
|
</para>
|
|
|
|
<para>
|
|
If you wish to look at the numbers for the results, you can find the total
|
|
number of tests which were considered by running:
|
|
</para>
|
|
|
|
<screen><command>grep 'running .* tests' ../rustc-testlog | awk '{ sum += $2 } END { print sum }'</command></screen>
|
|
|
|
<para>
|
|
That should report 14029 tests. Similarly, the total tests which failed can
|
|
be found by running:
|
|
</para>
|
|
|
|
<screen><command>grep '^test result:' ../rustc-testlog | awk '{ sum += $6 } END { print sum }'</command></screen>
|
|
|
|
<para>
|
|
And similarly for the tests which passed use $4, for those which were ignored
|
|
(i.e. skipped) use $8 (and $10 for 'measured', $12 for 'filtered out' but both
|
|
are probably zero). The breakdown does not match the overall total.
|
|
</para>
|
|
|
|
<para>
|
|
Now, as the <systemitem class="username">root</systemitem> user:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>./x.py install</userinput></screen>
|
|
</sect2>
|
|
|
|
<sect2 role="commands">
|
|
<title>Command Explanations</title>
|
|
|
|
<para>
|
|
<command>targets = "X86"</command>: this avoids building all the available
|
|
linux cross-compilers (Aarch64, MIPS, PowerPC, SystemZ, etc).
|
|
</para>
|
|
|
|
<para>
|
|
<command>extended = true</command>: this installs Cargo alongside Rust.
|
|
</para>
|
|
|
|
<para>
|
|
<command>channel = "stable"</command>: this ensures only stable features
|
|
can be used, the default in <filename>config.toml</filename> is to use
|
|
development features, which is not appropriate for a released version.
|
|
</para>
|
|
|
|
<para>
|
|
<command>--verbose</command>: this switch can sometimes provide more
|
|
information about a test which fails.
|
|
</para>
|
|
|
|
<para>
|
|
<command>--no-fail-fast</command>: this switch ensures that the testsuite
|
|
will not stop at the first error.
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="content">
|
|
<title>Contents</title>
|
|
|
|
<segmentedlist>
|
|
<segtitle>Installed Programs</segtitle>
|
|
<segtitle>Installed Libraries</segtitle>
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
<seglistitem>
|
|
<seg>
|
|
cargo, rust-gdb, rust-lldb, rustc, rustdoc.
|
|
</seg>
|
|
<seg>
|
|
Many lib*<16-byte-hash>.so libraries.
|
|
</seg>
|
|
<seg>
|
|
~/.cargo,
|
|
/usr/lib/rustlib,
|
|
/usr/share/doc/rustc-&rust-version;, and
|
|
/usr/share/zsh/site-functions/
|
|
</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<variablelist>
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
<?dbfo list-presentation="list"?>
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
<varlistentry id="cargo">
|
|
<term><command>cargo</command></term>
|
|
<listitem>
|
|
<para>
|
|
is the Package Manager for Rust.
|
|
</para>
|
|
<indexterm zone="rust cargo">
|
|
<primary sortas="b-cargo">cargo</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="rust-gdb">
|
|
<term><command>rust-gdb</command></term>
|
|
<listitem>
|
|
<para>
|
|
is a Python wrapper script for gdb.
|
|
</para>
|
|
<indexterm zone="rust rust-gdb">
|
|
<primary sortas="b-rust-gdb">rust-gdb</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="rust-lldb">
|
|
<term><command>rust-lldb</command></term>
|
|
<listitem>
|
|
<para>
|
|
is a Python wrapper script for LLDB (the LLVM debugger).
|
|
</para>
|
|
<indexterm zone="rust rust-lldb">
|
|
<primary sortas="b-rust-lldb">rust=lldb</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="rustc">
|
|
<term><command>rustc</command></term>
|
|
<listitem>
|
|
<para>
|
|
is the rust compiler.
|
|
</para>
|
|
<indexterm zone="rust rustc">
|
|
<primary sortas="b-rustc">rustc</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="rustdoc">
|
|
<term><command>rustdoc</command></term>
|
|
<listitem>
|
|
<para>
|
|
generates documentation from rust source code.
|
|
</para>
|
|
<indexterm zone="rust rustdoc">
|
|
<primary sortas="b-rustdoc">rustdoc</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="libstd">
|
|
<term><filename class="libraryfile">libstd-<16-byte-hash>.so</filename></term>
|
|
<listitem>
|
|
<para>
|
|
is the Rust Standard Library, the foundation of portable Rust software.
|
|
</para>
|
|
<indexterm zone="rust libstd">
|
|
<primary sortas="c-libstd">libstd-<16-byte-hash>.so</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</sect2>
|
|
</sect1>
|