Rollup merge of #111393 - klensy:win-0.48, r=oli-obk

bump windows crate 0.46 -> 0.48

This drops duped version of crate(0.46), reduces `rustc_driver.dll` ~800kb and reduces exported functions number from 26k to 22k.

Also while here, added `tidy-alphabetical` sorting to lists in tidy allowed lists.
This commit is contained in:
Matthias Krüger 2023-05-12 07:11:12 +02:00 committed by GitHub
commit d075b6c16d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 69 additions and 59 deletions

View File

@ -741,7 +741,7 @@ dependencies = [
"tracing-subscriber", "tracing-subscriber",
"unified-diff", "unified-diff",
"walkdir", "walkdir",
"windows 0.46.0", "windows",
] ]
[[package]] [[package]]
@ -1647,7 +1647,7 @@ dependencies = [
"iana-time-zone-haiku", "iana-time-zone-haiku",
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
"windows 0.48.0", "windows",
] ]
[[package]] [[package]]
@ -3259,7 +3259,7 @@ dependencies = [
"tempfile", "tempfile",
"thorin-dwp", "thorin-dwp",
"tracing", "tracing",
"windows 0.46.0", "windows",
] ]
[[package]] [[package]]
@ -3315,7 +3315,7 @@ dependencies = [
"tempfile", "tempfile",
"thin-vec", "thin-vec",
"tracing", "tracing",
"windows 0.46.0", "windows",
] ]
[[package]] [[package]]
@ -3376,7 +3376,7 @@ dependencies = [
"rustc_ty_utils", "rustc_ty_utils",
"serde_json", "serde_json",
"tracing", "tracing",
"windows 0.46.0", "windows",
] ]
[[package]] [[package]]
@ -3426,7 +3426,7 @@ dependencies = [
"termize", "termize",
"tracing", "tracing",
"unicode-width", "unicode-width",
"windows 0.46.0", "windows",
] ]
[[package]] [[package]]
@ -4096,7 +4096,7 @@ dependencies = [
"smallvec", "smallvec",
"termize", "termize",
"tracing", "tracing",
"windows 0.46.0", "windows",
] ]
[[package]] [[package]]
@ -5498,15 +5498,6 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25"
dependencies = [
"windows-targets 0.42.2",
]
[[package]] [[package]]
name = "windows" name = "windows"
version = "0.48.0" version = "0.48.0"

View File

@ -51,5 +51,5 @@ default-features = false
features = ["read_core", "elf", "macho", "pe", "unaligned", "archive", "write"] features = ["read_core", "elf", "macho", "pe", "unaligned", "archive", "write"]
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.46.0" version = "0.48.0"
features = ["Win32_Globalization"] features = ["Win32_Globalization"]

View File

