d-0020-remove-windows-dependencies
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Mon, 6 May 2024 08:25:32 +0000 (10:25 +0200)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Thu, 28 May 2026 18:58:07 +0000 (20:58 +0200)
use something like

 find src compiler library -iname Cargo.toml -exec grep -H -n -e 'windows-sys' -e 'winapi' -e 'ntapi' -e 'wincon' -e 'winreg' -e 'windows' {} \;

to find and eliminate dependencies on windows-only crates when rebasing.

windows-bindgen and windows-metadata should not be removed, they are needed for
the build and don't pull in windows-sys and friends.

Forwarded: not-needed

===================================================================

Gbp-Pq: Topic prune
Gbp-Pq: Name d-0020-remove-windows-dependencies.patch

20 files changed:
compiler/rustc_codegen_ssa/Cargo.toml
compiler/rustc_data_structures/Cargo.toml
compiler/rustc_driver_impl/Cargo.toml
compiler/rustc_errors/Cargo.toml
compiler/rustc_session/Cargo.toml
library/backtrace/Cargo.toml
library/backtrace/crates/as-if-std/Cargo.toml
src/bootstrap/Cargo.toml
src/tools/cargo/Cargo.toml
src/tools/cargo/crates/cargo-test-support/Cargo.toml
src/tools/cargo/crates/cargo-util/Cargo.toml
src/tools/cargo/crates/home/Cargo.toml
src/tools/cargo/credential/cargo-credential/Cargo.toml
src/tools/cargo/src/cargo/util/auth/mod.rs
src/tools/compiletest/Cargo.toml
src/tools/rust-analyzer/crates/profile/Cargo.toml
src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml
src/tools/rust-analyzer/crates/stdx/Cargo.toml
src/tools/rustc-perf/collector/Cargo.toml
src/tools/rustc-perf/collector/compile-benchmarks/tokio-webpush-simple/native-tls-0.1.5/Cargo.toml

index c7d7b7429f34a98f6cb638afaab027139e8c5b2c..1a0c8f8d1aa264a831c43365ad71a1635ad97dbc 100644 (file)
@@ -50,7 +50,3 @@ libc = "0.2.50"
 version = "0.37.0"
 default-features = false
 features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write", "wasm"]
-
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.61.0"
-features = ["Win32_Globalization"]
index f358ffffb47d19311c8744f32cc793936cb2f7b6..b264e3d56c6e48edbda8780df18dc09c3931dd4f 100644 (file)
@@ -35,16 +35,6 @@ version = "0.16.1"
 default-features = false
 features = ["nightly"] # for may_dangle
 
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.61.0"
-features = [
-    "Win32_Foundation",
-    "Win32_Storage_FileSystem",
-    "Win32_System_IO",
-    "Win32_System_ProcessStatus",
-    "Win32_System_Threading",
-]
-
 [target.'cfg(unix)'.dependencies]
 # tidy-alphabetical-start
 libc = "0.2"
index 10e1b1987194af5c1382a5ea2f27e5d2961945cc..1c7008765a4faa2a4ec5830590390a999c573462 100644 (file)
@@ -44,12 +44,6 @@ tracing = { version = "0.1.35" }
 libc = "0.2"
 # tidy-alphabetical-end
 
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.61.0"
-features = [
-    "Win32_System_Diagnostics_Debug",
-]
-
 [target.'cfg(not(target_family = "wasm"))'.dependencies]
 # tidy-alphabetical-start
 ctrlc = "3.4.4"
index a81fc496c8288603d0ff56f3f8cdbe94ba491ad0..9fee5e6b99e3b3d375e13e7a6217a46ee47c67df 100644 (file)
@@ -25,11 +25,3 @@ serde_json = "1.0.59"
 termize = "0.2"
 tracing = "0.1"
 # tidy-alphabetical-end
