Changeset d396c65

01/27/2019 02:38:43 AM (4 years ago)
Ken Moffat <ken@…>
10.0, 10.1, 11.0, 11.1, 11.2, 8.4, 9.0, 9.1, lazarus, plabs/python-mods, qt5new, trunk, upgradedb, xry111/intltool, xry111/soup3, xry111/test-20220226

Rust - strongly recommend using /opt, and explain why.

git-svn-id: svn:// af4574ff-66df-0310-9fd7-8a98e5e911e0

2 edited


  • general/prog/rust.xml

    r4cc77fbd rd396c65  
    7474    <note>
    7575      <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>
    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.
     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.
     89      </para>
     91      <para>
     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.
    8995      </para>
    9096    </note>
    105111        Rustc defaults to building for ALL supported architectures, using a
    106112        shipped copy of LLVM. In BLFS the build is only for the X86 architecture.
    107         If you intend to develop rust crates, this build may not be good 
     113        If you intend to develop rust crates, this build may not be good
    108114        enough for your purposes.
    109115      </para>
    189195    <para>
    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.
     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).
    193200      As the <systemitem class="username">root</systemitem>
    194201      user:
    195202    </para>
    197 <screen role="root"><userinput>rm -rf /opt/rustc /opt/rustc-&rust-version; &amp;&amp;
    198 mkdir /opt/rustc-&rust-version;             &amp;&amp;
    199 ln -sv rustc-&rust-version; /opt/rustc</userinput></screen>
     204<screen role="root"><userinput>mkdir /opt/rustc-&rust-version;             &amp;&amp;
     205ln -svfin rustc-&rust-version; /opt/rustc</userinput></screen>
    201207    <note>
    338344  <sect2 role="commands">
    339345    <title>Command Explanations</title>
     347    <para>
     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>
    341354    <para>
  • introduction/welcome/changelog.xml

    r4cc77fbd rd396c65  
    4545      <para>January 24th, 2019</para>
    4646      <itemizedlist>
     47        <listitem>
     48          <para>[ken] - For rust, strongly recommend installing in /opt - this
     49          allows multiple versions to be used (fallback, testing a different
     50          config, trying a newer version) by merely (re-)running ldconfig after
     51          updating the symlink. It also prevents libraries from a previous version
     52          taking up space in /usr/lib/rustlib/ (previous /opt versions can easily
     53          be removed). Using a new prefix should also prevent the situation where
     54          changing the config.toml (e.g. from sys llvm to shipped llvm) builds
     55          fine but leaves a broken installation because cargo can no longer find
     56          the matching versions of the libraries.</para>
     57        </listitem>
    4758        <listitem>
    4859          <para>[ken] - Tweak the details of which rust tests might fail.</para>
Note: See TracChangeset for help on using the changeset viewer.