public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
From: Sergey Matveev <stargrave@stargrave•org>
To: nncp-devel@lists.cypherpunks.ru
Subject: Re: Rust building
Date: Sat, 11 Jun 2022 00:24:08 +0300	[thread overview]
Message-ID: <YqO2g0il5n4zN3tB@stargrave.org> (raw)
In-Reply-To: <87pmjg1c2r.fsf@complete.org>

[-- Attachment #1: Type: text/plain, Size: 2449 bytes --]

*** John Goerzen [2022-06-10 15:46]:
>rustc is written in Rust, as the Go compiler is written in Go.

But the huge difference is that Go's documentation explicitly tells that
you only have to build Go 1.4 with C-compiler and then use it for any
other further versions. Clear, "non-secret" way to build it using native
C-compiler from C-sources and then from Go-sources. 10min and you will
get modern Go compiler.

>https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html

Tried it now. It went downloading
https://static.rust-lang.org/dist/2022-05-20/rust-std-beta-x86_64-unknown-freebsd.tar.xz
without any questions or warnings, trying to run it after. No
information how you can build that binary by self. I know that Rust 1.23
is built using 1.22, that was built with 1.21, and so on. If there were
any clear path how you can make all that path to the code you can build
from native OS'es C-compiler, then it will be ok. But there is no
official information how to do that. Just binaries downloaded from the
Internet. Like I am visiting some modern website sending me yet another
JS/WASM application my computer has to run. Authors just hardcoded
"download and run the binary". No way I can accept that behaviour.

Just out of curiosity I tried to build mrustc now. And it gives many
errors:

    src/hir_conv/constant_evaluation.cpp:2003:41: error: use of undeclared identifier 'v'
                                    return (v >> 8) | (v << 8);

    src/hir_conv/constant_evaluation.cpp:2002:45: error: unknown type name '__builtin_constant_p'
                                static uint16_t bswap16(uint16_t v) {

    src/hir_conv/constant_evaluation.cpp:2021:42: error: expected unqualified-id
                                rv = U128(H::bswap16(val.truncate_u64()));

I succeeded several years ago building it on Devuan only by taking the
notes and steps from GNU Guix'es ports, where they used mrustc to
bootstrap Rust building. It was not trivial task too, because many
things were slightly broken, some things required some cargo packages
downloading of some exact versions and patches, and so on. Maybe I could
cross-build Rust for FreeBSD from that Devuan's installation? No
information about that and FreeBSD is not officially claimed to be
supported by mrustc.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-06-10 21:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30  0:23 Announcing Filespooler John Goerzen
2022-05-31 17:13 ` John Goerzen
2022-05-31 18:07 ` Jonathan Lane
2022-06-02  0:03   ` John Goerzen
2022-06-07 10:32 ` Sergey Matveev
2022-06-10 13:14   ` John Goerzen
2022-06-10 18:48     ` Sergey Matveev
2022-06-10 20:46       ` John Goerzen
2022-06-10 21:24         ` Sergey Matveev [this message]
2022-06-14 13:59           ` Rust building John Goerzen
2022-06-14 18:19             ` Sergey Matveev