Skip to content

Commit 86a8a74

Browse files
authored
Merge branch 'main' into fix/issue-11315
2 parents b475775 + e104fc8 commit 86a8a74

16 files changed

Lines changed: 211 additions & 60 deletions

File tree

.github/workflows/CICD.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
# for now, don't build it on mac & windows because the doc is only published from linux
103103
# + it needs a bunch of duplication for build
104104
# and I don't want to add a doc step in the regular build to avoid long builds
105-
# - { os: macos-latest , features: feat_os_macos }
105+
# - { os: macos-latest , features: feat_os_unix }
106106
# - { os: windows-latest , features: feat_os_windows }
107107
steps:
108108
- uses: actions/checkout@v6
@@ -277,7 +277,7 @@ jobs:
277277
matrix:
278278
job:
279279
- { os: ubuntu-latest , features: feat_os_unix }
280-
- { os: macos-latest , features: feat_os_macos }
280+
- { os: macos-latest , features: feat_os_unix }
281281
- { os: windows-latest , features: feat_os_windows }
282282
steps:
283283
- uses: actions/checkout@v6
@@ -320,7 +320,7 @@ jobs:
320320
matrix:
321321
job:
322322
- { os: ubuntu-latest , features: feat_os_unix }
323-
- { os: macos-latest , features: feat_os_macos }
323+
- { os: macos-latest , features: feat_os_unix }
324324
- { os: windows-latest , features: feat_os_windows }
325325
steps:
326326
- uses: actions/checkout@v6
@@ -381,10 +381,10 @@ jobs:
381381
- { os: ubuntu-latest , target: x86_64-unknown-netbsd, features: "feat_os_unix", use-cross: use-cross , skip-tests: true , check-only: true }
382382
- { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true , check-only: true }
383383
- { os: ubuntu-latest , target: wasm32-wasip1, default-features: false, features: feat_wasm, skip-tests: true }
384-
- { os: macos-latest , target: aarch64-apple-darwin , features: feat_os_macos, workspace-tests: true } # M1 CPU
384+
- { os: macos-latest , target: aarch64-apple-darwin , features: feat_os_unix, workspace-tests: true } # M1 CPU
385385
# PR #7964: chcon should not break build without the feature. cargo check is enough to detect it.
386386
- { os: macos-latest , target: aarch64-apple-darwin , workspace-tests: true, check-only: true } # M1 CPU
387-
- { os: macos-latest , target: x86_64-apple-darwin , features: feat_os_macos, workspace-tests: true }
387+
- { os: macos-latest , target: x86_64-apple-darwin , features: feat_os_unix, workspace-tests: true }
388388
- { os: windows-latest , target: i686-pc-windows-msvc , features: feat_os_windows }
389389
- { os: windows-latest , target: x86_64-pc-windows-gnu , features: feat_os_windows }
390390
- { os: windows-latest , target: x86_64-pc-windows-msvc , features: feat_os_windows }
@@ -870,7 +870,7 @@ jobs:
870870
fail-fast: false
871871
matrix:
872872
job:
873-
- { os: macos-latest , features: feat_os_macos }
873+
- { os: macos-latest , features: feat_os_unix }
874874
- { os: windows-latest , features: feat_os_windows }
875875

876876
steps:

.github/workflows/code-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
matrix:
7373
job:
7474
- { os: ubuntu-latest , features: all , workspace: true }
75-
- { os: macos-latest , features: feat_os_macos }
75+
- { os: macos-latest , features: feat_os_unix }
7676
- { os: windows-latest , features: feat_os_windows }
7777
steps:
7878
- uses: actions/checkout@v6

