Changeset b05ea0b for general


Ignore:
Timestamp:
01/27/2019 12:01:48 AM (5 years ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 8.4, 9.0, 9.1, 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, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
4cc77fbd
Parents:
0eb97ef1
Message:

Update the rust page providing instructions installing in /opt.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@21042 af4574ff-66df-0310-9fd7-8a98e5e911e0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • general/prog/rust.xml

    r0eb97ef1 rb05ea0b  
    6464      packages in this book which use it (and they will be downloaded as
    6565      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
     66      then use it (when <emphasis>not</emphasis> building in
    6767      <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
     68      then have to re-download some crates. For a full download (i.e. starting
    6969      with an empty or missing <filename class="directory">~/.cargo</filename>)
    7070      downloading the external cargo files for this version only takes a minute
     
    8080        installation before updating. You may wish to do the same to save space.
    8181      </para>
     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>
    8290    </note>
    8391
     
    97105        Rustc defaults to building for ALL supported architectures, using a
    98106        shipped copy of LLVM. In BLFS the build is only for the X86 architecture.
    99         If you
    100         intend to develop rust crates, this build may not be good enough for your
    101         purposes.
     107        If you intend to develop rust crates, this build may not be good
     108        enough for your purposes.
    102109      </para>
    103110      <para>
     
    181188
    182189    <para>
    183       First create a suitable <filename>config.toml</filename> file which will
     190      If you are going to install into the
     191      <filename class="directory">/opt</filename> directory, remove
     192      conflicting entries and recreate the required entries.
     193      As the <systemitem class="username">root</systemitem>
     194      user:
     195    </para>
     196
     197<screen role="root"><userinput>rm -rf /opt/rustc /opt/rustc-&rust-version; &amp;&amp;
     198mkdir /opt/rustc-&rust-version;             &amp;&amp;
     199ln -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 and then running <command>ldconfig</command>.
     207      </para>
     208    </note>
     209
     210    <para>
     211      Create a suitable <filename>config.toml</filename> file which will
    184212      configure the build. Unlike with previous releases, where even quite old
    185213      system versions of <application>LLVM</application>worked well, this
     
    209237
    210238[install]
    211 prefix = "/usr"
     239# Adjust the prefix for the desired destination
     240#prefix = "/usr"
     241prefix = "/opt/rustc-&rust-version;"
     242
    212243# docdir is used even if the full awesome docs are not installed
    213244docdir = "share/doc/rustc-&rust-version;"
     
    389420
    390421  </sect2>
     422
     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
     432        following configuration files so that <application>rustc</application> is
     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 &gt;&gt; /etc/ld.so.conf &lt;&lt; EOF
     443<literal># Begin rustc addition
     444
     445/opt/rustc/lib
     446
     447# End rustc addition</literal>
     448EOF
     449
     450ldconfig</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 &gt; /etc/profile.d/rustc.sh &lt;&lt; "EOF"
     462<literal># Begin /etc/profile.d/rustc.sh
     463
     464pathprepend /opt/rustc/bin           PATH
     465
     466# End /etc/profile.d/rustc.sh</literal>
     467EOF</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
    391477
    392478  <sect2 role="content">
Note: See TracChangeset for help on using the changeset viewer.