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