Description: avoid Windows-only crates
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2025-02-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/cranelift/interpreter/Cargo.toml
+++ b/cranelift/interpreter/Cargo.toml
@@ -21,9 +21,6 @@
 smallvec = { workspace = true }
 thiserror = { workspace = true }
 
-[target.x86_64-pc-windows-gnu.dependencies]
-libm = "0.2.4"
-
 [dev-dependencies]
 cranelift-frontend = { workspace = true }
 cranelift-reader = { workspace = true }
--- a/cranelift/jit/Cargo.toml
+++ b/cranelift/jit/Cargo.toml
@@ -27,14 +27,6 @@
 log = { workspace = true }
 wasmtime-jit-icache-coherence = { workspace = true }
 
-[target.'cfg(windows)'.dependencies.windows-sys]
-workspace = true
-features = [
-    "Win32_Foundation",
-    "Win32_System_LibraryLoader",
-    "Win32_System_Memory",
-]
-
 [features]
 selinux-fix = ['memmap2']
 default = []
--- a/crates/jit-icache-coherence/Cargo.toml
+++ b/crates/jit-icache-coherence/Cargo.toml
@@ -16,14 +16,6 @@
 cfg-if = { workspace = true }
 anyhow = { workspace = true }
 
-[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
-workspace = true
-features = [
-    "Win32_Foundation",
-    "Win32_System_Threading",
-    "Win32_System_Diagnostics_Debug",
-]
-
 [target.'cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android"))'.dependencies]
 libc = { workspace = true }
 
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -100,9 +100,6 @@
 object = { workspace = true, features = ['std'] }
 wasmtime-test-macros = { path = "crates/test-macros" }
 
-[target.'cfg(windows)'.dev-dependencies]
-windows-sys = { workspace = true, features = ["Win32_System_Memory"] }
-
 [build-dependencies]
 anyhow = { workspace = true, features = ['std'] }
 
@@ -221,7 +218,6 @@
 gimli = { version = "0.31.0", default-features = false, features = ['read'] }
 addr2line = { version = "0.24.1", default-features = false }
 anyhow = { version = "1.0.22", default-features = false }
-windows-sys = "0.59.0"
 env_logger = "0.11.5"
 log = { version = "0.4.8", default-features = false }
 clap = { version = "4.5.17", default-features = false, features = ["std", "derive"] }
--- a/crates/cache/Cargo.toml
+++ b/crates/cache/Cargo.toml
@@ -24,12 +24,6 @@
 toml = { workspace = true }
 zstd = { version = "0.13.0", default-features = false }
 
-[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
-workspace = true
-features = [
-  "Win32_System_Threading",
-]
-
 [target.'cfg(not(target_os = "windows"))'.dependencies]
 rustix = { workspace = true, features = ["process"] }
 
--- a/crates/fiber/Cargo.toml
+++ b/crates/fiber/Cargo.toml
@@ -20,13 +20,6 @@
 rustix = { workspace = true, features = ["mm", "param"] }
 wasmtime-asm-macros = { workspace = true }
 
-[target.'cfg(windows)'.dependencies.windows-sys]
-workspace = true
-features = [
-  "Win32_System_Threading",
-  "Win32_Foundation",
-]
-
 [build-dependencies]
 cc = "1.0"
 wasmtime-versioned-export-macros = { workspace = true }
--- a/crates/wasi-common/Cargo.toml
+++ b/crates/wasi-common/Cargo.toml
@@ -42,17 +42,6 @@
 [target.'cfg(unix)'.dependencies]
 rustix = { workspace = true, features = ["fs", "event"] }
 
-[target.'cfg(windows)'.dependencies]
-io-extras = { workspace = true }
-rustix = { workspace = true, features = ["net"] }
-
-[target.'cfg(windows)'.dependencies.windows-sys]
-workspace = true
-features = [
-    "Win32_Foundation",
-    "Win32_Networking_WinSock",
-]
-
 [dev-dependencies]
 wasi-common = { path = '.', features = ['tokio'] }
 tempfile = { workspace = true }
--- a/crates/wasi-nn/Cargo.toml
+++ b/crates/wasi-nn/Cargo.toml
@@ -38,17 +38,6 @@
     "download-binaries",
 ], optional = true }
 
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.52"
-features = [
-    "AI_MachineLearning",
-    "Storage_Streams",
-    "Foundation_Collections",
-    # For getting IVectorView<i64> from tensor.dimensions.
-    "implement",
-]
-optional = true
-
 [build-dependencies]
 walkdir = { workspace = true }
 
@@ -61,13 +50,11 @@
 tracing-subscriber = { workspace = true }
 
 [features]
-default = ["openvino", "winml"]
+default = ["openvino"]
 # OpenVINO is available on all platforms; it requires OpenVINO to be installed.
 openvino = ["dep:openvino"]
 # ONNX is available on all platforms.
 onnx = ["dep:ort"]
-# WinML is only available on Windows 10 1809 and later.
-winml = ["dep:windows"]
 
 [[test]]
 name = "test-programs"
--- a/crates/wasi/Cargo.toml
+++ b/crates/wasi/Cargo.toml
@@ -47,11 +47,6 @@
 [target.'cfg(unix)'.dependencies]
 rustix = { workspace = true, features = ["event", "fs", "net"] }
 
-[target.'cfg(windows)'.dependencies]
-io-extras = { workspace = true }
-windows-sys = { workspace = true }
-rustix = { workspace = true, features = ["event", "net"] }
-
 [features]
 default = [ "preview1"]
 preview1 = [
--- a/crates/wasmtime/Cargo.toml
+++ b/crates/wasmtime/Cargo.toml
@@ -56,19 +56,6 @@
 libm = "0.2.7"
 bitflags = { workspace = true }
 
-[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
-workspace = true
-optional = true
-features = [
-  "Win32_Foundation",
-  "Win32_System_Kernel",
-  "Win32_System_Memory",
-  "Win32_System_Diagnostics_Debug",
-  "Win32_System_SystemInformation",
-  "Win32_Storage_FileSystem",
-  "Win32_Security",
-]
-
 [target.'cfg(all(target_arch = "x86_64", not(target_os = "android")))'.dependencies]
 ittapi = { version = "0.4.0", optional = true }
 
@@ -189,7 +176,6 @@
   "dep:wasmtime-jit-icache-coherence",
   "dep:wasmtime-slab",
   "dep:wasmtime-versioned-export-macros",
-  "dep:windows-sys",
   "dep:psm",
   "dep:rustix",
   "rustix/mm",
