Skip to content

Commit fbfc951

Browse files
authored
Merge branch 'main' into base64_performance
2 parents 3b6f3ff + a4701f4 commit fbfc951

File tree

57 files changed

+1777
-592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1777
-592
lines changed

.github/workflows/CICD.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,14 +502,14 @@ jobs:
502502
--arg multisize "$SIZE_MULTI" \
503503
'{($date): { sha: $sha, size: $size, multisize: $multisize, }}' > size-result.json
504504
- name: Download the previous individual size result
505-
uses: dawidd6/action-download-artifact@v11
505+
uses: dawidd6/action-download-artifact@v12
506506
with:
507507
workflow: CICD.yml
508508
name: individual-size-result
509509
repo: uutils/coreutils
510510
path: dl
511511
- name: Download the previous size result
512-
uses: dawidd6/action-download-artifact@v11
512+
uses: dawidd6/action-download-artifact@v12
513513
with:
514514
workflow: CICD.yml
515515
name: size-result

.github/workflows/GnuTests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
sudo locale-gen --keep-existing fa_IR.UTF-8 # Iran
9292
sudo locale-gen --keep-existing am_ET.UTF-8 # Ethiopia
9393
sudo locale-gen --keep-existing th_TH.UTF-8 # Thailand
94+
sudo locale-gen --keep-existing zh_CN.GB18030 # China
9495
9596
sudo update-locale
9697
echo "After:"
@@ -343,7 +344,7 @@ jobs:
343344
path: 'uutils'
344345
persist-credentials: false
345346
- name: Retrieve reference artifacts
346-
uses: dawidd6/action-download-artifact@v11
347+
uses: dawidd6/action-download-artifact@v12
347348
# ref: <https://github.com/dawidd6/action-download-artifact>
348349
continue-on-error: true ## don't break the build for missing reference artifacts (may be expired or just not generated yet)
349350
with:

.github/workflows/fuzzing.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ jobs:
7979
matrix:
8080
test-target:
8181
- { name: fuzz_test, should_pass: true }
82-
# https://github.com/uutils/coreutils/issues/5311
83-
- { name: fuzz_date, should_pass: false }
82+
- { name: fuzz_date, should_pass: true }
8483
- { name: fuzz_expr, should_pass: true }
8584
- { name: fuzz_printf, should_pass: true }
8685
- { name: fuzz_echo, should_pass: true }

Cargo.lock

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

GNUmakefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ TOYBOX_SRC := $(TOYBOX_ROOT)/toybox-$(TOYBOX_VER)
6262

6363
#------------------------------------------------------------------------
6464
# Detect the host system.
65-
# On Windows the environment already sets OS = Windows_NT.
65+
# On Windows uname -s might return MINGW_NT-* or CYGWIN_NT-*.
6666
# Otherwise let it default to the kernel name returned by uname -s
6767
# (Linux, Darwin, FreeBSD, …).
6868
#------------------------------------------------------------------------
69-
OS ?= $(shell uname -s)
69+
OS := $(shell uname -s)
7070

7171
# Windows does not allow symlink by default.
7272
# Allow to override LN for AppArmor.
73-
ifeq ($(OS),Windows_NT)
73+
ifneq (,$(findstring _NT,$(OS)))
7474
LN ?= ln -f
7575
endif
7676
LN ?= ln -sf
@@ -195,7 +195,7 @@ HASHSUM_PROGS := \
195195

196196
$(info Detected OS = $(OS))
197197