-
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.61.0"
-features = [
-    "Win32_Foundation",
-    "Win32_Security",
-    "Win32_System_Threading",
-]
index d66e04f581069d646b5fa177cd7b9c4a67ee1de8..91b2da9d49ed8b65ca03a3aed5c28a7664333168 100644 (file)
@@ -28,10 +28,3 @@ tracing = "0.1"
 # tidy-alphabetical-start
 libc = "0.2"
 # tidy-alphabetical-end
-
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.61.0"
-features = [
-    "Win32_Foundation",
-    "Win32_System_LibraryLoader",
-]
index 1a32f286f3923e824add64ad939b014b4bbe6e20..1aa7d0a3b505d5d00022e446b1dada92614ed48b 100644 (file)
@@ -38,9 +38,6 @@ cpp_demangle = { default-features = false, version = "0.5.0", optional = true, f
   "alloc",
 ] }
 
-[target.'cfg(any(windows, target_os = "cygwin"))'.dependencies]
-windows-link = "0.2"
-
 [target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
 miniz_oxide = { version = "0.8", default-features = false }
 ruzstd = { version = "0.8.1", default-features = false, optional = true }
index 2a6bca47c10d54bc765cc783fa9e450f26b8a9b0..c8038ba2255eba95fc2ec6406904e353beaa43b0 100644 (file)
@@ -27,9 +27,6 @@ default-features = false
 optional = true
 features = ['read_core', 'elf', 'macho', 'pe', 'xcoff', 'unaligned', 'archive']
 
-[target.'cfg(any(windows, target_os = "cygwin"))'.dependencies]
-windows-link = "0.2"
-
 [features]
 default = ['backtrace']
 backtrace = ['addr2line', 'miniz_oxide', 'object', 'ruzstd']
index 0019e9e6d92e2e0743367682f695d53b90a1b6f8..b1ebe75c54764988a57d66f6fbe2dae3b68544d8 100644 (file)
@@ -66,21 +66,6 @@ tracing-chrome = { version = "0.7", optional = true }
 tracing-subscriber = { version = "0.3", optional = true, features = ["env-filter", "fmt", "registry", "std"] }
 tempfile = { version = "3.15.0", optional = true }
 
-[target.'cfg(windows)'.dependencies.junction]
-version = "1.3.0"
-
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.61"
-features = [
-    "Win32_Foundation",
-    "Win32_Security",
-    "Win32_System_Diagnostics_Debug",
-    "Win32_System_JobObjects",
-    "Win32_System_ProcessStatus",
-    "Win32_System_Threading",
-    "Win32_System_Time",
-]
-
 [dev-dependencies]
 pretty_assertions = "1.4"
 tempfile = "3.15.0"
index 08f690922018710b34049ec072228c09199534cc..a1e3d26d6fa397a58259cb53452768baca2e3742 100644 (file)
@@ -2,7 +2,9 @@
 resolver = "2"
 members = [
   "crates/*",
-  "credential/*",
+  "credential/cargo-credential",
+  "credential/cargo-credential-1password",
+  "credential/cargo-credential-libsecret",
   "benches/benchsuite",
   "benches/capture",
 ]
@@ -27,8 +29,6 @@ build-rs = { version = "0.3.4", path = "crates/build-rs" }
 cargo = { path = "" }
 cargo-credential = { version = "0.4.10", path = "credential/cargo-credential" }
 cargo-credential-libsecret = { version = "0.5.6", path = "credential/cargo-credential-libsecret" }
-cargo-credential-macos-keychain = { version = "0.4.21", path = "credential/cargo-credential-macos-keychain" }
-cargo-credential-wincred = { version = "0.4.21", path = "credential/cargo-credential-wincred" }
 cargo-platform = { path = "crates/cargo-platform", version = "0.3.3" }
 cargo-test-macro = { version = "0.4.10", path = "crates/cargo-test-macro" }
 cargo-test-support = { version = "0.11.0", path = "crates/cargo-test-support" }
@@ -116,7 +116,6 @@ unicode-width = "0.2.2"
 url = "2.5.7"
 varisat = "0.2.2"
 walkdir = "2.5.0"
-windows-sys = "0.61"
 winnow = "0.7.14"
 
 [workspace.lints.rust]
@@ -159,6 +158,7 @@ anyhow.workspace = true
 base64.workspace = true
 blake3.workspace = true
 cargo-credential.workspace = true
+cargo-credential-libsecret.workspace = true
 cargo-platform.workspace = true
 cargo-util-schemas.workspace = true
 cargo-util.workspace = true
@@ -231,27 +231,9 @@ libc.workspace = true
 [target.'cfg(target_os = "linux")'.dependencies]
 cargo-credential-libsecret.workspace = true
 
-[target.'cfg(target_os = "macos")'.dependencies]
-cargo-credential-macos-keychain.workspace = true
-
 [target.'cfg(not(windows))'.dependencies]
 openssl = { workspace = true, optional = true }
 
-[target.'cfg(windows)'.dependencies]
-cargo-credential-wincred.workspace = true
-
-[target.'cfg(windows)'.dependencies.windows-sys]
-workspace = true
-features = [
-  "Win32_Foundation",
-  "Win32_Security",
-  "Win32_Storage_FileSystem",
-  "Win32_System_IO",
-  "Win32_System_Console",
-  "Win32_System_JobObjects",
-  "Win32_System_Threading",
-]
-
 [dev-dependencies]
 annotate-snippets = { workspace = true, features = ["testing-colors"] }
 cargo-test-support.workspace = true
index a4ab5659afdac5da7d246642214065e1b24f57f7..89f1b1a89b45830bff7d2a8fd67106a57cdb4715 100644 (file)
@@ -30,8 +30,5 @@ toml = { workspace = true, features = ["display", "serde"] }
 url.workspace = true
 walkdir.workspace = true
 
-[target.'cfg(windows)'.dependencies]
-windows-sys = { workspace = true, features = ["Win32_Storage_FileSystem"] }
-
 [lints]
 workspace = true
index 4f1c46592346ceb943801e2119e5ca5d0d62c8e9..cdb68ae2b0b7f37ac0848aa530396d67af9c7f45 100644 (file)
@@ -20,15 +20,8 @@ tempfile.workspace = true
 tracing.workspace = true
 walkdir.workspace = true
 
-[target.'cfg(target_os = "macos")'.dependencies]
-core-foundation.workspace = true
-
 [target.'cfg(unix)'.dependencies]
 libc.workspace = true
 
-[target.'cfg(windows)'.dependencies]
-miow.workspace = true
-windows-sys = { workspace = true, features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_Console"] }
-
 [lints]
 workspace = true
index 678b3165b878eb3f62aac2c2adf682a31fe1d883..11e22a762975b08d984bee1122f72188123ce224 100644 (file)
@@ -16,8 +16,5 @@ license.workspace = true
 repository.workspace = true
 description = "Shared definitions of home directories."
 
-[target.'cfg(windows)'.dependencies]
-windows-sys = { workspace = true, features = ["Win32_Foundation", "Win32_UI_Shell", "Win32_System_Com"] }
-
 [lints]
 workspace = true
index 4bf946af05771259ca5c42b716e307a1931731d8..a9d3857ac39a2bf055a6d64ce76d12745bf1c972 100644 (file)
@@ -17,9 +17,6 @@ time.workspace = true
 [target.'cfg(unix)'.dependencies]
 libc.workspace = true
 
-[target.'cfg(windows)'.dependencies]
-windows-sys = { workspace = true, features = ["Win32_System_Console", "Win32_Foundation"] }
-
 [dev-dependencies]
 snapbox = { workspace = true, features = ["examples"] }
 
index fc8179d8d8b665c11b9fb767025b4254c6a6ba5c..501dfc0fb98ce0f4a19705c74aec1b148579daa2 100644 (file)
@@ -564,10 +564,6 @@ fn credential_action(
             }
             "cargo:paseto" => bail!("cargo:paseto requires -Zasymmetric-token"),
             "cargo:token-from-stdout" => Box::new(BasicProcessCredential {}),
-            #[cfg(windows)]
-            "cargo:wincred" => Box::new(cargo_credential_wincred::WindowsCredential {}),
-            #[cfg(target_os = "macos")]
-            "cargo:macos-keychain" => Box::new(cargo_credential_macos_keychain::MacKeychain {}),
             #[cfg(target_os = "linux")]
             "cargo:libsecret" => Box::new(get_credential_libsecret()?),
             name if BUILT_IN_PROVIDERS.contains(&name) => {
index c7c23d338e5b6a9a70ad810ff93883dc6394e64f..59948cd6d517dcfd1fb4986e51df0473faf50270 100644 (file)
@@ -39,13 +39,3 @@ walkdir = "2"
 
 [target.'cfg(unix)'.dependencies]
 libc = "0.2"
-
-[target.'cfg(windows)'.dependencies]
-miow = "0.6"
-
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.61.0"
-features = [
-    "Win32_Foundation",
-    "Win32_System_Diagnostics_Debug",
-]
index f60282f2705a9b6299e020538eb52580a2d2850c..67fe97e2f207b11d58c8dc01f29dde9ffb2b264c 100644 (file)
@@ -21,12 +21,6 @@ perf-event = "=0.4.7"
 [target.'cfg(all(target_os = "linux", target_env = "gnu"))'.dependencies]
 libc.workspace = true
 
-[target.'cfg(windows)'.dependencies]
-windows-sys = { version = "0.60", features = [
-    "Win32_System_Threading",
-    "Win32_System_ProcessStatus",
-] }
-
 [features]
 cpu_profiler = []
 
index e15bc3048e7348f6083412e65ed7f57e61b05b6d..97601311ca2f5ad81f97d505c6f9a989f2522f8c 100644 (file)
@@ -76,12 +76,6 @@ paths.workspace = true
 
 ra-ap-rustc_type_ir.workspace = true
 
-[target.'cfg(windows)'.dependencies]
-windows-sys = { version = "0.60", features = [
-  "Win32_System_Diagnostics_Debug",
-  "Win32_System_Threading",
-] }
-
 [dev-dependencies]
 expect-test = "1.5.1"
 xshell.workspace = true
index 2c19f00f0822fa639e8132c09006141eeacef169..8468f3c7d766e809f3a97f549a0b108fb677b08d 100644 (file)
@@ -24,10 +24,6 @@ crossbeam-utils = "0.8.21"
 [target.'cfg(unix)'.dependencies]
 libc.workspace = true
 
-[target.'cfg(windows)'.dependencies]
-miow = "0.6.0"
-windows-sys = { version = "0.60", features = ["Win32_Foundation"] }
-
 [features]
 # Uncomment to enable for the whole crate graph
 # default = [ "backtrace" ]
index 021be7aafc5592c898dc400719e4321f2457c61f..64dd8b5a843dcfe374ffcfef504c39fea5c31f86 100644 (file)
@@ -45,10 +45,6 @@ ratatui = "0.29"
 benchlib = { path = "benchlib" }
 database = { path = "../database" }
 
-[target.'cfg(windows)'.dependencies]
-miow = "0.3"
-windows-sys = { version = "0.48.0", features = ["Win32_Foundation"] }
-
 [features]
 # Enable more precise Cachegrind profiles for runtime benchmarks.
 # Requires a recent Valgrind to be installed.
index 38bd630e5d79de6167b00655c7de53dbf384ba3e..6abd17c796caf2ae8ac7c0c2f6e48cb6d841c048 100644 (file)
@@ -33,7 +33,5 @@ version = "0.1.15"
 
 [target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.tempdir]
 version = "0.3"
-[target."cfg(target_os = \"windows\")".dependencies.schannel]
-version = "0.1.7"
 
-[workspace]
\ No newline at end of file
+[workspace]