mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 09:38:26 +03:00
fix(build-manifest): enable docs target fallback for rustc-docs
This commit is contained in:
@@ -14,11 +14,11 @@
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/targets.rs"));
|
||||
|
||||
/// This allows the manifest to contain rust-docs for hosts that don't build
|
||||
/// docs.
|
||||
/// This allows the manifest to contain rust-docs and rustc-docs for hosts
|
||||
/// that don't build certain docs.
|
||||
///
|
||||
/// Tuples of `(host_partial, host_instead)`. If the host does not have the
|
||||
/// rust-docs component available, then if the host name contains
|
||||
/// corresponding docs component available, then if the host name contains
|
||||
/// `host_partial`, it will use the docs from `host_instead` instead.
|
||||
///
|
||||
/// The order here matters, more specific entries should be first.
|
||||
@@ -392,9 +392,9 @@ macro_rules! tarball_name {
|
||||
let t = Target::from_compressed_tar(self, &tarball_name!(fallback_target));
|
||||
// Fallbacks should typically be available on 'production' builds
|
||||
// but may not be available for try builds, which only build one target by
|
||||
// default. Ideally we'd gate this being a hard error on whether we're in a
|
||||
// production build or not, but it's not information that's readily available
|
||||
// here.
|
||||
// default. It is also possible that `rust-docs` and `rustc-docs` differ in
|
||||
// availability per target. Thus, we take the first available fallback we can
|
||||
// find.
|
||||
if !t.available {
|
||||
eprintln!(
|
||||
"{:?} not available for fallback",
|
||||
|
||||
@@ -133,10 +133,7 @@ fn target_independent(&self) -> bool {
|
||||
|
||||
/// Whether to package these target-specific docs for another similar target.
|
||||
pub(crate) fn use_docs_fallback(&self) -> bool {
|
||||
match self {
|
||||
PkgType::JsonDocs | PkgType::HtmlDocs => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, PkgType::JsonDocs | PkgType::HtmlDocs | PkgType::RustcDocs)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user