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