JSON target specs were destabilized in #150151 and #151534. However, this broke trying to build rustc itself with a JSON target spec. This is because in a few places bootstrap is manually calling rustc without the ability for the user to provide additional flags (primarily, -Zunstable-options to enable JSON targets).
There's a few different ways to fix this. One would be to change these calls to rustc to include flags provided by the user (such as RUSTFLAGS_NOT_BOOTSTRAP). Just to keep things simple, this PR proposes to just unconditionally pass -Zunstable-options.
Another consideration here is how maintainable this is. A possible improvement here would be to have a function somewhere (BootstrapCommand, TargetSelection, free function) that would handle appropriately adding the --target flag. For example, that's what cargo does in CompileKind::add_target_arg.
-- #152677
E-hard because this requires a lot of digging without mentoring bandwidth.
-- #152677
E-hard because this requires a lot of digging without mentoring bandwidth.