Re: The Case for Rust (in the base system)

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 20 Jan 2024 17:34:45 UTC
On 20 Jan 2024, at 18:13, Gleb Popov <arrowd@freebsd.org> wrote:
> 
> On Sat, Jan 20, 2024 at 7:51 PM Alan Somers <asomers@freebsd.org> wrote:
>> To
>> summarize, the cost is that it would double our build times.
> 
> Would it? From what I remember, a lot of rust's build time comes from
> building its own LLVM. Can we reuse our base LLVM for Rust-in-base?

It used to be the case that the Rust port could not use an LLVM port,
but had to use its own copy, but it seems that as of
https://cgit.freebsd.org/ports/commit/?id=098de5bc2195 it is possible
again.

However, I think this discussion is going in the wrong direction: why
keep attempting to build all these huge toolchain components in our base
system at all? Our bmake is reasonably powerful, but upstream build
systems for both LLVM and Rust require lots of dependencies that we can
never all import. And mimicking those upstream builds in our base system
is getting more and more complicated all the time.

Therefore, I think it is better to put more effort in supporting
external toolchain components, and even going so far as to remove some
of those toolchains from base. Including LLVM, at some point. Let new
toolchain components for base live in ports, please.

-Dimitry