Quick introduction for anyone who isn't familiar: Skyline is a framework for developing mods for Nintendo Switch games, allowing users to add/patch co

Adventures in rustc Forking

submited by
Style Pass
2021-05-26 21:30:06

Quick introduction for anyone who isn't familiar: Skyline is a framework for developing mods for Nintendo Switch games, allowing users to add/patch code to their favorite games. skyline-rs was a library I created to allow for writing mods in ergonomic and idiomatic Rust. cargo skyline is a cargo subcommand for aiding in building Skyline plugins using skyline-rs. And lastly rust-std-skyline is a fork of the Rust standard library designed for use on the Nintendo Switch. Ok, enough introductions!

A while back I made a blog post on using Rust for Modding Smash Ultimate. Since then, there are even more people using skyline-rs for mods for a variety of games. Even Skyline itself has started using Rust internally. One part of my previous post about using Rust for game modding that didn't quite make the final cut was a section discussing xargo, a (deprecated) utility for cross compiling Rust with a modified copy of the Rust standard library.

The thing about xargo is, it's kinda deprecated for a reason. I would argue its primary use-case is custom targets which use an existing copy of the Rust sysroot and building core, compiler_builtins, and alloc for a custom target. For this use case it was superseded by cargo-xbuild, which is a fork of xargo that is popular for Rust OSdev fans, but even that is not the hip new option. It was itself superseded by a new built-in Cargo feature known as "std-aware cargo" (or -Zbuild-std). So you might (extremely reasonably) be asking: why, jam, are you using this fifth-cousin twice-deprecated equivalent of a cargo feature? Well, the problem with std-aware cargo in its current state is that it's not really ready for building custom std's. This is a slight problem when our goal is building a custom std fork.

Leave a Comment