• Re: [gentoo-user] Fragile rust update is wedged.

    From Alan Mackenzie@21:1/5 to Eli Schwartz on Fri May 2 21:10:02 2025
    Hello, Eli.

    On Fri, May 02, 2025 at 13:47:02 -0400, Eli Schwartz wrote:
    On 5/2/25 1:07 PM, Alan Mackenzie wrote:
    Hello, Gentoo.

    I've just been trying the update for python 3.13. It went well on my
    new machine (well, after unmerging app-portage/unsymlink-lib, which was debris from some 2019 update).

    On my old machine, however, there was a seg fault while merging rust.
    This is a known problem in certain first generation Ryzen processors.

    However, this left the build wedged: emerge says that there's a circular dependency from rust to itself. More precisely, the error message looks like:


    This is clearly not a python update, then.

    Well, it was. ;-)

    This would appear to be a bug in the rust ebuild - it has set itself as a builtime dependency before it had been built - or something like that.

    How do I best recover from this?


    It is not a bug in the rust ebuild -- the rust ebuild has always,
    always, always depended on itself. In the past, the rust ebuild silently downloaded a temporary copy of dev-lang/rust-bin to work around this.

    I disagree. By attempting this emerging of rust, and failing, some
    persistent information indicating this dependency has been created. This persistent information, wherever it is, should not have been created, or
    it should have been removed on the emerge failure.

    This was changed in November 2024.

    Hmmm... OK.

    The rust compiler is written in the rust programming language, using bleeding-edge features of the most recent version of rust. They are
    aware that this is a bootstrap problem and don't consider it a problem, because rust is officially installed by downloading prebuilt binaries
    into $HOME.

    This sounds bad, but how is it different from C and C++ in GCC?

    Compiling rust officially requires building the pre 1.0 version of rust, itself written in ocaml, and then building *every* version of rust since then, one by one, in turn, without skipping a single one. That is over
    80 different versions of rust, you need to compile all of them in order
    to get to the current one.

    No thanks! There's only so much time left before the Sun becomes a red
    giant. But this attitude must limit the portability of rust to different processors, such as are found in embedded systems.

    On amd64, you can use the unofficial dev-lang/mrustc (third-party reimplementation of rust written in C++) which allows you to skip all
    the way to rust 1.74, and from there it is "only" 13 or so versions to
    build.

    Doesn't sound much like a solution.

    Or, you may use rust-bin. Alternatively, you may use:

    ```
    emerge --getbinpkg dev-lang/rust
    ```

    I think I'll be going for rust-bin. This is quite new in Gentoo (in the
    last few years, at any rate), but I couldn't find the news item about it
    I vaguely remember reading.

    Hopefully there's nothing tricky about moving from package foo to
    foo-bin.

    And then I can, hopefully, finish the update of the python stuff. Though
    I would classify it as a design bug that all python programs need to be
    rebuilt just because there's a minor version update in python itself. We
    don't need to do this when a new version of GCC comes out.

    --
    Eli Schwartz

    --
    Alan Mackenzie (Nuremberg, Germany).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli Schwartz@21:1/5 to Alan Mackenzie on Fri May 2 22:10:01 2025
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------4Aqi1sK0XLk1RBfiI0G45kQY
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 5/2/25 3:07 PM, Alan Mackenzie wrote:
    Hello, Eli.

    On Fri, May 02, 2025 at 13:47:02 -0400, Eli Schwartz wrote:
    On 5/2/25 1:07 PM, Alan Mackenzie wrote:
    Hello, Gentoo.

    I've just been trying the update for python 3.13. It went well on my
    new machine (well, after unmerging app-portage/unsymlink-lib, which was
    debris from some 2019 update).

    On my old machine, however, there was a seg fault while merging rust.
    This is a known problem in certain first generation Ryzen processors.

    However, this left the build wedged: emerge says that there's a circular >>> dependency from rust to itself. More precisely, the error message looks >>> like:


    This is clearly not a python update, then.

    Well, it was. ;-)


    Your saying that it was, doesn't make it the case. So you can repeat a
    false claim if you want -- or explain why you think it is true.



    This would appear to be a bug in the rust ebuild - it has set itself as a >>> builtime dependency before it had been built - or something like that.

    How do I best recover from this?


    It is not a bug in the rust ebuild -- the rust ebuild has always,
    always, always depended on itself. In the past, the rust ebuild silently
    downloaded a temporary copy of dev-lang/rust-bin to work around this.

    I disagree. By attempting this emerging of rust, and failing, some persistent information indicating this dependency has been created. This persistent information, wherever it is, should not have been created, or
    it should have been removed on the emerge failure.


    Since you do not know what this "persistent information" is, I assert in response that it doesn't exist, therefore it hasn't been created.

    If you are nonetheless certain that it exists, you are welcome to
    explain what "it" is and where I can find it.


    This was changed in November 2024.

    Hmmm... OK.

    The rust compiler is written in the rust programming language, using
    bleeding-edge features of the most recent version of rust. They are
    aware that this is a bootstrap problem and don't consider it a problem,
    because rust is officially installed by downloading prebuilt binaries
    into $HOME.

    This sounds bad, but how is it different from C and C++ in GCC?


    Because:
    - GCC 15 can be compiled with GCC 5.4
    - GCC 11 - 14 can be compiled with GCC 4.8.3
    - GCC 4.8 - 10 can be compiled with a C++98 compiler
    - GCC 4.7 can be compiled with a C compiler

    The bootstrappable.org project uses TinyCC to build GCC 2.95.0, which
    then builds GCC 4.7.4, which gives you a very nearly C++11 compiler.

    It takes you 4 hops from TinyCC to GCC 15, which is a quarter of a
    decade of technology.

    For rust, the best bootstrap we have is unofficial -- mrustc -- and
    relies on first bootstrapping GCC with 4 hops, then compiling 13
    versions of Rust released between December 2023 and today. And that's
    our hack to avoid building 80 versions released over the course of 10
    years (rust 1.0 was released on May 15, 2015).


    Compiling rust officially requires building the pre 1.0 version of rust,
    itself written in ocaml, and then building *every* version of rust since
    then, one by one, in turn, without skipping a single one. That is over
    80 different versions of rust, you need to compile all of them in order
    to get to the current one.

    No thanks! There's only so much time left before the Sun becomes a red giant. But this attitude must limit the portability of rust to different processors, such as are found in embedded systems.

    On amd64, you can use the unofficial dev-lang/mrustc (third-party
    reimplementation of rust written in C++) which allows you to skip all
    the way to rust 1.74, and from there it is "only" 13 or so versions to
    build.

    Doesn't sound much like a solution.


    You're entirely correct. The upstream rust developers imposed this
    constraint.


    Or, you may use rust-bin. Alternatively, you may use:

    ```
    emerge --getbinpkg dev-lang/rust
    ```

    I think I'll be going for rust-bin. This is quite new in Gentoo (in the
    last few years, at any rate), but I couldn't find the news item about it
    I vaguely remember reading.

    Hopefully there's nothing tricky about moving from package foo to
    foo-bin.

    And then I can, hopefully, finish the update of the python stuff. Though
    I would classify it as a design bug that all python programs need to be rebuilt just because there's a minor version update in python itself. We don't need to do this when a new version of GCC comes out.


    It's not a minor version update in python itself. Python doesn't really
    use semver.

    GCC, and in general, C/C++, tend to take this sort of compatibility a
    lot more serious than other languages. e.g. rust and golang simply
    statically compile, and that's why @rust-rebuild and @golang-rebuild
    exist. Ruby has to be rebuilt on version updates just like python. Zig
    software only ever supports a single version of the compiler, and has to
    be rewritten in tandem with the compiler upgrade.



    --
    Eli Schwartz

    --------------4Aqi1sK0XLk1RBfiI0G45kQY--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCaBUl9QUDAAAAAAAKCRCEp9ErcA0vV6pL APwMs00ZU29AbiyMz9kpOxuIULCLhP14niblVFhTEjEH9QD+LuixizjCwuMErevvk+D5L6OZ19Pk 4rQ8C9FJ9UNNjQg=
    =WexV
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nate Eldredge@21:1/5 to All on Sat May 3 06:10:01 2025
    On May 2, 2025, at 13:07, Alan Mackenzie <acm@muc.de> wrote:

    Hello, Eli.

    On Fri, May 02, 2025 at 13:47:02 -0400, Eli Schwartz wrote:

    Compiling rust officially requires building the pre 1.0 version of rust,
    itself written in ocaml, and then building *every* version of rust since
    then, one by one, in turn, without skipping a single one. That is over
    80 different versions of rust, you need to compile all of them in order
    to get to the current one.

    No thanks! There's only so much time left before the Sun becomes a red giant. But this attitude must limit the portability of rust to different processors, such as are found in embedded systems.



    For embedded systems, I assume you'd normally be cross-compiling. So all you'd need to get started is a current rust binary package for your build system (let's say x86-64-linux). With that, you can build a cross-compiler x86-64-linux->toaster-none,
    and build your toaster control software with it. You wouldn't normally want to be running the rust compiler on your toaster at all, but if it somehow has enough memory and storage for that, then you should be able to use your cross-compiler to build a
    native toaster->toaster rust compiler, and copy it to the toaster. And if you then have the patience to rebuild rust natively on the toaster, at this point you can.

    But by no means should you need to build 80 versions of rust on the toaster.


    <html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="
    cite"><div>On May 2, 2025, at 13:07, Alan Mackenzie &lt;acm@muc.de&gt; wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-
    variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !
    important;">Hello, Eli.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform:
    none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-
    spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px;
    font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none;
    display: inline !important;">On Fri, May 02, 2025 at 13:47:02 -0400, Eli Schwartz wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing:
    normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style:
    normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite"
    style="font-family: Helvetica; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-
    spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">Compiling rust officially requires building the pre 1.0 version of rust,<br>itself written in ocaml, and then building *every* version of rust since<br>then, one by one, in turn,
    without skipping a single one. That is over<br>80 different versions of rust, you need to compile all of them in order<br>to get to the current one.<br></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style:
    normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-
    color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -
    webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">No thanks! &nbsp;There's only so much time left before the Sun becomes a red</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size:
    11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><
    span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-
    spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">giant. &nbsp;But this attitude must limit the portability of rust to different</span><br style="caret-color: rgb(0, 0, 0); font-family:
    Helvetica; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-
    decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-
    space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">processors, such as are found in embedded systems.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-
    size: 11px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"
    <br></div></blockquote></div><div><br></div><div>For embedded systems, I assume you'd normally be cross-compiling. &nbsp;So all you'd need to get started is a current rust binary package for your build system (let's say x86-64-linux). &nbsp;With that,
    you can build a cross-compiler x86-64-linux-&gt;toaster-none, and build your toaster control software with it. &nbsp;You wouldn't normally want to be running the rust compiler on your toaster at all, but if it somehow has enough memory and storage for
    that, then you should be able to use your cross-compiler to build a native toaster-&gt;toaster rust compiler, and copy it to the toaster. &nbsp;And if you then have the patience to rebuild rust natively on the toaster, at this point you can.</div><div><
    </div><div>But by no means should you need to build 80 versions of rust on the toaster.</div><div><br></div></body></html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)