Mustang is a system for building programs built entirely in Rust, meaning they
do not depend on any part of libc or crt1.o, and do not link in any C code.
Why? For fun! And to exercise some components that have other purposes (such as
[`rustix`], [`origin`], [`c-scape`], and [`c-gull`]) but which happen to also be
part of what's needed to do what Mustang is doing. And in the future, possibly
also for experimenting with new kinds of platform ABIs.
Mustang currently runs on Rust Nightly on Linux on x86-64, x86, aarch64, and
riscv64. It aims to support all Linux versions [supported by Rust], though
at this time it's only tested on relatively recent versions. It's complete
enough to run:
- [ripgrep](https://github.com/sunfishcode/ripgrep/tree/mustang)
- [coreutils](https://github.com/sunfishcode/coreutils/tree/mustang),
including the "unix" feature set
- [async-std](https://github.com/sunfishcode/tide/tree/mustang)
- [tokio](https://github.com/sunfishcode/tokio/tree/mustang)
- [bat](https://github.com/sunfishcode/bat/tree/mustang), including git
support with libgit2
- [cargo-watch](https://github.com/sunfishcode/cargo-watch/tree/mustang)
Mustang isn't about making anything safer, for the foreseeable future. The
major libc implementations are extraordinarily well tested and mature. Mustang
for its part is experimental and has lots of `unsafe`.
[`origin`]: https://github.com/sunfishcode/origin/
[Rust-idiomatic]: https://docs.rs/origin/latest/origin/
[`c-scape`]: https://github.com/sunfishcode/c-ward/tree/main/c-scape
[`c-gull`]: https://github.com/sunfishcode/c-ward/tree/main/c-gull
[`mustang`]: https://github.com/sunfishcode/mustang/tree/main/mustang
[supported by Rust]: https://doc.rust-lang.org/nightly/rustc/platform-support.html
## Usage
To use it, first install rust-src, which is needed by `-Z build-std`:
```console
$ rustup component add rust-src --toolchain nightly
```
Then, set the `RUST_TARGET_PATH` environment variable to a path to the
`mustang/target-specs` directory, so that you can name `mustang` targets with
`--target=…`. For example, within a mustang repo:
```console
$ export RUST_TARGET_PATH="$PWD/mustang/target-specs"
```
Then, in your own crate, add a dependency on `mustang`:
```toml
[dependencies]
mustang = "