198-
ifneq ($(OS),Windows_NT)
198+
ifeq (,$(findstring MINGW,$(OS)))
199199
PROGS += $(UNIX_PROGS)
200200
endif
201201
ifeq ($(SELINUX_ENABLED),1)
@@ -450,8 +450,12 @@ install: build install-manpages install-completions install-locales
450450
mkdir -p $(INSTALLDIR_BIN)
451451
ifneq (,$(and $(findstring stdbuf,$(UTILS)),$(findstring feat_external_libstdbuf,$(CARGOFLAGS))))
452452
mkdir -p $(DESTDIR)$(LIBSTDBUF_DIR)
453+
ifneq (,$(findstring CYGWIN,$(OS)))
454+
$(INSTALL) -m 755 $(BUILDDIR)/deps/stdbuf.dll $(DESTDIR)$(LIBSTDBUF_DIR)/libstdbuf.dll
455+
else
453456
$(INSTALL) -m 755 $(BUILDDIR)/deps/libstdbuf.* $(DESTDIR)$(LIBSTDBUF_DIR)/
454457
endif
458+
endif
455459
ifeq (${MULTICALL}, y)
456460
$(INSTALL) -m 755 $(BUILDDIR)/coreutils $(INSTALLDIR_BIN)/$(PROG_PREFIX)coreutils
457461
$(foreach prog, $(filter-out coreutils, $(INSTALLEES)), \
@@ -472,7 +476,7 @@ else
472476
endif
473477

474478
uninstall:
475-
ifneq ($(OS),Windows_NT)
479+
ifeq (,$(findstring MINGW,$(OS)))
476480
rm -f $(DESTDIR)$(LIBSTDBUF_DIR)/libstdbuf.*
477481
-rm -d $(DESTDIR)$(LIBSTDBUF_DIR) 2>/dev/null || true
478482
endif

fuzz/Cargo.lock

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

fuzz/fuzz_targets/fuzz_date.rs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,38 @@ use libfuzzer_sys::fuzz_target;
33

44
use std::ffi::OsString;
55
use uu_date::uumain;
6+
use uufuzz::generate_and_run_uumain;
67

78
fuzz_target!(|data: &[u8]| {
89
let delim: u8 = 0; // Null byte
9-
let args = data
10+
let fuzz_args: Vec<OsString> = data
1011
.split(|b| *b == delim)
1112
.filter_map(|e| std::str::from_utf8(e).ok())
12-
.map(OsString::from);
13-
uumain(args);
13+
.map(OsString::from)
14+
.collect();
15+
16+
// Skip test cases that would cause the program to read from stdin
17+
// These would hang the fuzzer waiting for input
18+
for i in 0..fuzz_args.len() {
19+
if let Some(arg) = fuzz_args.get(i) {
20+
let arg_str = arg.to_string_lossy();
21+
// Skip if -f- or --file=- (reads dates from stdin)
22+
if (arg_str == "-f"
23+
&& fuzz_args
24+
.get(i + 1)
25+
.map(|a| a.to_string_lossy() == "-")
26+
.unwrap_or(false))
27+
|| arg_str == "-f-"
28+
|| arg_str == "--file=-"
29+
{
30+
return;
31+
}
32+
}
33+
}
34+
35+
// Add program name as first argument (required for proper argument parsing)
36+
let mut args = vec![OsString::from("date")];
37+
args.extend(fuzz_args);
38+
39+
let _ = generate_and_run_uumain(&args, uumain, None);
1440
});

src/uu/chroot/src/chroot.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,12 @@ fn supplemental_gids(uid: libc::uid_t) -> Vec<libc::gid_t> {
319319

320320
/// Set the supplemental group IDs for this process.
321321
fn set_supplemental_gids(gids: &[libc::gid_t]) -> std::io::Result<()> {
322-
#[cfg(any(target_vendor = "apple", target_os = "freebsd", target_os = "openbsd"))]
322+
#[cfg(any(
323+
target_vendor = "apple",
324+
target_os = "freebsd",
325+
target_os = "openbsd",
326+
target_os = "cygwin"
327+
))]
323328
let n = gids.len() as libc::c_int;
324329
#[cfg(any(target_os = "linux", target_os = "android"))]
325330
let n = gids.len() as libc::size_t;

src/uu/cksum/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ uucore = { workspace = true, features = [
2525
"sum",
2626
"hardware",
2727
] }
28-
hex = { workspace = true }
2928
fluent = { workspace = true }
3029

3130
[dev-dependencies]

0 commit comments

Comments
 (0)