- Timestamp:
- 01/18/2023 03:16:10 AM (21 months ago)
- Branches:
- 11.3, 12.0, 12.1, 12.2, gimp3, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, xry111/for-12.3, xry111/llvm18, xry111/spidermonkey128, xry111/xf86-video-removal
- Children:
- 0f9a1f08, 4fe5cec
- Parents:
- aa5add9
- git-author:
- Xi Ruoyao <xry111@…> (01/18/2023 03:07:48 AM)
- git-committer:
- Xi Ruoyao <xry111@…> (01/18/2023 03:16:10 AM)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
general/prog/rust.xml
raa5add9 r97e7219 9 9 <!ENTITY rust-md5sum "96b082a8b44707eafa9d696923f40c28"> 10 10 <!ENTITY rust-size "136 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 "9.4 GB (674 MB installed) including 360 MB of ~/.cargo files for the user building this. Add 6.5 GB including extra 312 MB of ~/.cargo files if running the tests"> 11 <!ENTITY rust-buildsize "9.1 GB (323 MB installed); add 6.2 GB if running the tests"> 18 12 <!ENTITY rust-time "17 SBU (including download time; add 23 SBU for tests, both on a 4-core machine)"> 19 13 ]> … … 47 41 <para> 48 42 As with many other programming languages, rustc (the rust compiler) 49 needs a binary from which to bootstrap. It will download a stage0 binary 50 and many cargo crates (these are actually .tar.gz source archives) at 51 the start of the build, so you cannot compile it without an internet 52 connection. 53 </para> 54 55 <para> 56 These crates will then remain in various forms (cache, directories of 57 extracted source), in <filename class="directory">~/.cargo</filename> for 58 ever more. It is common for large <application>rust</application> packages 59 to use multiple versions of some crates. If you purge the files before 60 updating this package, very few crates will need to be updated by the 61 packages in this book which use it (and they will be downloaded as 62 required). But if you retain an older version as a fallback option and 63 then use it (when <emphasis>not</emphasis> building in 64 <filename class="directory">/usr</filename>), it is likely that it will 65 then have to re-download some crates. For a full download (i.e. starting 66 with an empty or missing <filename class="directory">~/.cargo</filename>) 67 downloading the external cargo files for this version only takes a minute 68 or so on a fast network. 43 needs a binary from which to bootstrap. It will download a stage0 44 binary at the start of the build, so you cannot compile it without an 45 Internet connection. 69 46 </para> 70 47 … … 89 66 <para> 90 67 If you prefer, you can of course change the prefix to <filename 91 class="directory">/usr</filename> and omit the 92 <command>ldconfig</command> and the actions to add rustc to the PATH. 68 class="directory">/usr</filename>. 93 69 </para> 94 70 </note> … … 138 114 often reasonably consistent, but as with all compilations using 139 115 <command>rustc</command> there can be some very slow outliers. 140 </para>141 <para>142 Unusually, a DESTDIR-style method is being used to install this package.143 This is because running the install as root not only downloads all of the144 cargo files again (to <filename>/root/.cargo</filename>), it then spends145 a very long time recompiling. Using this method saves a lot of time, at146 the cost of extra disk space.147 116 </para> 148 117 </note> … … 305 274 extended = true 306 275 276 # Do not query new versions of dependencies online. 277 locked-deps = true 278 307 279 # Specify which extended tools (those from the default install). 308 280 tools = ["cargo", "clippy", "rustfmt"] 281 282 # Use the source code shipped in the tarball for the dependencies. 283 # The combination of this and the "locked-deps" entry avoids downloading 284 # many crates from Internet, and makes the Rustc build more stable. 285 vendor = true 309 286 310 287 [install] … … 314 291 [rust] 315 292 channel = "stable" 316 rpath = false 293 description = "for BLFS &version;" 317 294 318 295 # BLFS used to not install the FileCheck executable from llvm, … … 370 347 </para> 371 348 372 <screen remap="test"><userinput>export LD_LIBRARY_PATH=$PWD/build/x86_64-unknown-linux-gnu/stage1/lib/ && 373 python3 ./x.py test --verbose --no-fail-fast | tee rustc-testlog 374 unset LD_LIBRARY_PATH</userinput></screen> 349 <screen remap="test"><userinput>python3 ./x.py test --verbose --no-fail-fast | tee rustc-testlog</userinput></screen> 375 350 376 351 <para> … … 417 392 418 393 <para> 419 Still as your normal user, do a DESTDIR install: 420 </para> 421 422 <screen><userinput>DESTDIR=${PWD}/install python3 ./x.py install &&</userinput></screen> 423 424 <para> 425 Now, as the <systemitem class="username">root</systemitem> user 426 install the files from the DESTDIR: 427 </para> 428 429 <screen role="root"><userinput>chown -R root:root install && 430 cp -a install/* /</userinput></screen> 394 Now, as the &root; user, install the package: 395 </para> 396 397 <screen role='root'><userinput>python3 ./x.py install</userinput></screen> 431 398 432 399 </sect2> … … 444 411 <para> 445 412 <command>targets = "X86"</command>: this avoids building all the available 446 linux cross-compilers (A arch64, MIPS, PowerPC, SystemZ, etc). Unfortunately,413 linux cross-compilers (AArch64, MIPS, PowerPC, SystemZ, etc). Unfortunately, 447 414 rust insists on installing source files for these below 448 415 <filename class="directory">/opt/rustc/lib/src</filename>. … … 450 417 451 418 <para> 452 <command>extended = true</command>: this installs Cargo alongside Rust. 419 <command>extended = true</command>: this installs several tools 420 (specified by the <literal>tools</literal> entry) alongside 421 <command>rustc</command>. 453 422 </para> 454 423 … … 470 439 </para> 471 440 472 <para>473 <command>rpath = false</command>: by default, <command>rust</command> can474 be run from where it was built, without being installed. That adds DT_RPATH475 entries to all of the ELF files, which produces very messy output from476 <command>ldd</command>, showing the libraries in the place they were built,477 even if they have been deleted from there after the install.478 </para>479 480 441 <!-- comment while using shipped LLVM --> 481 442 <para> … … 513 474 514 475 <para> 515 <command>export LD_LIBRARY_PATH=$PWD/build/x86_64-unknown-linux-gnu/stage1/lib/</command>:516 In builds where rpath is enabled, the stage1 libraries can be used by the517 tests. But BLFS has disabled rpath: this environment variable allows a lot518 more tests to run. Without it there are no reported failures in most runs,519 but some odd messages in the test log implying failures.520 </para>521 522 <para>523 476 <command>--verbose</command>: this switch can sometimes provide more 524 477 information about a test which fails. … … 528 481 <command>--no-fail-fast</command>: this switch ensures that the test suite 529 482 will not stop at the first error. 530 </para>531 532 <para>533 <command>DESTDIR=${PWD}/install python3 ./x.py install</command>: This534 effects a DESTDIR-style install in the source tree,creating an <filename535 class="directory">install</filename> directory. Note that DESTDIR installs536 need an absolute path, passing 'install' will not work.537 </para>538 539 <para>540 <command>chown -R root:root install</command>: the DESTDIR install541 was run by a regular user, who owns the files. For security, change their542 owner before doing a simple copy to install them.543 483 </para> 544 484 … … 557 497 is correctly found by other packages and system processes. 558 498 </para> 559 560 <para>561 As the <systemitem class="username">root</systemitem> user, update562 the <filename>/etc/ld.so.conf</filename> file and the dynamic linker's563 run-time cache file:564 </para>565 566 <screen role="root"><userinput>cat >> /etc/ld.so.conf << EOF567 <literal># Begin rustc addition568 569 /opt/rustc/lib570 571 # End rustc addition</literal>572 EOF573 574 ldconfig</userinput></screen>575 576 <indexterm zone="rust rustc-config">577 <primary sortas="e-etc-ld.so.conf">/etc/ld.so.conf</primary>578 </indexterm>579 499 580 500 <para>
Note:
See TracChangeset
for help on using the changeset viewer.