Auto merge of #155681 - bjorn3:update_dlmalloc, r=clubby789

Remove windows-sys from the library workspace

Windows-sys isn't actually used as dlmalloc doesn't use it on any of the targets where std uses dlmalloc, but still ends up in the lockfile and thus gets vendored. By using a patch to replace it with an empty crate the vendor size of the standard library is reduced from 93MB to 20MB.
This commit is contained in:
bors
2026-05-05 04:09:17 +00:00
5 changed files with 25 additions and 90 deletions
+4 -80
View File
@@ -78,9 +78,9 @@ dependencies = [
[[package]]
name = "dlmalloc"
version = "0.2.11"
version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06cdfe340b16dd990c54cce79743613fa09fbb16774f33a77c9fd196f8f3fa30"
checksum = "9f5b01c17f85ee988d832c40e549a64bd89ab2c9f8d8a613bdf5122ae507e294"
dependencies = [
"cfg-if",
"libc",
@@ -347,7 +347,7 @@ dependencies = [
"wasip1",
"wasip2",
"wasip3",
"windows-link 0.0.0",
"windows-link",
]
[[package]]
@@ -443,85 +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.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.53.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
dependencies = [
"windows-link 0.2.1",
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
[[package]]
name = "windows_aarch64_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
[[package]]
name = "windows_i686_gnu"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
[[package]]
name = "windows_i686_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
[[package]]
name = "windows_i686_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
[[package]]
name = "windows_x86_64_gnu"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
[[package]]
name = "windows_x86_64_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
version = "0.61.100"
[[package]]
name = "wit-bindgen"
+3
View File
@@ -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' }
+16
View File
@@ -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 = []
+1
View File
@@ -0,0 +1 @@
compile_error!("This crate should never be compiled");
+1 -10
View File
@@ -543,16 +543,7 @@ pub(crate) struct WorkspaceInfo<'a> {
"wasip2",
"wasip3",
"windows-link",
"windows-sys",
"windows-targets",
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
"windows-sys@0.61.100", // Enforce the usage of our dummy windows-sys patch. Keep version in sync.
"wit-bindgen",
// tidy-alphabetical-end
];