Introduction

This page collects notes about things that could be done to improve rust in pkgsrc, shamelessly stolen from mailinglist postings, mixed together with private notes, and things that have simply been made up.

Rust compiler selection

Currently, programs depend on rust by including a rust.mk, rather than adding rust to USE_LANGUAGES. There should be compiler.mk that either finds a base system rust, or depends on a pkgsrc-provided implementation.

Alternative implementations

A language ecosystem with one implementation is not healthy.

gcc

gcc will support rust soon, and it would be great to have that support in pkgsrc.

mrustc

mrustc is in wip, and it would be great to have it up-to-date and in pkgsrc proper.

Bootstrapping

Currently, the official rust compiler usually requires the previous version, so there is a long chain of binaries involved to get back to source. It is then necessary to trust the keepers of those binaries, the systems on which they were produced, and the chain of custody evidence, in order to have confidence that the resulting binaries are free of back doors. (This is not an accusation; it's a statement that paranoia is a best practice when thinking about the software supply chain.)

rust-lang.org binary packages

It would be nice if lang/rust could be configured to use the binaries that are packaged as lang/rust-bin as the bootstrap compiler. That would then require trusting the rust-lang.org binary chain of custody, rather than the pkgsrc bootstrap chain.

mrustc

It would be great if one could use mrustc to bootstrap rust on NetBSD, to be able to go from the base system and build an up-to-date rust, without downloading and running binaries.

Substeps, once the project above is done, are: - create some script that can do the necessary builds in order - wrap that script in package?

gcc

It would be great if gcc could be used to bootstrap rust.

system rust

Some systems have rust as part of base, and it would be nice if lang/rust could be configured to use that rust to bootstrap, instead of downloading a binary.

Redoing the bootstrap chain

While probably too hard, it would be great if one could run a script that would redo the entire bootstrap chain all the way back to source. Even a few people doing this could, with reproducible builds, show that the current situation is ok. (It very likely is ok; the problem is that the argument that it is ok is too shaky.)

Comparison of rust built with different compilers

It would be a huge achievement if: - the rust build is reproducible - We can build rust with different bootstraps - We can then build rust with those differently-bootstrapped compilers - We can compare bit-for-bit the resulting builds.

Upstream

More targets

Ideally, upstream would support every CPU architecture that runs NetBSD. This project is to add support in the upstream codebase for any missing CPU types.

Official binary builds for more targets

Ideally, upstream would release official builds for NetBSD for every supported CPU type, and for other pkgsrc platforms. This project is to cause upstream to have those builds.

A notable example is NetBSD/aarch64, but it appears that the only NetBSD binary build is for x86_64.