[03d537cd] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[614fc25f] | 7 | <!ENTITY rust-download-http "https://static.rust-lang.org/dist/rustc-&rust-version;-src.tar.gz">
|
---|
[d9bcc5f] | 8 | <!ENTITY rust-download-ftp " ">
|
---|
[25997c4a] | 9 | <!ENTITY rust-md5sum "366f049777e00d0d6f15d25895485efb">
|
---|
| 10 | <!ENTITY rust-size "152 MB">
|
---|
| 11 | <!-- Gentle Reminder: buildsize is how much the user requires for the real
|
---|
| 12 | install, i.e. the source with its DESTDIR *plus* the DESTDIR. You
|
---|
| 13 | can 'mkdir /tmp/RUST ; cp -a install/* /tmp/RUST' and then run 'du -sch'
|
---|
| 14 | to measure it. -->
|
---|
| 15 |
|
---|
| 16 | <!ENTITY rust-buildsize "6.2 GB (475 MB installed) including 295MB of ~/.cargo files for the user building this. Add 1.5GB if installing the documentation (an extra 314MB is installed), and 2.0GB if running the tests">
|
---|
| 17 | <!ENTITY rust-time "34 SBU (add 3 SBU if installing the documentation and 15 SBU for tests, both with 4 processors)">
|
---|
[03d537cd] | 18 | ]>
|
---|
| 19 |
|
---|
| 20 | <sect1 id="rust" xreflabel="rustc-&rust-version;">
|
---|
| 21 | <?dbhtml filename="rust.html"?>
|
---|
| 22 |
|
---|
| 23 | <sect1info>
|
---|
| 24 | <othername>$LastChangedBy$</othername>
|
---|
| 25 | <date>$Date$</date>
|
---|
| 26 | </sect1info>
|
---|
| 27 |
|
---|
| 28 | <title>Rustc-&rust-version;</title>
|
---|
| 29 |
|
---|
| 30 | <indexterm zone="rust">
|
---|
| 31 | <primary sortas="a-rust">Rust</primary>
|
---|
| 32 | </indexterm>
|
---|
| 33 |
|
---|
| 34 | <sect2 role="package">
|
---|
| 35 | <title>Introduction to Rust</title>
|
---|
| 36 |
|
---|
| 37 | <para>
|
---|
| 38 | The <application>Rust</application> programming language is designed
|
---|
| 39 | to be a safe, concurrent, practical language.
|
---|
| 40 | </para>
|
---|
| 41 |
|
---|
[25997c4a] | 42 | <para>
|
---|
| 43 | This package is updated on a six-weekly release cycle. Because it is
|
---|
| 44 | such a large and slow package to build, and is at the moment only required
|
---|
| 45 | by five packages in this book, the BLFS editors take the view that it
|
---|
| 46 | should only be updated when that is necessary (either to fix problems,
|
---|
| 47 | or to allow a new version of <application>firefox</application> to build).
|
---|
| 48 | </para>
|
---|
| 49 |
|
---|
[03d537cd] | 50 | <para>
|
---|
| 51 | As with many other programming languages, rustc (the rust compiler)
|
---|
[a7b1bddc] | 52 | needs a binary from which to bootstrap. It will download a stage0 binary
|
---|
| 53 | and many cargo crates (these are actually .tar.gz source archives) at
|
---|
[03d537cd] | 54 | the start of the build, so you cannot compile it without an internet
|
---|
| 55 | connection.
|
---|
| 56 | </para>
|
---|
| 57 |
|
---|
[25997c4a] | 58 | <para>
|
---|
| 59 | These crates will then remain in various forms (cache, directories of
|
---|
| 60 | extracted source), in <filename class="directory">~/.cargo</filename> for
|
---|
| 61 | ever more. It is common for large <application>rust</application> packages
|
---|
| 62 | to use multiple versions of some crates. If you purge the files before
|
---|
| 63 | updating this package, very few crates will need to be updated by the
|
---|
| 64 | packages in this book which use it (and they will be downloaded as
|
---|
| 65 | required). But if you retain an older version as a fallback option and
|
---|
[b05ea0b] | 66 | then use it (when <emphasis>not</emphasis> building in
|
---|
[25997c4a] | 67 | <filename class="directory">/usr</filename>), it is likely that it will
|
---|
[b05ea0b] | 68 | then have to re-download some crates. For a full download (i.e. starting
|
---|
[25997c4a] | 69 | with an empty or missing <filename class="directory">~/.cargo</filename>)
|
---|
| 70 | downloading the external cargo files for this version only takes a minute
|
---|
| 71 | or so on a fast network.
|
---|
| 72 | </para>
|
---|
| 73 |
|
---|
| 74 | <note>
|
---|
| 75 | <para>
|
---|
[d396c65] | 76 | Although BLFS usually installs in <filename
|
---|
| 77 | class="directory">/usr</filename>, when you later upgrade to a newer
|
---|
| 78 | version of <application>rust</application> the old libraries in <filename
|
---|
| 79 | class="directory">/usr/lib/rustlib</filename> will remain, with various
|
---|
| 80 | hashes in their names, but will not be usable and will waste space. The
|
---|
| 81 | editors recommend placing the files in the <filename
|
---|
| 82 | class="directory">/opt</filename> directory. In particular, if you
|
---|
| 83 | have reason to rebuild with a modified configuration (e.g. using the
|
---|
| 84 | shipped LLVM after building with shared LLVM, but perhaps also the
|
---|
| 85 | reverse situation) it it possible for the install to leave a broken
|
---|
| 86 | <command>cargo</command> program. In such a situation, either remove
|
---|
| 87 | the existing installation first, or use a different prefix such as
|
---|
| 88 | /opt/rustc-&rust-version;-build2.
|
---|
[25997c4a] | 89 | </para>
|
---|
[b05ea0b] | 90 |
|
---|
| 91 | <para>
|
---|
[d396c65] | 92 | If you prefer, you can of course change the prefix to <filename
|
---|
| 93 | class="directory">/usr</filename> and omit the
|
---|
| 94 | <command>ldconfig</command> and the actions to add rustc to the PATH.
|
---|
[b05ea0b] | 95 | </para>
|
---|
[25997c4a] | 96 | </note>
|
---|
| 97 |
|
---|
[03d537cd] | 98 | <para>
|
---|
| 99 | The current <application>rustbuild</application> build-system will use
|
---|
| 100 | all available processors, although it does not scale well and often falls
|
---|
| 101 | back to just using one core while waiting for a library to compile.
|
---|
| 102 | </para>
|
---|
| 103 |
|
---|
| 104 | <para>
|
---|
| 105 | At the moment <application>Rust</application> does not provide any
|
---|
[4c6edac] | 106 | guarantees of a stable ABI.
|
---|
[03d537cd] | 107 | </para>
|
---|
| 108 |
|
---|
[326f830] | 109 | <note>
|
---|
[7d259126] | 110 | <para>
|
---|
| 111 | Rustc defaults to building for ALL supported architectures, using a
|
---|
| 112 | shipped copy of LLVM. In BLFS the build is only for the X86 architecture.
|
---|
[d396c65] | 113 | If you intend to develop rust crates, this build may not be good
|
---|
[b05ea0b] | 114 | enough for your purposes.
|
---|
[7d259126] | 115 | </para>
|
---|
[326f830] | 116 | <para>
|
---|
[25997c4a] | 117 | Unlike with previous versions, the build times of this version when
|
---|
| 118 | repeated on the same machine seem reasonably consistent.
|
---|
[326f830] | 119 | </para>
|
---|
| 120 | <para>
|
---|
[bb0652ca] | 121 | Unusually, a DESTDIR-style method is being used to install this package.
|
---|
| 122 | This is because running the install as root not only downloads all of the
|
---|
[a7b1bddc] | 123 | cargo files again (to <filename>/root/.cargo</filename>), it then spends
|
---|
[7d259126] | 124 | a very long time recompiling. Using this method saves a lot of time, at
|
---|
| 125 | the cost of extra disk space.
|
---|
[326f830] | 126 | </para>
|
---|
| 127 | </note>
|
---|
| 128 |
|
---|
[272f28b] | 129 | &lfs83_checked;
|
---|
[03d537cd] | 130 |
|
---|
| 131 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 132 | <itemizedlist spacing="compact">
|
---|
| 133 | <listitem>
|
---|
| 134 | <para>
|
---|
| 135 | Download (HTTP): <ulink url="&rust-download-http;"/>
|
---|
| 136 | </para>
|
---|
| 137 | </listitem>
|
---|
| 138 | <listitem>
|
---|
| 139 | <para>
|
---|
| 140 | Download (FTP): <ulink url="&rust-download-ftp;"/>
|
---|
| 141 | </para>
|
---|
| 142 | </listitem>
|
---|
| 143 | <listitem>
|
---|
| 144 | <para>
|
---|
| 145 | Download MD5 sum: &rust-md5sum;
|
---|
| 146 | </para>
|
---|
| 147 | </listitem>
|
---|
| 148 | <listitem>
|
---|
| 149 | <para>
|
---|
| 150 | Download size: &rust-size;
|
---|
| 151 | </para>
|
---|
| 152 | </listitem>
|
---|
| 153 | <listitem>
|
---|
| 154 | <para>
|
---|
| 155 | Estimated disk space required: &rust-buildsize;
|
---|
| 156 | </para>
|
---|
| 157 | </listitem>
|
---|
| 158 | <listitem>
|
---|
| 159 | <para>
|
---|
| 160 | Estimated build time: &rust-time;
|
---|
| 161 | </para>
|
---|
| 162 | </listitem>
|
---|
| 163 | </itemizedlist>
|
---|
| 164 |
|
---|
| 165 | <bridgehead renderas="sect3">Rust Dependencies</bridgehead>
|
---|
| 166 |
|
---|
| 167 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 168 | <para role="required">
|
---|
| 169 | <xref linkend="curl"/>,
|
---|
[4c6edac] | 170 | <xref linkend="cmake"/>,
|
---|
[cfa8b6d] | 171 | <xref linkend="libssh2"/>, and
|
---|
| 172 | <xref linkend="python2"/>
|
---|
[03d537cd] | 173 | </para>
|
---|
| 174 |
|
---|
[25997c4a] | 175 | <!-- comment out while using shipped LLVM
|
---|
[a7b1bddc] | 176 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 177 | <para role="recommended">
|
---|
| 178 | <package>clang</package> from <xref linkend="llvm"/>
|
---|
[bb0652ca] | 179 | (built with -DLLVM_LINK_LLVM_DYLIB=ON)
|
---|
[25997c4a] | 180 | </para>-->
|
---|
[a7b1bddc] | 181 |
|
---|
[03d537cd] | 182 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 183 | <para role="optional">
|
---|
[25997c4a] | 184 | <xref linkend="gdb"/> (used by the testsuite if it is present)
|
---|
[03d537cd] | 185 | </para>
|
---|
| 186 |
|
---|
| 187 | <para condition="html" role="usernotes">
|
---|
| 188 | User Notes: <ulink url="&blfs-wiki;/rust"/>
|
---|
| 189 | </para>
|
---|
| 190 | </sect2>
|
---|
| 191 |
|
---|
| 192 | <sect2 role="installation">
|
---|
| 193 | <title>Installation of Rust</title>
|
---|
| 194 |
|
---|
| 195 | <para>
|
---|
[d396c65] | 196 | To install into the
|
---|
| 197 | <filename class="directory">/opt</filename> directory, remove the symlink
|
---|
| 198 | and create a new directory (i.e. with a different name if trying a
|
---|
| 199 | modified build).
|
---|
[b05ea0b] | 200 | As the <systemitem class="username">root</systemitem>
|
---|
| 201 | user:
|
---|
| 202 | </para>
|
---|
| 203 |
|
---|
[d396c65] | 204 | <screen role="root"><userinput>mkdir /opt/rustc-&rust-version; &&
|
---|
| 205 | ln -svfin rustc-&rust-version; /opt/rustc</userinput></screen>
|
---|
[b05ea0b] | 206 |
|
---|
| 207 | <note>
|
---|
| 208 | <para>
|
---|
| 209 | If multiple versions of <application>Rust</application> are installed
|
---|
| 210 | in <filename class="directory">/opt</filename>, changing to another
|
---|
| 211 | version only requires changing the <filename> /opt/rustc</filename>
|
---|
| 212 | symbolic link and then running <command>ldconfig</command>.
|
---|
| 213 | </para>
|
---|
| 214 | </note>
|
---|
| 215 |
|
---|
| 216 | <para>
|
---|
| 217 | Create a suitable <filename>config.toml</filename> file which will
|
---|
[25997c4a] | 218 | configure the build. Unlike with previous releases, where even quite old
|
---|
| 219 | system versions of <application>LLVM</application>worked well, this
|
---|
| 220 | version ships with a development version and using the current <xref
|
---|
| 221 | linkend="llvm"/> release is known to result in breakage in some
|
---|
| 222 | circumstances.
|
---|
[4c6edac] | 223 | </para>
|
---|
| 224 |
|
---|
[272f28b] | 225 | <screen><userinput>cat << EOF > config.toml
|
---|
[326f830] | 226 | # see config.toml.example for more possible options
|
---|
[4c6edac] | 227 | [llvm]
|
---|
| 228 |
|
---|
[25997c4a] | 229 | # use ninja
|
---|
| 230 | ninja = true
|
---|
| 231 |
|
---|
| 232 | targets = "X86"
|
---|
| 233 | # When compiling LLVM, the experimental targets (WebAssembly
|
---|
| 234 | # and RISCV) are built by default - omit them
|
---|
| 235 | experimental-targets = ""
|
---|
[a7b1bddc] | 236 |
|
---|
[4c6edac] | 237 | [build]
|
---|
[07a48bb] | 238 | # omit HTML docs to save time and space (comment this to build them)
|
---|
[25997c4a] | 239 | docs = false
|
---|
| 240 |
|
---|
[4c6edac] | 241 | # install cargo as well as rust
|
---|
| 242 | extended = true
|
---|
| 243 |
|
---|
| 244 | [install]
|
---|
[b05ea0b] | 245 | # Adjust the prefix for the desired destination
|
---|
| 246 | #prefix = "/usr"
|
---|
| 247 | prefix = "/opt/rustc-&rust-version;"
|
---|
| 248 |
|
---|
[25997c4a] | 249 | # docdir is used even if the full awesome docs are not installed
|
---|
[326f830] | 250 | docdir = "share/doc/rustc-&rust-version;"
|
---|
| 251 |
|
---|
| 252 | [rust]
|
---|
[4c6edac] | 253 | channel = "stable"
|
---|
[326f830] | 254 | rpath = false
|
---|
[a7b1bddc] | 255 |
|
---|
| 256 | # BLFS does not install the FileCheck executable from llvm,
|
---|
| 257 | # so disable codegen tests
|
---|
| 258 | codegen-tests = false
|
---|
| 259 |
|
---|
[25997c4a] | 260 | # get a trace if there is an Internal Compiler Exception
|
---|
| 261 | backtrace-on-ice = true
|
---|
[a7b1bddc] | 262 |
|
---|
[4c6edac] | 263 | EOF</userinput></screen>
|
---|
| 264 |
|
---|
| 265 | <para>
|
---|
| 266 | Now install <application>Rust</application> by running the following
|
---|
[03d537cd] | 267 | commands:
|
---|
| 268 | </para>
|
---|
| 269 |
|
---|
[bb0652ca] | 270 | <screen><userinput>export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi" &&
|
---|
[25997c4a] | 271 | ./x.py build --exclude src/tools/miri</userinput></screen>
|
---|
[a7b1bddc] | 272 |
|
---|
[6bcd464] | 273 | <note>
|
---|
[a7b1bddc] | 274 | <para>
|
---|
[6bcd464] | 275 | The testsuite will generate some messages in the
|
---|
[a7b1bddc] | 276 | <phrase revision="sysv">system log</phrase>
|
---|
| 277 | <phrase revision="systemd">systemd journal</phrase>
|
---|
[6bcd464] | 278 | for traps on invalid opcodes, and for segmentation faults.
|
---|
[25997c4a] | 279 | In themselves these are nothing to worry about, just a way for the
|
---|
| 280 | test to be terminated. But if the output from the testsuite reports tests
|
---|
| 281 | which FAIL with segmentation faults (signal 11) then there may be a
|
---|
| 282 | problem.
|
---|
[a7b1bddc] | 283 | </para>
|
---|
[6bcd464] | 284 | </note>
|
---|
[a7b1bddc] | 285 |
|
---|
[03d537cd] | 286 | <para>
|
---|
[4c6edac] | 287 | To run the tests issue
|
---|
[cfa8b6d] | 288 | <command>./x.py test --verbose --no-fail-fast | tee rustc-testlog</command>:
|
---|
[25997c4a] | 289 | as with the build, that will use all available CPUs.
|
---|
[03d537cd] | 290 | </para>
|
---|
| 291 |
|
---|
| 292 | <para>
|
---|
[25997c4a] | 293 | The instructions above do not build ARM compilers, so the testsuite
|
---|
| 294 | <emphasis>will</emphasis> fail and the tests will be reported to end in
|
---|
| 295 | error, with a backtrace of the last failing test. On a good run, 3 tests
|
---|
| 296 | which need Thumb (ARM) compilers will fail, all in <filename
|
---|
| 297 | class="directory">ui/issues</filename> for issues 37131, 49851 and 50993.
|
---|
[4cc77fbd] | 298 | Occasionally a fourth test, 'run-make-fulldeps/sysroot-crates-are-unstable'
|
---|
| 299 | fails. If gdb has been installed, in some circumstances three tests in
|
---|
| 300 | debuginfo-both also fail. As with all large testsuites, other tests might
|
---|
| 301 | fail on some machines - if the number of failures is in the single digits,
|
---|
| 302 | check the log for 'FAILED' and review lines above that. Any mention of
|
---|
| 303 | SIGSEGV or signal 11 in a failing test is a cause for concern.
|
---|
[25997c4a] | 304 | </para>
|
---|
| 305 |
|
---|
| 306 | <para>
|
---|
| 307 | Therefore, you should determine the number of tests, failures, etc. The
|
---|
| 308 | total number of tests which were considered is found by running:
|
---|
[03d537cd] | 309 | </para>
|
---|
| 310 |
|
---|
[7d259126] | 311 | <screen><command>grep 'running .* tests' rustc-testlog | awk '{ sum += $2 } END { print sum }'</command></screen>
|
---|
[4c6edac] | 312 |
|
---|
[03d537cd] | 313 | <para>
|
---|
[25997c4a] | 314 | That should report 15795 tests. Similarly, the total tests which failed can
|
---|
[4c6edac] | 315 | be found by running:
|
---|
[03d537cd] | 316 | </para>
|
---|
| 317 |
|
---|
[7d259126] | 318 | <screen><command>grep '^test result:' rustc-testlog | awk '{ sum += $6 } END { print sum }'</command></screen>
|
---|
[03d537cd] | 319 |
|
---|
[4c6edac] | 320 | <para>
|
---|
| 321 | And similarly for the tests which passed use $4, for those which were ignored
|
---|
| 322 | (i.e. skipped) use $8 (and $10 for 'measured', $12 for 'filtered out' but both
|
---|
[25997c4a] | 323 | are probably zero). The breakdown does not quite match the overall total.
|
---|
[4c6edac] | 324 | </para>
|
---|
| 325 |
|
---|
| 326 | <para>
|
---|
[a7b1bddc] | 327 | Still as your normal user, do a DESTDIR install:
|
---|
[4c6edac] | 328 | </para>
|
---|
| 329 |
|
---|
[fb940713] | 330 | <screen><userinput>export LIBSSH2_SYS_USE_PKG_CONFIG=1 &&
|
---|
[cfa8b6d] | 331 | DESTDIR=${PWD}/install ./x.py install &&
|
---|
[fb940713] | 332 | unset LIBSSH2_SYS_USE_PKG_CONFIG</userinput></screen>
|
---|
[a7b1bddc] | 333 |
|
---|
| 334 | <para>
|
---|
| 335 | Now, as the <systemitem class="username">root</systemitem> user
|
---|
| 336 | install the files from the DESTDIR:
|
---|
| 337 | </para>
|
---|
| 338 |
|
---|
[bb0652ca] | 339 | <screen role="root"><userinput>chown -R root:root install &&
|
---|
| 340 | cp -a install/* /</userinput></screen>
|
---|
[a7b1bddc] | 341 |
|
---|
[03d537cd] | 342 | </sect2>
|
---|
| 343 |
|
---|
| 344 | <sect2 role="commands">
|
---|
| 345 | <title>Command Explanations</title>
|
---|
| 346 |
|
---|
| 347 | <para>
|
---|
[d396c65] | 348 | <command>ln -svfn rustc-&rust-version; /opt/rustc</command>: if this is
|
---|
| 349 | not the first use of the <filename class="directory">/opt/rustc</filename>
|
---|
| 350 | symlink, overwrite it by forcing, and use the '-n' flag to avoid getting
|
---|
| 351 | confusing results from e.g. <command>ls -l</command>.
|
---|
| 352 | </para>
|
---|
| 353 |
|
---|
| 354 | <para>
|
---|
[4c6edac] | 355 | <command>targets = "X86"</command>: this avoids building all the available
|
---|
[a7b1bddc] | 356 | linux cross-compilers (Aarch64, MIPS, PowerPC, SystemZ, etc). Unfortunately,
|
---|
| 357 | rust insists on installing source files for these below
|
---|
| 358 | <filename class="directory">/usr/lib/rustlib/src</filename>.
|
---|
[03d537cd] | 359 | </para>
|
---|
| 360 |
|
---|
| 361 | <para>
|
---|
[4c6edac] | 362 | <command>extended = true</command>: this installs Cargo alongside Rust.
|
---|
[03d537cd] | 363 | </para>
|
---|
| 364 |
|
---|
| 365 | <para>
|
---|
[4c6edac] | 366 | <command>channel = "stable"</command>: this ensures only stable features
|
---|
| 367 | can be used, the default in <filename>config.toml</filename> is to use
|
---|
| 368 | development features, which is not appropriate for a released version.
|
---|
[03d537cd] | 369 | </para>
|
---|
| 370 |
|
---|
[326f830] | 371 | <para>
|
---|
| 372 | <command>rpath = false</command>: by default, <command>rust</command> can
|
---|
| 373 | be run from where it was built, without being installed. That adds DT_RPATH
|
---|
| 374 | entries to all of the ELF files, which produces very messy output from
|
---|
| 375 | <command>ldd</command>, showing the libraries in the place they were built,
|
---|
| 376 | even if they have been deleted from there after the install.
|
---|
| 377 | </para>
|
---|
| 378 |
|
---|
[25997c4a] | 379 | <!-- comment while using shipped LLVM
|
---|
[a7b1bddc] | 380 | <para>
|
---|
| 381 | <command>[target.x86_64-unknown-linux-gnu]</command>: the syntax of
|
---|
| 382 | <filename>config.toml</filename> requires an <literal>llvm-config</literal>
|
---|
| 383 | entry for each target for which system-llvm is to be used. Change the target
|
---|
| 384 | to <literal>[target.i686-unknown-linux-gnu]</literal> if you are building
|
---|
| 385 | on 32-bit x86. This whole section may be omitted if you wish to build
|
---|
| 386 | against the shipped llvm, or do not have clang, but the resulting build will
|
---|
[7d259126] | 387 | be larger and take longer.
|
---|
[25997c4a] | 388 | </para>-->
|
---|
[a7b1bddc] | 389 |
|
---|
[bb0652ca] | 390 | <para>
|
---|
| 391 | <command>export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"</command>:
|
---|
| 392 | This adds a link to libffi to any RUSTFLAGS you may already be passing
|
---|
| 393 | to the build. On some systems, linking fails to include libffi unless
|
---|
| 394 | this is used. The reason why this is needed is not clear.
|
---|
| 395 | </para>
|
---|
| 396 |
|
---|
[25997c4a] | 397 | <para>
|
---|
| 398 | <command>--exclude src/tools/miri</command>: For a long time, the miri
|
---|
| 399 | crate (an interpreter for the Midlevel Intermediate Representation)
|
---|
| 400 | has failed to build on releases. It is optional, but the failure
|
---|
| 401 | messages can persuade people that the whole build failed.
|
---|
| 402 | </para>
|
---|
| 403 |
|
---|
[03d537cd] | 404 | <para>
|
---|
[4c6edac] | 405 | <command>--verbose</command>: this switch can sometimes provide more
|
---|
| 406 | information about a test which fails.
|
---|
[03d537cd] | 407 | </para>
|
---|
[4c6edac] | 408 |
|
---|
| 409 | <para>
|
---|
| 410 | <command>--no-fail-fast</command>: this switch ensures that the testsuite
|
---|
| 411 | will not stop at the first error.
|
---|
| 412 | </para>
|
---|
| 413 |
|
---|
[fb940713] | 414 | <para>
|
---|
| 415 | <command>export LIBSSH2_SYS_USE_PKG_CONFIG=1</command>: On some systems,
|
---|
| 416 | cairo fails to link during the install because it cannot find libssh2.
|
---|
| 417 | This seems to fix it, but again the reason why the problem occurs is not
|
---|
| 418 | understood.
|
---|
| 419 | </para>
|
---|
| 420 |
|
---|
[326f830] | 421 | <para>
|
---|
[bb0652ca] | 422 | <command>DESTDIR=${PWD}/install ./x.py install</command>: This effects a
|
---|
| 423 | DESTDIR-style install in the source tree,creating an <filename
|
---|
| 424 | class="directory">install</filename> directory. Note that DESTDIR installs
|
---|
| 425 | need an absolute path, passing 'install' will not work.
|
---|
[a7b1bddc] | 426 | </para>
|
---|
| 427 |
|
---|
| 428 | <para>
|
---|
[bb0652ca] | 429 | <command>chown -R root:root install</command>: the DESTDIR install
|
---|
[a7b1bddc] | 430 | was run by a regular user, who owns the files. For security, change their
|
---|
| 431 | owner before doing a simple copy to install them.
|
---|
[326f830] | 432 | </para>
|
---|
| 433 |
|
---|
[03d537cd] | 434 | </sect2>
|
---|
| 435 |
|
---|
[b05ea0b] | 436 | <sect2 role="configuration">
|
---|
| 437 | <title>Configuring Rust</title>
|
---|
| 438 |
|
---|
| 439 | <sect3 id="rustc-config">
|
---|
| 440 | <title>Configuration Information</title>
|
---|
| 441 |
|
---|
| 442 | <para>
|
---|
| 443 | If you installed <application>rustc</application> in
|
---|
| 444 | <filename class="directory">/opt</filename>, you need to update the
|
---|
| 445 | following configuration files so that <application>rustc</application> is
|
---|
| 446 | correctly found by other packages and system processes.
|
---|
| 447 | </para>
|
---|
| 448 |
|
---|
| 449 | <para>
|
---|
| 450 | As the <systemitem class="username">root</systemitem> user, update
|
---|
| 451 | the <filename>/etc/ld.so.conf</filename> file and the dynamic linker's
|
---|
| 452 | run-time cache file:
|
---|
| 453 | </para>
|
---|
| 454 |
|
---|
| 455 | <screen role="root"><userinput>cat >> /etc/ld.so.conf << EOF
|
---|
| 456 | <literal># Begin rustc addition
|
---|
| 457 |
|
---|
| 458 | /opt/rustc/lib
|
---|
| 459 |
|
---|
| 460 | # End rustc addition</literal>
|
---|
| 461 | EOF
|
---|
| 462 |
|
---|
| 463 | ldconfig</userinput></screen>
|
---|
| 464 |
|
---|
| 465 | <indexterm zone="rustc rustc-config">
|
---|
| 466 | <primary sortas="e-etc-ld.so.conf">/etc/ld.so.conf</primary>
|
---|
| 467 | </indexterm>
|
---|
| 468 |
|
---|
| 469 | <para>
|
---|
| 470 | As the <systemitem class="username">root</systemitem> user, create
|
---|
| 471 | the <filename>/etc/profile.d/rustc.sh</filename> file:
|
---|
| 472 | </para>
|
---|
| 473 |
|
---|
| 474 | <screen role="root"><userinput>cat > /etc/profile.d/rustc.sh << "EOF"
|
---|
| 475 | <literal># Begin /etc/profile.d/rustc.sh
|
---|
| 476 |
|
---|
| 477 | pathprepend /opt/rustc/bin PATH
|
---|
| 478 |
|
---|
| 479 | # End /etc/profile.d/rustc.sh</literal>
|
---|
| 480 | EOF</userinput></screen>
|
---|
| 481 |
|
---|
| 482 | <para>Immediately after installation, update the current PATH
|
---|
| 483 | for your current shell as a normal user:</para>
|
---|
| 484 |
|
---|
| 485 | <screen><userinput>source /etc/profile.d/rustc.sh</userinput></screen>
|
---|
| 486 |
|
---|
| 487 | </sect3>
|
---|
| 488 | </sect2>
|
---|
| 489 |
|
---|
| 490 |
|
---|
[03d537cd] | 491 | <sect2 role="content">
|
---|
| 492 | <title>Contents</title>
|
---|
| 493 |
|
---|
| 494 | <segmentedlist>
|
---|
[78399edc] | 495 | <segtitle>Installed Programs</segtitle>
|
---|
| 496 | <segtitle>Installed Libraries</segtitle>
|
---|
| 497 | <segtitle>Installed Directories</segtitle>
|
---|
[03d537cd] | 498 |
|
---|
| 499 | <seglistitem>
|
---|
| 500 | <seg>
|
---|
[7d259126] | 501 | cargo-clippy, cargo-fmt, cargo, clippy-driver, rls, rust-gdb, rust-lldb, rustc, rustdoc, rustfmt.
|
---|
[03d537cd] | 502 | </seg>
|
---|
| 503 | <seg>
|
---|
[4c6edac] | 504 | Many lib*<16-byte-hash>.so libraries.
|
---|
[03d537cd] | 505 | </seg>
|
---|
| 506 | <seg>
|
---|
| 507 | ~/.cargo,
|
---|
[4c6edac] | 508 | /usr/lib/rustlib,
|
---|
| 509 | /usr/share/doc/rustc-&rust-version;, and
|
---|
| 510 | /usr/share/zsh/site-functions/
|
---|
[03d537cd] | 511 | </seg>
|
---|
| 512 | </seglistitem>
|
---|
| 513 | </segmentedlist>
|
---|
| 514 |
|
---|
| 515 | <variablelist>
|
---|
| 516 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 517 | <?dbfo list-presentation="list"?>
|
---|
| 518 | <?dbhtml list-presentation="table"?>
|
---|
| 519 |
|
---|
[7d259126] | 520 | <varlistentry id="cargo-clippy">
|
---|
| 521 | <term><command>cargo-clippy</command></term>
|
---|
| 522 | <listitem>
|
---|
| 523 | <para>
|
---|
| 524 | provides lint checks for a cargo package.
|
---|
| 525 | </para>
|
---|
| 526 | <indexterm zone="rust cargo-clippy">
|
---|
| 527 | <primary sortas="b-cargo-clippy">cargo-clippy</primary>
|
---|
| 528 | </indexterm>
|
---|
| 529 | </listitem>
|
---|
| 530 | </varlistentry>
|
---|
| 531 |
|
---|
[a7b1bddc] | 532 | <varlistentry id="cargo-fmt">
|
---|
| 533 | <term><command>cargo-fmt</command></term>
|
---|
| 534 | <listitem>
|
---|
| 535 | <para>
|
---|
| 536 | formats all bin and lib files of the current crate using
|
---|
| 537 | rustfmt.
|
---|
| 538 | </para>
|
---|
| 539 | <indexterm zone="rust cargo-fmt">
|
---|
| 540 | <primary sortas="b-cargo-fmt">cargo-fmt</primary>
|
---|
| 541 | </indexterm>
|
---|
| 542 | </listitem>
|
---|
| 543 | </varlistentry>
|
---|
| 544 |
|
---|
[4c6edac] | 545 | <varlistentry id="cargo">
|
---|
| 546 | <term><command>cargo</command></term>
|
---|
| 547 | <listitem>
|
---|
| 548 | <para>
|
---|
| 549 | is the Package Manager for Rust.
|
---|
| 550 | </para>
|
---|
| 551 | <indexterm zone="rust cargo">
|
---|
| 552 | <primary sortas="b-cargo">cargo</primary>
|
---|
| 553 | </indexterm>
|
---|
| 554 | </listitem>
|
---|
| 555 | </varlistentry>
|
---|
| 556 |
|
---|
[7d259126] | 557 | <varlistentry id="clippy-driver">
|
---|
| 558 | <term><command>clippy-driver</command></term>
|
---|
| 559 | <listitem>
|
---|
| 560 | <para>
|
---|
| 561 | provides lint checks for Rust.
|
---|
| 562 | </para>
|
---|
| 563 | <indexterm zone="rust clippy-driver">
|
---|
| 564 | <primary sortas="b-clippy-driver">clippy-driver</primary>
|
---|
| 565 | </indexterm>
|
---|
| 566 | </listitem>
|
---|
| 567 | </varlistentry>
|
---|
| 568 |
|
---|
[326f830] | 569 | <varlistentry id="rls">
|
---|
| 570 | <term><command>rls</command></term>
|
---|
| 571 | <listitem>
|
---|
| 572 | <para>
|
---|
| 573 | is the Rust Language Server. This can run in the background to
|
---|
| 574 | provide IDEs, editors, and other tools with information about Rust
|
---|
| 575 | programs.
|
---|
| 576 | </para>
|
---|
| 577 | <indexterm zone="rust rls">
|
---|
| 578 | <primary sortas="b-rls">rls</primary>
|
---|
| 579 | </indexterm>
|
---|
| 580 | </listitem>
|
---|
| 581 | </varlistentry>
|
---|
| 582 |
|
---|
[03d537cd] | 583 | <varlistentry id="rust-gdb">
|
---|
| 584 | <term><command>rust-gdb</command></term>
|
---|
| 585 | <listitem>
|
---|
| 586 | <para>
|
---|
[a7b1bddc] | 587 | is a wrapper script for gdb, pulling in Python
|
---|
| 588 | pretty-printing modules installed in <filename
|
---|
| 589 | class="directory">/usr/lib/rustlib/etc</filename>.
|
---|
[03d537cd] | 590 | </para>
|
---|
| 591 | <indexterm zone="rust rust-gdb">
|
---|
| 592 | <primary sortas="b-rust-gdb">rust-gdb</primary>
|
---|
| 593 | </indexterm>
|
---|
| 594 | </listitem>
|
---|
| 595 | </varlistentry>
|
---|
| 596 |
|
---|
| 597 | <varlistentry id="rust-lldb">
|
---|
| 598 | <term><command>rust-lldb</command></term>
|
---|
| 599 | <listitem>
|
---|
| 600 | <para>
|
---|
[a7b1bddc] | 601 | is a wrapper script for LLDB (the LLVM debugger)
|
---|
| 602 | pulling in the Python pretty-printing modules.
|
---|
[03d537cd] | 603 | </para>
|
---|
| 604 | <indexterm zone="rust rust-lldb">
|
---|
| 605 | <primary sortas="b-rust-lldb">rust=lldb</primary>
|
---|
| 606 | </indexterm>
|
---|
| 607 | </listitem>
|
---|
| 608 | </varlistentry>
|
---|
| 609 |
|
---|
| 610 | <varlistentry id="rustc">
|
---|
| 611 | <term><command>rustc</command></term>
|
---|
| 612 | <listitem>
|
---|
| 613 | <para>
|
---|
| 614 | is the rust compiler.
|
---|
| 615 | </para>
|
---|
| 616 | <indexterm zone="rust rustc">
|
---|
| 617 | <primary sortas="b-rustc">rustc</primary>
|
---|
| 618 | </indexterm>
|
---|
| 619 | </listitem>
|
---|
| 620 | </varlistentry>
|
---|
| 621 |
|
---|
| 622 | <varlistentry id="rustdoc">
|
---|
| 623 | <term><command>rustdoc</command></term>
|
---|
| 624 | <listitem>
|
---|
| 625 | <para>
|
---|
| 626 | generates documentation from rust source code.
|
---|
| 627 | </para>
|
---|
| 628 | <indexterm zone="rust rustdoc">
|
---|
| 629 | <primary sortas="b-rustdoc">rustdoc</primary>
|
---|
| 630 | </indexterm>
|
---|
| 631 | </listitem>
|
---|
| 632 | </varlistentry>
|
---|
| 633 |
|
---|
[a7b1bddc] | 634 | <varlistentry id="rustfmt">
|
---|
| 635 | <term><command>rustfmt</command></term>
|
---|
| 636 | <listitem>
|
---|
| 637 | <para>
|
---|
| 638 | formats rust code.
|
---|
| 639 | </para>
|
---|
| 640 | <indexterm zone="rust rustfmt">
|
---|
| 641 | <primary sortas="b-rustfmt">rustfmt</primary>
|
---|
| 642 | </indexterm>
|
---|
| 643 | </listitem>
|
---|
| 644 | </varlistentry>
|
---|
| 645 |
|
---|
[03d537cd] | 646 | <varlistentry id="libstd">
|
---|
| 647 | <term><filename class="libraryfile">libstd-<16-byte-hash>.so</filename></term>
|
---|
| 648 | <listitem>
|
---|
| 649 | <para>
|
---|
| 650 | is the Rust Standard Library, the foundation of portable Rust software.
|
---|
| 651 | </para>
|
---|
| 652 | <indexterm zone="rust libstd">
|
---|
| 653 | <primary sortas="c-libstd">libstd-<16-byte-hash>.so</primary>
|
---|
| 654 | </indexterm>
|
---|
| 655 | </listitem>
|
---|
| 656 | </varlistentry>
|
---|
| 657 | </variablelist>
|
---|
| 658 | </sect2>
|
---|
| 659 | </sect1>
|
---|