From 5e2a7ac47a817b598aec3848efa8e674beebbcbf Mon Sep 17 00:00:00 2001 From: klensy Date: Sun, 18 Feb 2024 14:40:19 +0300 Subject: [PATCH 1/3] opt-dist: bump derive_builder to dedupe darling* and remove one more syn 1.* dep --- Cargo.lock | 73 +++++++++-------------------------- src/tools/opt-dist/Cargo.toml | 2 +- 2 files changed, 20 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f9ad78e3795..77469cb29b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -931,43 +931,19 @@ dependencies = [ [[package]] name = "darling" -version = "0.14.4" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955" dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", -] - -[[package]] -name = "darling" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" -dependencies = [ - "darling_core 0.20.5", - "darling_macro 0.20.5", + "darling_core", + "darling_macro", ] [[package]] name = "darling_core" -version = "0.14.4" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", -] - -[[package]] -name = "darling_core" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" +checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855" dependencies = [ "fnv", "ident_case", @@ -979,22 +955,11 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.14.4" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" dependencies = [ - "darling_core 0.14.4", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" -dependencies = [ - "darling_core 0.20.5", + "darling_core", "quote", "syn 2.0.48", ] @@ -1036,33 +1001,33 @@ dependencies = [ [[package]] name = "derive_builder" -version = "0.12.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.12.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" dependencies = [ - "darling 0.14.4", + "darling", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "derive_builder_macro" -version = "0.12.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -1084,7 +1049,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d" dependencies = [ - "darling 0.20.5", + "darling", "proc-macro2", "quote", "syn 2.0.48", diff --git a/src/tools/opt-dist/Cargo.toml b/src/tools/opt-dist/Cargo.toml index 9e852b0645a..eb6f889a6f3 100644 --- a/src/tools/opt-dist/Cargo.toml +++ b/src/tools/opt-dist/Cargo.toml @@ -21,6 +21,6 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" glob = "0.3" tempfile = "3.5" -derive_builder = "0.12" +derive_builder = "0.20" clap = { version = "4", features = ["derive"] } tabled = { version = "0.13", default-features = false, features = ["std"] } From 35fe26757adce8cd8d1b9e7f4107a0ac9a7ab27b Mon Sep 17 00:00:00 2001 From: klensy Date: Sun, 18 Feb 2024 16:02:16 +0300 Subject: [PATCH 2/3] windows bump to 0.52 --- Cargo.lock | 7 ++++--- compiler/rustc_codegen_ssa/Cargo.toml | 2 +- compiler/rustc_data_structures/Cargo.toml | 2 +- compiler/rustc_data_structures/src/flock/windows.rs | 1 - compiler/rustc_data_structures/src/profiling.rs | 6 ++---- compiler/rustc_driver_impl/Cargo.toml | 2 +- compiler/rustc_errors/Cargo.toml | 2 +- compiler/rustc_errors/src/lock.rs | 6 ++++-- compiler/rustc_session/Cargo.toml | 2 +- compiler/rustc_session/src/filesearch.rs | 1 - src/tools/compiletest/Cargo.toml | 2 +- 11 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77469cb29b7..ad1bad7d4f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6176,11 +6176,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-targets 0.48.5", + "windows-core", + "windows-targets 0.52.0", ] [[package]] diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml index c4aaf421444..e144b1dc1bd 100644 --- a/compiler/rustc_codegen_ssa/Cargo.toml +++ b/compiler/rustc_codegen_ssa/Cargo.toml @@ -51,5 +51,5 @@ default-features = false features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write"] [target.'cfg(windows)'.dependencies.windows] -version = "0.48.0" +version = "0.52.0" features = ["Win32_Globalization"] diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index 0635d8552ae..80b6e72e49b 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -33,7 +33,7 @@ tracing = "0.1" version = "0.12" [target.'cfg(windows)'.dependencies.windows] -version = "0.48.0" +version = "0.52.0" features = [ "Win32_Foundation", "Win32_Storage_FileSystem", diff --git a/compiler/rustc_data_structures/src/flock/windows.rs b/compiler/rustc_data_structures/src/flock/windows.rs index da128f464a6..9be1065135a 100644 --- a/compiler/rustc_data_structures/src/flock/windows.rs +++ b/compiler/rustc_data_structures/src/flock/windows.rs @@ -69,7 +69,6 @@ impl Lock { &mut overlapped, ) } - .ok() .map_err(|e| { let err = io::Error::from_raw_os_error(e.code().0); debug!("failed acquiring file lock: {}", err); diff --git a/compiler/rustc_data_structures/src/profiling.rs b/compiler/rustc_data_structures/src/profiling.rs index e29d4811980..2569684df3f 100644 --- a/compiler/rustc_data_structures/src/profiling.rs +++ b/compiler/rustc_data_structures/src/profiling.rs @@ -866,16 +866,14 @@ cfg_match! { use std::mem; use windows::{ - // FIXME: change back to K32GetProcessMemoryInfo when windows crate - // updated to 0.49.0+ to drop dependency on psapi.dll - Win32::System::ProcessStatus::{GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS}, + Win32::System::ProcessStatus::{K32GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS}, Win32::System::Threading::GetCurrentProcess, }; let mut pmc = PROCESS_MEMORY_COUNTERS::default(); let pmc_size = mem::size_of_val(&pmc); unsafe { - GetProcessMemoryInfo( + K32GetProcessMemoryInfo( GetCurrentProcess(), &mut pmc, pmc_size as u32, diff --git a/compiler/rustc_driver_impl/Cargo.toml b/compiler/rustc_driver_impl/Cargo.toml index bfdd871455c..242aa06fe3e 100644 --- a/compiler/rustc_driver_impl/Cargo.toml +++ b/compiler/rustc_driver_impl/Cargo.toml @@ -60,7 +60,7 @@ libc = "0.2" # tidy-alphabetical-end [target.'cfg(windows)'.dependencies.windows] -version = "0.48.0" +version = "0.52.0" features = [ "Win32_System_Diagnostics_Debug", ] diff --git a/compiler/rustc_errors/Cargo.toml b/compiler/rustc_errors/Cargo.toml index a2d1fd2a924..cc114fdcd8c 100644 --- a/compiler/rustc_errors/Cargo.toml +++ b/compiler/rustc_errors/Cargo.toml @@ -30,7 +30,7 @@ unicode-width = "0.1.4" # tidy-alphabetical-end [target.'cfg(windows)'.dependencies.windows] -version = "0.48.0" +version = "0.52.0" features = [ "Win32_Foundation", "Win32_Security", diff --git a/compiler/rustc_errors/src/lock.rs b/compiler/rustc_errors/src/lock.rs index bd5cf49b56b..0aeb511214b 100644 --- a/compiler/rustc_errors/src/lock.rs +++ b/compiler/rustc_errors/src/lock.rs @@ -27,7 +27,8 @@ pub fn acquire_global_lock(name: &str) -> Box { impl Drop for Handle { fn drop(&mut self) { unsafe { - CloseHandle(self.0); + // FIXME can panic here + CloseHandle(self.0).unwrap(); } } } @@ -37,7 +38,8 @@ pub fn acquire_global_lock(name: &str) -> Box { impl Drop for Guard { fn drop(&mut self) { unsafe { - ReleaseMutex((self.0).0); + // FIXME can panic here + ReleaseMutex((self.0).0).unwrap(); } } } diff --git a/compiler/rustc_session/Cargo.toml b/compiler/rustc_session/Cargo.toml index ba8f67982f5..721a9275d01 100644 --- a/compiler/rustc_session/Cargo.toml +++ b/compiler/rustc_session/Cargo.toml @@ -30,7 +30,7 @@ libc = "0.2" # tidy-alphabetical-end [target.'cfg(windows)'.dependencies.windows] -version = "0.48.0" +version = "0.52.0" features = [ "Win32_Foundation", "Win32_System_LibraryLoader", diff --git a/compiler/rustc_session/src/filesearch.rs b/compiler/rustc_session/src/filesearch.rs index 6e459ac45d3..2456b4b3a15 100644 --- a/compiler/rustc_session/src/filesearch.rs +++ b/compiler/rustc_session/src/filesearch.rs @@ -143,7 +143,6 @@ fn current_dll_path() -> Result { &mut module, ) } - .ok() .map_err(|e| e.to_string())?; let mut filename = vec![0; 1024]; diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml index 31c6353e675..62d0fcc1a60 100644 --- a/src/tools/compiletest/Cargo.toml +++ b/src/tools/compiletest/Cargo.toml @@ -34,7 +34,7 @@ libc = "0.2" miow = "0.6" [target.'cfg(windows)'.dependencies.windows] -version = "0.48.0" +version = "0.52.0" features = [ "Win32_Foundation", "Win32_System_Diagnostics_Debug", From 92386223a1e2e16e27f7ab56663bbe19febc410c Mon Sep 17 00:00:00 2001 From: klensy Date: Sun, 18 Feb 2024 16:17:56 +0300 Subject: [PATCH 3/3] tidy: add windows-core --- src/tools/tidy/src/deps.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index d4642deb2c6..b36b6da308e 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -384,6 +384,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "winapi-util", "winapi-x86_64-pc-windows-gnu", "windows", + "windows-core", "windows-sys", "windows-targets", "windows_aarch64_gnullvm",