Skip to content

Commit 6ed23af

Browse files
authored
Merge pull request #9548 from ChrisDryden/wild_compatability
Making wild a windows only dependency and gating unit-prefix
2 parents 6c6def9 + ffa5aa4 commit 6ed23af

File tree

3 files changed

+38
-34
lines changed

3 files changed

+38
-34
lines changed

fuzz/Cargo.lock

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uucore/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ bstr = { workspace = true }
2626
chrono = { workspace = true, optional = true }
2727
clap = { workspace = true }
2828
uucore_procs = { workspace = true }
29-
unit-prefix = { workspace = true }
29+
unit-prefix = { workspace = true, optional = true }
3030
phf = { workspace = true }
3131
dns-lookup = { workspace = true, optional = true }
3232
dunce = { version = "1.0.4", optional = true }
33-
wild = "2.2.1"
3433
glob = { workspace = true, optional = true }
3534
itertools = { workspace = true, optional = true }
3635
jiff = { workspace = true, optional = true, features = [
@@ -105,6 +104,7 @@ tempfile = { workspace = true }
105104
procfs = { workspace = true }
106105

107106
[target.'cfg(target_os = "windows")'.dependencies]
107+
wild = "2.2.1"
108108
winapi-util = { workspace = true, optional = true }
109109
windows-sys = { workspace = true, optional = true, default-features = false, features = [
110110
"Wdk_System_SystemInformation",
@@ -141,6 +141,7 @@ format = [
141141
"parser",
142142
"num-traits",
143143
"quoting-style",
144+
"unit-prefix",
144145
]
145146
i18n-all = ["i18n-collator", "i18n-decimal"]
146147
i18n-common = ["icu_locale"]

src/uucore/src/lib/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,10 @@ pub fn set_utility_is_second_arg() {
323323

324324
// args_os() can be expensive to call, it copies all of argv before iterating.
325325
// So if we want only the first arg or so it's overkill. We cache it.
326+
#[cfg(windows)]
326327
static ARGV: LazyLock<Vec<OsString>> = LazyLock::new(|| wild::args_os().collect());
328+
#[cfg(not(windows))]
329+
static ARGV: LazyLock<Vec<OsString>> = LazyLock::new(|| std::env::args_os().collect());
327330

328331
static UTIL_NAME: LazyLock<String> = LazyLock::new(|| {
329332
let base_index = usize::from(get_utility_is_second_arg());

0 commit comments

Comments
 (0)