mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-06 08:36:52 -04:00
Replace windows-sys with a dummy crate in the library workspace
This reduces the vendor size of the standard library from 37MB to 20MB.
This commit is contained in:
+2
-13
@@ -347,7 +347,7 @@ dependencies = [
|
||||
"wasip1",
|
||||
"wasip2",
|
||||
"wasip3",
|
||||
"windows-link 0.0.0",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -443,20 +443,9 @@ dependencies = [
|
||||
name = "windows-link"
|
||||
version = "0.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "windows-link"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.61.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||
dependencies = [
|
||||
"windows-link 0.2.1",
|
||||
]
|
||||
version = "0.61.100"
|
||||
|
||||
[[package]]
|
||||
name = "wit-bindgen"
|
||||
|
||||
@@ -85,3 +85,6 @@ rustflags = [
|
||||
rustc-std-workspace-core = { path = 'rustc-std-workspace-core' }
|
||||
rustc-std-workspace-alloc = { path = 'rustc-std-workspace-alloc' }
|
||||
rustc-std-workspace-std = { path = 'rustc-std-workspace-std' }
|
||||
|
||||
# See comments in `library/windows-sys/Cargo.toml` for why this is patched
|
||||
windows-sys = { path = 'windows-sys' }
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# dlmalloc has a dependency on windows-sys for when it gets compiled for Windows.
|
||||
# std however never actually uses dlmalloc on Windows. As dlmalloc is the only
|
||||
# user of windows-sys in the standard library, the windows-sys crate unnecessarily
|
||||
# increases the size of the vendored crates. By replacing it with an empty crate
|
||||
# we save about 19MB.
|
||||
|
||||
[package]
|
||||
name = "windows-sys"
|
||||
version = "0.61.100"
|
||||
edition = "2024"
|
||||
|
||||
[features]
|
||||
Win32_Foundation = []
|
||||
Win32_System_Memory = []
|
||||
Win32_System_Threading = []
|
||||
Win32_System_SystemInformation = []
|
||||
@@ -0,0 +1 @@
|
||||
compile_error!("This crate should never be compiled");
|
||||
@@ -543,7 +543,7 @@ const PERMITTED_STDLIB_DEPENDENCIES: &[&str] = &[
|
||||
"wasip2",
|
||||
"wasip3",
|
||||
"windows-link",
|
||||
"windows-sys",
|
||||
"windows-sys@0.61.100", // Enforce the usage of our dummy windows-sys patch. Keep version in sync.
|
||||
"wit-bindgen",
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user