From 4d95d8ace7956dddc5ec88eb24ef5412c2fb0a4f Mon Sep 17 00:00:00 2001 From: Debian Rust Maintainers Date: Mon, 6 May 2024 10:25:32 +0200 Subject: [PATCH] d-0020-remove-windows-dependencies 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 --- compiler/rustc_codegen_ssa/Cargo.toml | 4 --- compiler/rustc_data_structures/Cargo.toml | 10 ------- compiler/rustc_driver_impl/Cargo.toml | 6 ----- compiler/rustc_errors/Cargo.toml | 8 ------ compiler/rustc_session/Cargo.toml | 7 ----- library/backtrace/Cargo.toml | 3 --- library/backtrace/crates/as-if-std/Cargo.toml | 3 --- src/bootstrap/Cargo.toml | 15 ----------- src/tools/cargo/Cargo.toml | 26 +++---------------- .../crates/cargo-test-support/Cargo.toml | 3 --- src/tools/cargo/crates/cargo-util/Cargo.toml | 7 ----- src/tools/cargo/crates/home/Cargo.toml | 3 --- .../credential/cargo-credential/Cargo.toml | 3 --- src/tools/cargo/src/cargo/util/auth/mod.rs | 4 --- src/tools/compiletest/Cargo.toml | 10 ------- .../rust-analyzer/crates/profile/Cargo.toml | 6 ----- .../crates/rust-analyzer/Cargo.toml | 6 ----- .../rust-analyzer/crates/stdx/Cargo.toml | 4 --- src/tools/rustc-perf/collector/Cargo.toml | 4 --- .../native-tls-0.1.5/Cargo.toml | 4 +-- 20 files changed, 5 insertions(+), 131 deletions(-) diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml index 2dfbc58164..cd8327b8ac 100644 --- a/compiler/rustc_codegen_ssa/Cargo.toml +++ b/compiler/rustc_codegen_ssa/Cargo.toml @@ -55,7 +55,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"] diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index c8296e05f6..1cf6522859 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -35,16 +35,6 @@ version = "0.15.2" 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" diff --git a/compiler/rustc_driver_impl/Cargo.toml b/compiler/rustc_driver_impl/Cargo.toml index ae1dbd2cf5..c764853650 100644 --- a/compiler/rustc_driver_impl/Cargo.toml +++ b/compiler/rustc_driver_impl/Cargo.toml @@ -59,12 +59,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" diff --git a/compiler/rustc_errors/Cargo.toml b/compiler/rustc_errors/Cargo.toml index 7912b8e609..bdad327fff 100644 --- a/compiler/rustc_errors/Cargo.toml +++ b/compiler/rustc_errors/Cargo.toml @@ -26,11 +26,3 @@ termcolor = "1.2.0" 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", -] diff --git a/compiler/rustc_session/Cargo.toml b/compiler/rustc_session/Cargo.toml index 60d56b1b80..df8f676f09 100644 --- a/compiler/rustc_session/Cargo.toml +++ b/compiler/rustc_session/Cargo.toml @@ -32,10 +32,3 @@ tracing = "0.1" # tidy-alphabetical-start libc = "=0.2.174" # tidy-alphabetical-end - -[target.'cfg(windows)'.dependencies.windows] -version = "0.61.0" -features = [ - "Win32_Foundation", - "Win32_System_LibraryLoader", -] diff --git a/library/backtrace/Cargo.toml b/library/backtrace/Cargo.toml index 7e1233c924..c6e28db8fc 100644 --- a/library/backtrace/Cargo.toml +++ b/library/backtrace/Cargo.toml @@ -38,9 +38,6 @@ cpp_demangle = { default-features = false, version = "0.4.0", optional = true, f "alloc", ] } -[target.'cfg(any(windows, target_os = "cygwin"))'.dependencies] -windows-targets = "0.52.6" - [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 } diff --git a/library/backtrace/crates/as-if-std/Cargo.toml b/library/backtrace/crates/as-if-std/Cargo.toml index 8d6d6816b8..69b040901b 100644 --- a/library/backtrace/crates/as-if-std/Cargo.toml +++ b/library/backtrace/crates/as-if-std/Cargo.toml @@ -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-targets = "0.52.6" - [features] default = ['backtrace'] backtrace = ['addr2line', 'miniz_oxide', 'object', 'ruzstd'] diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 9a76a7dda2..45eaff8a5c 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -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" diff --git a/src/tools/cargo/Cargo.toml b/src/tools/cargo/Cargo.toml index ab2fe54424..9a1483e167 100644 --- a/src/tools/cargo/Cargo.toml +++ b/src/tools/cargo/Cargo.toml @@ -2,7 +2,9 @@ resolver = "2" members = [ "crates/*", - "credential/*", + "credential/cargo-credential", + "credential/cargo-credential-1password", + "credential/cargo-credential-libsecret", "benches/benchsuite", "benches/capture", ] @@ -28,8 +30,6 @@ build-rs = { version = "0.3.1", path = "crates/build-rs" } cargo = { path = "" } cargo-credential = { version = "0.4.2", path = "credential/cargo-credential" } cargo-credential-libsecret = { version = "0.5.2", path = "credential/cargo-credential-libsecret" } -cargo-credential-macos-keychain = { version = "0.4.17", path = "credential/cargo-credential-macos-keychain" } -cargo-credential-wincred = { version = "0.4.17", path = "credential/cargo-credential-wincred" } cargo-platform = { path = "crates/cargo-platform", version = "0.3.0" } cargo-test-macro = { version = "0.4.6", path = "crates/cargo-test-macro" } cargo-test-support = { version = "0.8.1", path = "crates/cargo-test-support" } @@ -117,7 +117,6 @@ unicode-xid = "0.2.6" url = "2.5.4" varisat = "0.2.2" walkdir = "2.5.0" -windows-sys = "0.60" winnow = "0.7.13" [workspace.lints.rust] @@ -160,6 +159,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 @@ -232,27 +232,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 diff --git a/src/tools/cargo/crates/cargo-test-support/Cargo.toml b/src/tools/cargo/crates/cargo-test-support/Cargo.toml index b799055464..045c2360cc 100644 --- a/src/tools/cargo/crates/cargo-test-support/Cargo.toml +++ b/src/tools/cargo/crates/cargo-test-support/Cargo.toml @@ -31,8 +31,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 diff --git a/src/tools/cargo/crates/cargo-util/Cargo.toml b/src/tools/cargo/crates/cargo-util/Cargo.toml index 6c3f05a6ea..155eab1ebf 100644 --- a/src/tools/cargo/crates/cargo-util/Cargo.toml +++ b/src/tools/cargo/crates/cargo-util/Cargo.toml @@ -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 diff --git a/src/tools/cargo/crates/home/Cargo.toml b/src/tools/cargo/crates/home/Cargo.toml index 747316f16e..5a313a9d8c 100644 --- a/src/tools/cargo/crates/home/Cargo.toml +++ b/src/tools/cargo/crates/home/Cargo.toml @@ -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 diff --git a/src/tools/cargo/credential/cargo-credential/Cargo.toml b/src/tools/cargo/credential/cargo-credential/Cargo.toml index 585a7a5c3d..1f4d360edd 100644 --- a/src/tools/cargo/credential/cargo-credential/Cargo.toml +++ b/src/tools/cargo/credential/cargo-credential/Cargo.toml @@ -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"] } diff --git a/src/tools/cargo/src/cargo/util/auth/mod.rs b/src/tools/cargo/src/cargo/util/auth/mod.rs index fc8179d8d8..501dfc0fb9 100644 --- a/src/tools/cargo/src/cargo/util/auth/mod.rs +++ b/src/tools/cargo/src/cargo/util/auth/mod.rs @@ -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) => { diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml index cdada5a223..f24ffa1af5 100644 --- a/src/tools/compiletest/Cargo.toml +++ b/src/tools/compiletest/Cargo.toml @@ -36,13 +36,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", -] diff --git a/src/tools/rust-analyzer/crates/profile/Cargo.toml b/src/tools/rust-analyzer/crates/profile/Cargo.toml index f60282f270..67fe97e2f2 100644 --- a/src/tools/rust-analyzer/crates/profile/Cargo.toml +++ b/src/tools/rust-analyzer/crates/profile/Cargo.toml @@ -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 = [] diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml b/src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml index 4fa3c89a7e..9cc6de6c87 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml +++ b/src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml @@ -74,12 +74,6 @@ vfs-notify.workspace = true vfs.workspace = true paths.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 diff --git a/src/tools/rust-analyzer/crates/stdx/Cargo.toml b/src/tools/rust-analyzer/crates/stdx/Cargo.toml index 2c19f00f08..8468f3c7d7 100644 --- a/src/tools/rust-analyzer/crates/stdx/Cargo.toml +++ b/src/tools/rust-analyzer/crates/stdx/Cargo.toml @@ -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" ] diff --git a/src/tools/rustc-perf/collector/Cargo.toml b/src/tools/rustc-perf/collector/Cargo.toml index f43a71e3d1..82b8ccc67d 100644 --- a/src/tools/rustc-perf/collector/Cargo.toml +++ b/src/tools/rustc-perf/collector/Cargo.toml @@ -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. diff --git a/src/tools/rustc-perf/collector/compile-benchmarks/tokio-webpush-simple/native-tls-0.1.5/Cargo.toml b/src/tools/rustc-perf/collector/compile-benchmarks/tokio-webpush-simple/native-tls-0.1.5/Cargo.toml index 38bd630e5d..6abd17c796 100644 --- a/src/tools/rustc-perf/collector/compile-benchmarks/tokio-webpush-simple/native-tls-0.1.5/Cargo.toml +++ b/src/tools/rustc-perf/collector/compile-benchmarks/tokio-webpush-simple/native-tls-0.1.5/Cargo.toml @@ -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] -- 2.30.2