@ -37,7 +37,7 @@ itertools = "0.10.1"
version = "0.11" version = "0.11"
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.46.0" version = "0.48.0"
features = [ features = [
"Win32_Foundation", "Win32_Foundation",
"Win32_Storage_FileSystem", "Win32_Storage_FileSystem",

View File

@ -865,14 +865,16 @@ pub fn get_resident_set_size() -> Option<usize> {
use std::mem; use std::mem;
use windows::{ use windows::{
Win32::System::ProcessStatus::{K32GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS}, // 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::Threading::GetCurrentProcess, Win32::System::Threading::GetCurrentProcess,
}; };
let mut pmc = PROCESS_MEMORY_COUNTERS::default(); let mut pmc = PROCESS_MEMORY_COUNTERS::default();
let pmc_size = mem::size_of_val(&pmc); let pmc_size = mem::size_of_val(&pmc);
unsafe { unsafe {
K32GetProcessMemoryInfo( GetProcessMemoryInfo(
GetCurrentProcess(), GetCurrentProcess(),
&mut pmc, &mut pmc,
pmc_size as u32, pmc_size as u32,

View File

@ -57,7 +57,7 @@ rustc_mir_transform = { path = "../rustc_mir_transform" }
libc = "0.2" libc = "0.2"
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.46.0" version = "0.48.0"
features = [ features = [
"Win32_System_Diagnostics_Debug", "Win32_System_Diagnostics_Debug",
] ]

View File

@ -27,12 +27,11 @@ serde = { version = "1.0.125", features = [ "derive" ] }
serde_json = "1.0.59" serde_json = "1.0.59"
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.46.0" version = "0.48.0"
features = [ features = [
"Win32_Foundation", "Win32_Foundation",
"Win32_Security", "Win32_Security",
"Win32_System_Threading", "Win32_System_Threading",
"Win32_System_WindowsProgramming",
] ]
[features] [features]

View File

@ -19,8 +19,7 @@ pub fn acquire_global_lock(name: &str) -> Box<dyn Any> {
use windows::{ use windows::{
core::PCSTR, core::PCSTR,
Win32::Foundation::{CloseHandle, HANDLE, WAIT_ABANDONED, WAIT_OBJECT_0}, Win32::Foundation::{CloseHandle, HANDLE, WAIT_ABANDONED, WAIT_OBJECT_0},
Win32::System::Threading::{CreateMutexA, ReleaseMutex, WaitForSingleObject}, Win32::System::Threading::{CreateMutexA, ReleaseMutex, WaitForSingleObject, INFINITE},
Win32::System::WindowsProgramming::INFINITE,
}; };
struct Handle(HANDLE); struct Handle(HANDLE);

View File

@ -25,7 +25,7 @@ termize = "0.1.1"
libc = "0.2" libc = "0.2"
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.46.0" version = "0.48.0"
features = [ features = [
"Win32_Foundation", "Win32_Foundation",
"Win32_System_LibraryLoader", "Win32_System_LibraryLoader",

View File

@ -135,13 +135,13 @@ fn current_dll_path() -> Result<PathBuf, String> {
use windows::{ use windows::{
core::PCWSTR, core::PCWSTR,
Win32::Foundation::HINSTANCE, Win32::Foundation::HMODULE,
Win32::System::LibraryLoader::{ Win32::System::LibraryLoader::{
GetModuleFileNameW, GetModuleHandleExW, GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, GetModuleFileNameW, GetModuleHandleExW, GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
}, },
}; };
let mut module = HINSTANCE::default(); let mut module = HMODULE::default();
unsafe { unsafe {
GetModuleHandleExW( GetModuleHandleExW(
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,

View File

@ -28,7 +28,7 @@ libc = "0.2"
miow = "0.5" miow = "0.5"
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.46.0" version = "0.48.0"
features = [ features = [
"Win32_Foundation", "Win32_Foundation",
"Win32_System_Diagnostics_Debug", "Win32_System_Diagnostics_Debug",

View File

@ -6,47 +6,53 @@
/// These are licenses that are allowed for all crates, including the runtime, /// These are licenses that are allowed for all crates, including the runtime,
/// rustc, tools, etc. /// rustc, tools, etc.
#[rustfmt::skip]
const LICENSES: &[&str] = &[ const LICENSES: &[&str] = &[
"MIT/Apache-2.0", // tidy-alphabetical-start
"MIT / Apache-2.0", "(MIT OR Apache-2.0) AND Unicode-DFS-2016", // unicode_ident
"Apache-2.0/MIT", "0BSD OR MIT OR Apache-2.0", // adler license
"0BSD",
"Apache-2.0 / MIT", "Apache-2.0 / MIT",
"MIT OR Apache-2.0",
"Apache-2.0 OR MIT", "Apache-2.0 OR MIT",
"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", // wasi license "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", // wasi license
"MIT", "Apache-2.0/MIT",
"ISC", "ISC",
"Unlicense/MIT", "MIT / Apache-2.0",
"MIT OR Apache-2.0 OR Zlib", // tinyvec_macros
"MIT OR Apache-2.0",
"MIT OR Zlib OR Apache-2.0", // miniz_oxide
"MIT",
"MIT/Apache-2.0",
"Unicode-DFS-2016", // tinystr and icu4x
"Unlicense OR MIT", "Unlicense OR MIT",
"0BSD", "Unlicense/MIT",
"0BSD OR MIT OR Apache-2.0", // adler license "Zlib OR Apache-2.0 OR MIT", // tinyvec
"Zlib OR Apache-2.0 OR MIT", // tinyvec // tidy-alphabetical-end
"MIT OR Apache-2.0 OR Zlib", // tinyvec_macros
"MIT OR Zlib OR Apache-2.0", // miniz_oxide
"(MIT OR Apache-2.0) AND Unicode-DFS-2016", // unicode_ident
"Unicode-DFS-2016", // tinystr and icu4x
]; ];
/// These are exceptions to Rust's permissive licensing policy, and /// These are exceptions to Rust's permissive licensing policy, and
/// should be considered bugs. Exceptions are only allowed in Rust /// should be considered bugs. Exceptions are only allowed in Rust
/// tooling. It is _crucial_ that no exception crates be dependencies /// tooling. It is _crucial_ that no exception crates be dependencies
/// of the Rust runtime (std/test). /// of the Rust runtime (std/test).
#[rustfmt::skip]
const EXCEPTIONS: &[(&str, &str)] = &[ const EXCEPTIONS: &[(&str, &str)] = &[
// tidy-alphabetical-start
("ar_archive_writer", "Apache-2.0 WITH LLVM-exception"), // rustc ("ar_archive_writer", "Apache-2.0 WITH LLVM-exception"), // rustc
("mdbook", "MPL-2.0"), // mdbook ("codespan-reporting", "Apache-2.0"), // cxx via iana-time-zone-haiku via time, only on haiku
("colored", "MPL-2.0"), // rustfmt ("colored", "MPL-2.0"), // rustfmt
("dissimilar", "Apache-2.0"), // rustdoc, rustc_lexer (few tests) via expect-test, (dev deps)
("fluent-langneg", "Apache-2.0"), // rustc (fluent translations)
("fortanix-sgx-abi", "MPL-2.0"), // libstd but only for `sgx` target. FIXME: this dependency violates the documentation comment above.
("instant", "BSD-3-Clause"), // rustc_driver/tracing-subscriber/parking_lot
("mdbook", "MPL-2.0"), // mdbook
("ryu", "Apache-2.0 OR BSL-1.0"), // cargo/... (because of serde) ("ryu", "Apache-2.0 OR BSL-1.0"), // cargo/... (because of serde)
("codespan-reporting", "Apache-2.0"), // cxx via iana-time-zone-haiku via time, only on haiku ("self_cell", "Apache-2.0"), // rustc (fluent translations)
("instant", "BSD-3-Clause"), // rustc_driver/tracing-subscriber/parking_lot ("snap", "BSD-3-Clause"), // rustc
("snap", "BSD-3-Clause"), // rustc // tidy-alphabetical-end
("fluent-langneg", "Apache-2.0"), // rustc (fluent translations)
("self_cell", "Apache-2.0"), // rustc (fluent translations)
// FIXME: this dependency violates the documentation comment above:
("fortanix-sgx-abi", "MPL-2.0"), // libstd but only for `sgx` target
("dissimilar", "Apache-2.0"), // rustdoc, rustc_lexer (few tests) via expect-test, (dev deps)
]; ];
const EXCEPTIONS_CARGO: &[(&str, &str)] = &[ const EXCEPTIONS_CARGO: &[(&str, &str)] = &[
// tidy-alphabetical-start
("bitmaps", "MPL-2.0+"), ("bitmaps", "MPL-2.0+"),
("bytesize", "Apache-2.0"), ("bytesize", "Apache-2.0"),
("dunce", "CC0-1.0 OR MIT-0"), ("dunce", "CC0-1.0 OR MIT-0"),
@ -62,9 +68,11 @@
("sized-chunks", "MPL-2.0+"), ("sized-chunks", "MPL-2.0+"),
("subtle", "BSD-3-Clause"), ("subtle", "BSD-3-Clause"),
("unicode-bom", "Apache-2.0"), ("unicode-bom", "Apache-2.0"),
// tidy-alphabetical-end
]; ];
const EXCEPTIONS_CRANELIFT: &[(&str, &str)] = &[ const EXCEPTIONS_CRANELIFT: &[(&str, &str)] = &[
// tidy-alphabetical-start
("cranelift-bforest", "Apache-2.0 WITH LLVM-exception"), ("cranelift-bforest", "Apache-2.0 WITH LLVM-exception"),
("cranelift-codegen", "Apache-2.0 WITH LLVM-exception"), ("cranelift-codegen", "Apache-2.0 WITH LLVM-exception"),
("cranelift-codegen-meta", "Apache-2.0 WITH LLVM-exception"), ("cranelift-codegen-meta", "Apache-2.0 WITH LLVM-exception"),
@ -80,6 +88,7 @@
("regalloc2", "Apache-2.0 WITH LLVM-exception"), ("regalloc2", "Apache-2.0 WITH LLVM-exception"),
("target-lexicon", "Apache-2.0 WITH LLVM-exception"), ("target-lexicon", "Apache-2.0 WITH LLVM-exception"),
("wasmtime-jit-icache-coherence", "Apache-2.0 WITH LLVM-exception"), ("wasmtime-jit-icache-coherence", "Apache-2.0 WITH LLVM-exception"),
// tidy-alphabetical-end
]; ];
const EXCEPTIONS_BOOTSTRAP: &[(&str, &str)] = &[ const EXCEPTIONS_BOOTSTRAP: &[(&str, &str)] = &[
@ -95,6 +104,7 @@
/// This list is here to provide a speed-bump to adding a new dependency to /// This list is here to provide a speed-bump to adding a new dependency to
/// rustc. Please check with the compiler team before adding an entry. /// rustc. Please check with the compiler team before adding an entry.
const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
// tidy-alphabetical-start
"addr2line", "addr2line",
"adler", "adler",
"ahash", "ahash",
@ -113,8 +123,8 @@
"chalk-engine", "chalk-engine",
"chalk-ir", "chalk-ir",
"chalk-solve", "chalk-solve",
"convert_case", // dependency of derive_more
"compiler_builtins", "compiler_builtins",
"convert_case", // dependency of derive_more
"cpufeatures", "cpufeatures",
"crc32fast", "crc32fast",
"crossbeam-channel", "crossbeam-channel",
@ -187,8 +197,8 @@
"ppv-lite86", "ppv-lite86",
"proc-macro-hack", "proc-macro-hack",
"proc-macro2", "proc-macro2",
"pulldown-cmark",
"psm", "psm",
"pulldown-cmark",
"punycode", "punycode",
"quote", "quote",
"rand", "rand",
@ -227,6 +237,7 @@
"tempfile", "tempfile",
"termcolor", "termcolor",
"termize", "termize",
"thin-vec",
"thiserror", "thiserror",
"thiserror-impl", "thiserror-impl",
"thorin-dwp", "thorin-dwp",
@ -234,7 +245,6 @@
"tinystr", "tinystr",
"tinyvec", "tinyvec",
"tinyvec_macros", "tinyvec_macros",
"thin-vec",
"tracing", "tracing",
"tracing-attributes", "tracing-attributes",
"tracing-core", "tracing-core",
@ -263,29 +273,37 @@
"valuable", "valuable",
"version_check", "version_check",
"wasi", "wasi",
"windows",
"winapi", "winapi",
"winapi-i686-pc-windows-gnu", "winapi-i686-pc-windows-gnu",
"winapi-util", "winapi-util",
"winapi-x86_64-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu",
"windows",
"windows-targets",
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
"writeable", "writeable",
// this is a false-positive: it's only used by rustfmt, but because it's enabled through a "yansi-term", // this is a false-positive: it's only used by rustfmt, but because it's enabled through a feature, tidy thinks it's used by rustc as well.
// feature, tidy thinks it's used by rustc as well.
"yansi-term",
"yoke", "yoke",
"yoke-derive", "yoke-derive",
"zerofrom", "zerofrom",
"zerofrom-derive", "zerofrom-derive",
"zerovec", "zerovec",
"zerovec-derive", "zerovec-derive",
// tidy-alphabetical-end
]; ];
const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[ const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[
// tidy-alphabetical-start
"ahash", "ahash",
"anyhow", "anyhow",
"autocfg", "autocfg",
"bumpalo",
"bitflags", "bitflags",
"bumpalo",
"byteorder", "byteorder",
"cfg-if", "cfg-if",
"cranelift-bforest", "cranelift-bforest",
@ -324,6 +342,7 @@
"winapi-i686-pc-windows-gnu", "winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu",
"windows-sys", "windows-sys",
// tidy-alphabetical-end
]; ];
/// Dependency checks. /// Dependency checks.