Building 3rd-tier targets so Rustup/Cargo can use them?

I need to try building something against the UWP targets to see if I can get it working on an Xbox. For this, I'll need to build and install the UWP target which is tier 3.

Is it possible to build and install a tier 3 target such that Cargo installed via rustup finds it? I.e. so cargo build --target x86_64-uwp-msvc (or whatever the name is) works? Or do I need to build and use an entirely separate toolchain?

Thanks.

I haven't tried myself, but there are a couple of tools helpful for working with custom Rust builds. If you want to build stdlib:

or if you want to use a custom build of Rust and Cargo seamlessly with rustup:

1 Like

Thanks, I'll give that a shot. For some reason Google was failing me, so
I'm glad rustup link does what I want.

One thing I'm not entirely clear on after reading
https://wesleywiser.github.io/post/custom-rust-toolchain/:

It shows linking 2 stages. If I just want to cross-compile such that I
use the host compiler but the newly-built x86_64-uwp-windows-msvc as
--target, which of these do I build, and what do I specify the toolchain
name as? I'm not clear whether this builds something I have to reference
via rustup override or if I can just use it via the --target option.

I'd experiment myself, but the build is naturally taking a while, and
I've already had a few false starts before I got config.toml set up
correctly. :slight_smile: Hoping to figure out any remaining issues more quickly
and, should this actually work, figure out the quickest way to build and
link only what I need to build a UWP DLL in CI.

Thanks.

Toolchain name can be anything you want. It's only a human-readable nickname.

You only need to build stage1. Stage0 is for libstd only, and stage2 is for compiler releases. stage1 and 2 is the same thing, but built with different versions of Rust compiler. They don't affect what platforms are supported.