From 32f01b2064034f9f9c2dc554fbdc58ea2f6a71d6 Mon Sep 17 00:00:00 2001 From: binarycat Date: Sat, 14 Sep 2024 12:02:37 -0400 Subject: [PATCH 1/9] don't warn about a missing change-id in CI fixes 130352 --- src/bootstrap/src/bin/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/src/bin/main.rs b/src/bootstrap/src/bin/main.rs index f03f03e2d9398..ac1ff954fed73 100644 --- a/src/bootstrap/src/bin/main.rs +++ b/src/bootstrap/src/bin/main.rs @@ -14,6 +14,7 @@ use bootstrap::{ find_recent_config_change_ids, human_readable_changes, t, Build, Config, Flags, Subcommand, CONFIG_CHANGE_HISTORY, }; +use build_helper::ci::CiEnv; fn main() { let args = env::args().skip(1).collect::>(); @@ -54,9 +55,12 @@ fn main() { }; } - // check_version warnings are not printed during setup - let changelog_suggestion = - if matches!(config.cmd, Subcommand::Setup { .. }) { None } else { check_version(&config) }; + // check_version warnings are not printed during setup, or during CI + let changelog_suggestion = if matches!(config.cmd, Subcommand::Setup { .. }) || CiEnv::is_ci() { + None + } else { + check_version(&config) + }; // NOTE: Since `./configure` generates a `config.toml`, distro maintainers will see the // changelog warning, not the `x.py setup` message. From d3ea0e4e13cfc1e0e2cddd50fd1e165ea131d57c Mon Sep 17 00:00:00 2001 From: Cameron Pickett Date: Thu, 26 Sep 2024 12:53:05 -0700 Subject: [PATCH 2/9] Do not output () on empty description --- src/bootstrap/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 7bf5b4e23d29b..fcc7efbf8bd75 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -1570,9 +1570,11 @@ Executed at: {executed_at}"#, fn rust_version(&self) -> String { let mut version = self.rust_info().version(self, &self.version); if let Some(ref s) = self.config.description { - version.push_str(" ("); - version.push_str(s); - version.push(')'); + if !s.is_empty() { + version.push_str(" ("); + version.push_str(s); + version.push(')'); + } } version } From cb0e1505cec1a70bc60f6aa9075384fcdf4759a3 Mon Sep 17 00:00:00 2001 From: Binlogo Date: Mon, 30 Sep 2024 22:45:26 +0800 Subject: [PATCH 3/9] Update doc.rs --- src/bootstrap/src/core/build_steps/doc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index 3d504c3771fb2..1df76c236346e 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -82,7 +82,7 @@ book!( EditionGuide, "src/doc/edition-guide", "edition-guide", &[], submodule; EmbeddedBook, "src/doc/embedded-book", "embedded-book", &[], submodule; Nomicon, "src/doc/nomicon", "nomicon", &[], submodule; - RustByExample, "src/doc/rust-by-example", "rust-by-example", &["ja"], submodule; + RustByExample, "src/doc/rust-by-example", "rust-by-example", &["ja", "zh"], submodule; RustdocBook, "src/doc/rustdoc", "rustdoc", &[]; StyleGuide, "src/doc/style-guide", "style-guide", &[]; ); From 48df1ff50536969b1ed14d0125b443fa54b57c44 Mon Sep 17 00:00:00 2001 From: ismailarilik Date: Mon, 30 Sep 2024 18:00:28 +0300 Subject: [PATCH 4/9] Fix std_detect links Fixes #96506 --- src/bootstrap/src/core/build_steps/doc.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index 3d504c3771fb2..5e402378cc2c9 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -718,6 +718,10 @@ fn doc_std( .arg("--target-dir") .arg(&*target_dir.to_string_lossy()) .arg("-Zskip-rustdoc-fingerprint") + .arg("-Zrustdoc-map") + .rustdocflag("--extern-html-root-url") + .rustdocflag("std_detect=https://docs.rs/std_detect/latest/") + .rustdocflag("--extern-html-root-takes-precedence") .rustdocflag("--resource-suffix") .rustdocflag(&builder.version); for arg in extra_args { From 2ae3b1b09a09ec9c034c4cc4ba822b11c2ccbd26 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 13 Oct 2024 12:24:54 +0200 Subject: [PATCH 5/9] sys/windows: remove miri hack that is only needed for win7 --- library/std/src/sys/pal/windows/c.rs | 2 +- library/std/src/sys/pal/windows/compat.rs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs index b65ad7dbe8c5a..9ce3e912caf1b 100644 --- a/library/std/src/sys/pal/windows/c.rs +++ b/library/std/src/sys/pal/windows/c.rs @@ -175,9 +175,9 @@ extern "system" { pub fn WakeByAddressAll(address: *const c_void); } +// These are loaded by `load_synch_functions`. #[cfg(target_vendor = "win7")] compat_fn_optional! { - crate::sys::compat::load_synch_functions(); pub fn WaitOnAddress( address: *const c_void, compareaddress: *const c_void, diff --git a/library/std/src/sys/pal/windows/compat.rs b/library/std/src/sys/pal/windows/compat.rs index c8e25dd0c94ba..42999da166451 100644 --- a/library/std/src/sys/pal/windows/compat.rs +++ b/library/std/src/sys/pal/windows/compat.rs @@ -198,11 +198,10 @@ macro_rules! compat_fn_with_fallback { /// Optionally loaded functions. /// -/// Actual loading of the function defers to $load_functions. +/// Relies on the functions being pre-loaded elsewhere. #[cfg(target_vendor = "win7")] macro_rules! compat_fn_optional { - ($load_functions:expr; - $( + ($( $(#[$meta:meta])* $vis:vis fn $symbol:ident($($argname:ident: $argtype:ty),*) $(-> $rettype:ty)?; )+) => ( @@ -221,9 +220,6 @@ macro_rules! compat_fn_optional { #[inline(always)] pub fn option() -> Option { - // Miri does not understand the way we do preloading - // therefore load the function here instead. - #[cfg(miri)] $load_functions; NonNull::new(PTR.load(Ordering::Relaxed)).map(|f| unsafe { mem::transmute(f) }) } } From 8d0a0b000c385ca43cc8c46e63b492c7edbf8cf2 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 13 Oct 2024 12:27:09 +0200 Subject: [PATCH 6/9] remove outdated comment now that Miri is on CI --- library/std/src/sys/pal/windows/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/library/std/src/sys/pal/windows/mod.rs b/library/std/src/sys/pal/windows/mod.rs index 1ea253e5e5263..a9886012e8ee9 100644 --- a/library/std/src/sys/pal/windows/mod.rs +++ b/library/std/src/sys/pal/windows/mod.rs @@ -346,7 +346,6 @@ pub fn abort_internal() -> ! { } } -// miri is sensitive to changes here so check that miri is happy if touching this #[cfg(miri)] pub fn abort_internal() -> ! { crate::intrinsics::abort(); From a87f5ca917b5c3c10163601da74df2045ee8e6ea Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 13 Oct 2024 12:34:28 +0200 Subject: [PATCH 7/9] sys/unix: add comments for some Miri fallbacks --- library/std/src/sys/pal/unix/fs.rs | 2 +- library/std/src/sys/sync/thread_parking/mod.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs index 39aabf0b2d679..e80299f1868cf 100644 --- a/library/std/src/sys/pal/unix/fs.rs +++ b/library/std/src/sys/pal/unix/fs.rs @@ -899,7 +899,7 @@ impl DirEntry { target_os = "android", target_os = "hurd" ), - not(miri) + not(miri) // no dirfd on Miri ))] pub fn metadata(&self) -> io::Result { let fd = cvt(unsafe { dirfd(self.dir.dirp.0) })?; diff --git a/library/std/src/sys/sync/thread_parking/mod.rs b/library/std/src/sys/sync/thread_parking/mod.rs index 0ebc5e093ee2a..f4d8fa0a58c11 100644 --- a/library/std/src/sys/sync/thread_parking/mod.rs +++ b/library/std/src/sys/sync/thread_parking/mod.rs @@ -23,6 +23,7 @@ cfg_if::cfg_if! { mod windows7; pub use windows7::Parker; } else if #[cfg(all(target_vendor = "apple", not(miri)))] { + // Doesn't work in Miri, see . mod darwin; pub use darwin::Parker; } else if #[cfg(target_os = "xous")] { From 204e6af3eaf305c62cc1908475dfa13dd7bcaab2 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 13 Oct 2024 09:41:31 -0400 Subject: [PATCH 8/9] Remove const trait bound modifier hack --- compiler/rustc_ast_lowering/src/lib.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 263e4a9379f3a..365924ef782e8 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -1327,14 +1327,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { // takes care of rejecting invalid modifier combinations and // const trait bounds in trait object types. GenericBound::Trait(ty, modifiers) => { - // Still, don't pass along the constness here; we don't want to - // synthesize any host effect args, it'd only cause problems. - let modifiers = TraitBoundModifiers { - constness: BoundConstness::Never, - ..*modifiers - }; - let trait_ref = this.lower_poly_trait_ref(ty, itctx, modifiers); - let polarity = this.lower_trait_bound_modifiers(modifiers); + let trait_ref = this.lower_poly_trait_ref(ty, itctx, *modifiers); + let polarity = this.lower_trait_bound_modifiers(*modifiers); Some((trait_ref, polarity)) } GenericBound::Outlives(lifetime) => { From ac20242fbba8c2caaa31e9612425a5ba8df3068c Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sun, 13 Oct 2024 17:43:02 +0300 Subject: [PATCH 9/9] enable `download_ci_llvm` test Signed-off-by: onur-ozkan --- src/bootstrap/src/core/config/tests.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs index 9c67010d88dc2..2611b6cf51bbe 100644 --- a/src/bootstrap/src/core/config/tests.rs +++ b/src/bootstrap/src/core/config/tests.rs @@ -10,6 +10,7 @@ use serde::Deserialize; use super::flags::Flags; use super::{ChangeIdWrapper, Config}; use crate::core::build_steps::clippy::get_clippy_rules_in_order; +use crate::core::build_steps::llvm; use crate::core::config::{LldMode, Target, TargetSelection, TomlConfig}; pub(crate) fn parse(config: &str) -> Config { @@ -19,13 +20,22 @@ pub(crate) fn parse(config: &str) -> Config { ) } -// FIXME: Resume this test after establishing a stabilized change tracking logic. -#[ignore] #[test] fn download_ci_llvm() { - assert!(parse("").llvm_from_ci); - assert!(parse("llvm.download-ci-llvm = true").llvm_from_ci); - assert!(!parse("llvm.download-ci-llvm = false").llvm_from_ci); + let config = parse(""); + let is_available = llvm::is_ci_llvm_available(&config, config.llvm_assertions); + if is_available { + assert!(config.llvm_from_ci); + } + + let config = parse("llvm.download-ci-llvm = true"); + let is_available = llvm::is_ci_llvm_available(&config, config.llvm_assertions); + if is_available { + assert!(config.llvm_from_ci); + } + + let config = parse("llvm.download-ci-llvm = false"); + assert!(!config.llvm_from_ci); let if_unchanged_config = parse("llvm.download-ci-llvm = \"if-unchanged\""); if if_unchanged_config.llvm_from_ci {