.github/workflows/l10n.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
matrix:
3232
job:
3333
- { os: ubuntu-latest , features: "feat_os_unix" }
34-
- { os: macos-latest , features: "feat_os_macos" }
34+
- { os: macos-latest , features: "feat_os_unix" }
3535
- { os: windows-latest , features: "feat_os_windows" }
3636
steps:
3737
- uses: actions/checkout@v6
@@ -397,7 +397,7 @@ jobs:
397397
matrix:
398398
job:
399399
- { os: ubuntu-latest , features: "feat_os_unix" }
400-
- { os: macos-latest , features: "feat_os_macos" }
400+
- { os: macos-latest , features: "feat_os_unix" }
401401
steps:
402402
- uses: actions/checkout@v6
403403
with:
@@ -550,7 +550,7 @@ jobs:
550550
matrix:
551551
job:
552552
- { os: ubuntu-latest , features: "feat_os_unix" }
553-
- { os: macos-latest , features: "feat_os_macos" }
553+
- { os: macos-latest , features: "feat_os_unix" }
554554
steps:
555555
- uses: actions/checkout@v6
556556
with:

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ all-features = true
2323
[features]
2424
default = ["feat_common_core"]
2525
## OS feature shortcodes
26-
macos = ["feat_os_macos"]
2726
unix = ["feat_os_unix"]
2827
windows = ["feat_os_windows"]
2928
## project-specific feature shortcodes
@@ -230,10 +229,6 @@ feat_wasm = [
230229
"arch",
231230
"uname",
232231
]
233-
# "feat_os_macos" == set of utilities which can be built/run on the MacOS platform
234-
feat_os_macos = [
235-
"feat_os_unix", ## == a modern/usual *nix platform
236-
]
237232
# "feat_os_unix" == set of utilities which can be built/run on modern/usual *nix platforms.
238233
feat_os_unix = [
239234
"feat_Tier1",

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ sets of uutils for a platform (on that platform) is as simple as specifying it
111111
as a feature:
112112

113113
```shell
114-
cargo build --release --features macos
115-
# or ...
116114
cargo build --release --features windows
117115
# or ...
118116
cargo build --release --features unix

docs/src/installation.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ You can also [build uutils from source](build.md).
1515
[![crates.io package](https://repology.org/badge/version-for-repo/crates_io/uutils-coreutils.svg)](https://crates.io/crates/coreutils)
1616

1717
```shell
18-
# Linux
18+
# Unix like
1919
cargo install coreutils --features unix --locked
20-
# MacOs
21-
cargo install coreutils --features macos --locked
2220
# Windows
2321
cargo install coreutils --features windows --locked
2422
```

src/uu/head/src/take.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ impl TakeAllLinesBuffer {
163163
reader: &mut impl Read,
164164
separator: u8,
165165
) -> std::io::Result<BytesAndLines> {
166+
self.partial_line = false;
166167
let bytes_read = self.inner.fill_buffer(reader)?;
167168
// Count the number of lines...
168169
self.terminated_lines = memchr_iter(separator, self.inner.remaining_buffer()).count();

src/uu/hostname/src/hostname.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ mod wsa {
3838
pub(super) struct WsaHandle(());
3939

4040
pub(super) fn start() -> io::Result<WsaHandle> {
41-
let err = unsafe {
42-
let mut data = std::mem::MaybeUninit::<WSADATA>::uninit();
43-
WSAStartup(0x0202, data.as_mut_ptr())
44-
};
41+
let mut data = std::mem::MaybeUninit::<WSADATA>::uninit();
42+
let err = unsafe { WSAStartup(0x0202, data.as_mut_ptr()) };
4543
if err == 0 {
4644
Ok(WsaHandle(()))
4745
} else {
@@ -51,10 +49,8 @@ mod wsa {
5149

5250
impl Drop for WsaHandle {
5351
fn drop(&mut self) {
54-
unsafe {
55-
// This possibly returns an error but we can't handle it
56-
let _err = WSACleanup();
57-
}
52+
// This possibly returns an error but we can't handle it
53+
let _ = unsafe { WSACleanup() };
5854
}
5955
}
6056
}

src/uu/who/src/platform/unix.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,14 @@ fn time_string(ut: &UtmpxRecord) -> String {
179179

180180
#[inline]
181181
fn current_tty() -> String {
182-
unsafe {
183-
let res = ttyname(STDIN_FILENO);
184-
if res.is_null() {
185-
String::new()
186-
} else {
187-
CStr::from_ptr(res.cast_const())
188-
.to_string_lossy()
189-
.trim_start_matches("/dev/")
190-
.to_owned()
191-
}
182+
let p = unsafe { ttyname(STDIN_FILENO) };
183+
if p.is_null() {
184+
String::new()
185+
} else {
186+
unsafe { CStr::from_ptr(p) }
187+
.to_string_lossy()
188+
.trim_start_matches("/dev/")
189+
.to_owned()
192190
}
193191
}
194192

src/uu/yes/Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ path = "src/yes.rs"
2222
clap = { workspace = true }
2323
itertools = { workspace = true }
2424
fluent = { workspace = true }
25-
26-
[target.'cfg(unix)'.dependencies]
27-
uucore = { workspace = true, features = ["pipes", "signals"] }
28-
29-
[target.'cfg(not(unix))'.dependencies]
30-
uucore = { workspace = true, features = ["pipes"] }
25+
uucore = { workspace = true }
3126

3227
[[bin]]
3328
name = "yes"

0 commit comments

Comments
 (0)