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, 27 Jun 2024 12:30:53 +0000 (14:30 +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

17 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
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

index f347a7fb0bb10d046b25f9e6e9ee26eea2fad121..364ee439a47159398cbf70095a62fc548e76cdba 100644 (file)
@@ -51,7 +51,3 @@ libc = "0.2.50"
 version = "0.32.1"
 default-features = false
 features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write", "wasm"]
-
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.52.0"
-features = ["Win32_Globalization"]
index 80b6e72e49ba1aca8522847b5f5941aba491b323..be1f100d3e7a4c9cdbf61c814f3b2ac050997c03 100644 (file)
@@ -32,16 +32,6 @@ tracing = "0.1"
 [dependencies.parking_lot]
 version = "0.12"
 
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.52.0"
-features = [
-    "Win32_Foundation",
-    "Win32_Storage_FileSystem",
-    "Win32_System_IO",
-    "Win32_System_ProcessStatus",
-    "Win32_System_Threading",
-]
-
 [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
 # tidy-alphabetical-start
 memmap2 = "0.2.1"
index a8bba3afb7e70f7fc82a3fccdf23d28ae6b13c66..31f122c351160a202be06a5521ca7c3f4f8cca02 100644 (file)
@@ -59,12 +59,6 @@ tracing = { version = "0.1.35" }
 libc = "0.2"
 # tidy-alphabetical-end
 
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.52.0"
-features = [
-    "Win32_System_Diagnostics_Debug",
-]
-
 [target.'cfg(not(target_family = "wasm"))'.dependencies]
 # tidy-alphabetical-start
 ctrlc = "3.4.4"
index cc114fdcd8c35b026405df4f912afd568f096cf3..d60fa6538525b125b8d32b80f79ce698ccfe1376 100644 (file)
@@ -29,14 +29,6 @@ tracing = "0.1"
 unicode-width = "0.1.4"
 # tidy-alphabetical-end
 
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.52.0"
-features = [
-    "Win32_Foundation",
-    "Win32_Security",
-    "Win32_System_Threading",
-]
-
 [features]
 # tidy-alphabetical-start
 rustc_use_parallel_compiler = ['rustc_error_messages/rustc_use_parallel_compiler']
index 721a9275d018878da1440ffb726fef5bd3602eda..099c79d0aad1c05a0be35e3ce12b5f3ad30b8276 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.52.0"
-features = [
-    "Win32_Foundation",
-    "Win32_System_LibraryLoader",
-]
index 9bd7b63c78e7e29f1ea7e1479002f824d18993ff..acef294be5e22a011365c3828ba43b09b7f8e250 100644 (file)
@@ -49,9 +49,6 @@ version = "0.32.0"
 default-features = false
 features = ['read_core', 'elf', 'macho', 'pe', 'xcoff', 'unaligned', 'archive']
 
-[target.'cfg(windows)'.dependencies]
-winapi = { version = "0.3.9", optional = true }
-
 [build-dependencies]
 # Only needed for Android, but cannot be target dependent
 # https://github.com/rust-lang/cargo/issues/4932
@@ -88,16 +85,6 @@ libbacktrace = []
 libunwind = []
 unix-backtrace = []
 verify-winapi = [
-  'winapi/dbghelp',
-  'winapi/handleapi',
-  'winapi/libloaderapi',
-  'winapi/memoryapi',
-  'winapi/minwindef',
-  'winapi/processthreadsapi',
-  'winapi/synchapi',
-  'winapi/tlhelp32',
-  'winapi/winbase',
-  'winapi/winnt',
 ]
 
 [[example]]
index c7a513d08908a2bcd5d9708a1c607cd54a774caf..3c6bfc59c1c524b876f98363f3d65a015160c48d 100644 (file)
@@ -66,21 +66,6 @@ xz2 = "0.1"
 # Dependencies needed by the build-metrics feature
 sysinfo = { version = "0.30", default-features = false, optional = true }
 
-[target.'cfg(windows)'.dependencies.junction]
-version = "1.0.0"
-
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.52"
-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"
 
index c844fd4a4a88e929950cadb2361f1b6a566fa71a..0a430c4c6c98955e5c7180f2672963227a5cd1b3 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 @@ bytesize = "1.3"
 cargo = { path = "" }
 cargo-credential = { version = "0.4.2", path = "credential/cargo-credential" }
 cargo-credential-libsecret = { version = "0.4.2", path = "credential/cargo-credential-libsecret" }
-cargo-credential-macos-keychain = { version = "0.4.2", path = "credential/cargo-credential-macos-keychain" }
-cargo-credential-wincred = { version = "0.4.2", path = "credential/cargo-credential-wincred" }
 cargo-platform = { path = "crates/cargo-platform", version = "0.1.5" }
 cargo-test-macro = { version = "0.2.0", path = "crates/cargo-test-macro" }
 cargo-test-support = { version = "0.2.0", path = "crates/cargo-test-support" }
@@ -107,7 +107,6 @@ unicode-xid = "0.2.4"
 url = "2.5.0"
 varisat = "0.2.2"
 walkdir = "2.5.0"
-windows-sys = "0.52"
 
 [workspace.lints.rust]
 rust_2018_idioms = "warn" # TODO: could this be removed?
@@ -148,6 +147,7 @@ anyhow.workspace = true
 base64.workspace = true
 bytesize.workspace = true
 cargo-credential.workspace = true
+cargo-credential-libsecret.workspace = true
 cargo-platform.workspace = true
 cargo-util-schemas.workspace = true
 cargo-util.workspace = true
@@ -214,27 +214,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-macro.workspace = true
index fd64a66efc75bac8c06b19883347dcecf958d4d5..3f1d64a24f3f6f24a8799cee9bf9d962c05b3036 100644 (file)
@@ -33,8 +33,5 @@ toml.workspace = true
 url.workspace = true
 walkdir.workspace = true
 
-[target.'cfg(windows)'.dependencies]
-windows-sys = { workspace = true, features = ["Win32_Storage_FileSystem"] }
-
 [lints]
 workspace = true
index 28877eedaf76e2d1f11bf85e776ea87f92657796..e859b494ad2ae8797c6694e91a8f7fc08933937a 100644 (file)
@@ -21,15 +21,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 91742e534b68147c5acf86288a63bf3ea240fe04..0054cadc37cb46f05807348340d46a78e75edd02 100644 (file)
@@ -17,8 +17,5 @@ homepage.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 4ed0d325352591121e21933fcb7192ebb653e8a7..fc2df44790f4aee838b0a086b96ee3c8e8a140ca 100644 (file)
@@ -18,9 +18,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 cf4cccb9753179a44495eefac52a2781db4aac05..c69dd9318c5685c1614551aecfc0fbedd1839ddc 100644 (file)
@@ -529,11 +529,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(cargo_credential_libsecret::LibSecretCredential {}),
             name if BUILT_IN_PROVIDERS.contains(&name) => {
                 Box::new(cargo_credential::UnsupportedCredential {})
index 52beb4c8b3decafd727170ab085f64ccf1bc9da8..50acf5bdb97415d305dfe04ad5f269f6721325e7 100644 (file)
@@ -28,13 +28,3 @@ home = "0.5.5"
 
 [target.'cfg(unix)'.dependencies]
 libc = "0.2"
-
-[target.'cfg(windows)'.dependencies]
-miow = "0.6"
-
-[target.'cfg(windows)'.dependencies.windows]
-version = "0.52.0"
-features = [
-    "Win32_Foundation",
-    "Win32_System_Diagnostics_Debug",
-]
index fe256c5d7cbde0f8efd83513c0ecfc17927a66db..8178a9db411d7d71a6cf39b12db3a32ccb50dc35 100644 (file)
@@ -22,9 +22,6 @@ countme = { version = "3.0.1", features = ["enable"] }
 [target.'cfg(target_os = "linux")'.dependencies]
 perf-event = "=0.4.7"
 
-[target.'cfg(windows)'.dependencies]
-winapi = { version = "0.3.9", features = ["processthreadsapi", "psapi"] }
-
 [features]
 cpu_profiler = []
 
index cd3349899e9584bc139c9a7bbe3f5687e4b58738..5a4a443e7542a680f5cb213252617b789354f9fe 100644 (file)
@@ -68,12 +68,6 @@ vfs-notify.workspace = true
 vfs.workspace = true
 paths.workspace = true
 
-[target.'cfg(windows)'.dependencies]
-winapi = "0.3.9"
-
-[target.'cfg(not(target_env = "msvc"))'.dependencies]
-jemallocator = { version = "0.5.0", package = "tikv-jemallocator", optional = true }
-
 [dev-dependencies]
 expect-test = "1.4.0"
 xshell.workspace = true
index 6cca11633539969a74c1d4713041a0e626d3a403..7e3b4c11965c9630bc5bb04323dd9852f159a5b2 100644 (file)
@@ -20,10 +20,6 @@ crossbeam-channel = "0.5.5"
 itertools.workspace = true
 # Think twice before adding anything here
 
-[target.'cfg(windows)'.dependencies]
-miow = "0.6.0"
-winapi = { version = "0.3.9", features = ["winerror"] }
-
 [features]
 # Uncomment to enable for the whole crate graph
 # default = [ "backtrace" ]