From 5c4adbe1e12c804a03146e351e06f666f0fe1fdf Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 13 Jan 2021 09:32:48 -0500 Subject: [PATCH] Add all tier 1 platforms to supported platforms for "if-available" ... and update the comment in `config.toml.example` --- config.toml.example | 8 +++++--- src/bootstrap/bootstrap.py | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/config.toml.example b/config.toml.example index 9e08ce9b27e..55b20adabd0 100644 --- a/config.toml.example +++ b/config.toml.example @@ -35,9 +35,11 @@ changelog-seen = 2 # Unless you're developing for a target where Rust CI doesn't build a compiler # toolchain or changing LLVM locally, you probably want to set this to true. # -# It's currently false by default due to being newly added; please file bugs if -# enabling this did not work for you on x86_64-unknown-linux-gnu. -# Other target triples are currently not supported; see #77084. +# This is false by default so that distributions don't unexpectedly download +# LLVM from the internet. +# +# All tier 1 targets are currently supported; set this to `"if-supported"` if +# you are not sure whether you're on a tier 1 target. # # We also currently only support this when building LLVM for the build triple. # diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 6d2d7bbbef9..5350c9eefe7 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -465,8 +465,21 @@ class RustBuild(object): def downloading_llvm(self): opt = self.get_toml('download-ci-llvm', 'llvm') + # This is currently all tier 1 targets (since others may not have CI + # artifacts) + # https://doc.rust-lang.org/rustc/platform-support.html#tier-1 + supported_platforms = [ + "aarch64-unknown-linux-gnu", + "i686-pc-windows-gnu", + "i686-pc-windows-msvc", + "i686-unknown-linux-gnu", + "x86_64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-pc-windows-gnu", + "x86_64-pc-windows-msvc", + ] return opt == "true" \ - or (opt == "if-available" and self.build == "x86_64-unknown-linux-gnu") + or (opt == "if-available" and self.build in supported_platforms) def _download_stage0_helper(self, filename, pattern, tarball_suffix, date=None): if date is None: