From a11ed34e997960b4a0ecdeba625ac1a8c5a36b08 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sun, 16 Jun 2024 00:30:56 +0300 Subject: [PATCH] tell about `STAGE0_MISSING_TARGETS` for new targets We just realized that the bootstrap target sanity check isn't documented anywhere, and it would be quite exhausting to learn this manually through a series of failing CI builds. Signed-off-by: onur-ozkan --- src/building/new-target.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/building/new-target.md b/src/building/new-target.md index ece81d405..ac838c6c2 100644 --- a/src/building/new-target.md +++ b/src/building/new-target.md @@ -94,6 +94,17 @@ adding `NEW_TARGET_OS` as `target_os`: + (Some(Mode::Std), "target_os", Some(&["watchos", "NEW_TARGET_OS"])), ``` +To use this target in bootstrap, we need to explicitly add the target triple to the `STAGE0_MISSING_TARGETS` +list in `src/bootstrap/src/core/sanity.rs`. This is necessary because the default compiler bootstrap uses does +not recognize the new target we just added. Therefore, it should be added to `STAGE0_MISSING_TARGETS` so that the +bootstrap is aware that this target is not yet supported by the stage0 compiler. + +```diff +const STAGE0_MISSING_TARGETS: &[&str] = &[ ++ "NEW_TARGET_TRIPLE" +]; +``` + ## Patching crates You may need to make changes to crates that the compiler depends on,