Skip to content

Commit 4f1c15b

Browse files
authored
Merge branch 'main' into renovate/ctrlc-3.x-lockfile
2 parents 08e09ea + 2d718f2 commit 4f1c15b

File tree

198 files changed

+7039
-1682
lines changed

Some content is hidden

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

198 files changed

+7039
-1682
lines changed

.busybox-config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ CONFIG_FEATURE_FANCY_HEAD=y
22
CONFIG_UNICODE_SUPPORT=y
33
CONFIG_DESKTOP=y
44
CONFIG_LONG_OPTS=y
5+
CONFIG_FEATURE_SORT_BIG=y
6+
CONFIG_FEATURE_CATV=y
7+
CONFIG_FEATURE_CATN=y
8+
CONFIG_FEATURE_TR_CLASSES=y
9+
CONFIG_FEATURE_READLINK_FOLLOW=y

.github/workflows/CICD.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -300,22 +300,22 @@ jobs:
300300
run: make nextest PROFILE=ci CARGOFLAGS="--hide-progress-bar"
301301
env:
302302
RUST_BACKTRACE: "1"
303-
304-
- name: "`make install PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n`"
303+
- name: "`make install PROG_PREFIX=uu- PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n`"
305304
shell: bash
306305
run: |
307306
set -x
308-
DESTDIR=/tmp/ make PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n install
307+
DESTDIR=/tmp/ make install PROG_PREFIX=uu- PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n
309308
# Check that utils are built with given profile
310309
./target/release-fast/true
311-
# Check that the utils are present
312-
test -f /tmp/usr/local/bin/tty
310+
# Check that the progs have prefix
311+
test -f /tmp/usr/local/bin/uu-tty
312+
test -f /tmp/usr/local/libexec/uu-coreutils/libstdbuf.*
313313
# Check that the manpage is not present
314-
! test -f /tmp/usr/local/share/man/man1/whoami.1
314+
! test -f /tmp/usr/local/share/man/man1/uu-whoami.1
315315
# Check that the completion is not present
316-
! test -f /tmp/usr/local/share/zsh/site-functions/_install
317-
! test -f /tmp/usr/local/share/bash-completion/completions/head.bash
318-
! test -f /tmp/usr/local/share/fish/vendor_completions.d/cat.fish
316+
! test -f /tmp/usr/local/share/zsh/site-functions/_uu-install
317+
! test -f /tmp/usr/local/share/bash-completion/completions/uu-head.bash
318+
! test -f /tmp/usr/local/share/fish/vendor_completions.d/uu-cat.fish
319319
env:
320320
RUST_BACKTRACE: "1"
321321
- name: "`make install`"
@@ -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: 81 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ name: GnuTests
22

33
# spell-checker:ignore (abbrev/names) CodeCov gnulib GnuTests Swatinem
44
# spell-checker:ignore (jargon) submodules devel
5-
# spell-checker:ignore (libs/utils) autopoint chksum getenforce gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e
5+
# spell-checker:ignore (libs/utils) autopoint chksum dpkg getenforce getlimits gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e zstd cpio
66
# spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic
77
# spell-checker:ignore (people) Dawid Dziurla * dawidd dtolnay
88
# spell-checker:ignore (vars) FILESET SUBDIRS XPASS
9+
# spell-checker:ignore userns
910

1011
# * note: to run a single test => `REPO/util/run-gnu-test.sh PATH/TO/TEST/SCRIPT`
1112

@@ -30,6 +31,7 @@ env:
3031
TEST_STTY_FULL_SUMMARY_FILE: 'gnu-stty-full-result.json'
3132
TEST_SELINUX_FULL_SUMMARY_FILE: 'selinux-gnu-full-result.json'
3233
TEST_SELINUX_ROOT_FULL_SUMMARY_FILE: 'selinux-root-gnu-full-result.json'
34+
TEST_SMACK_FULL_SUMMARY_FILE: 'smack-gnu-full-result.json'
3335

3436
jobs:
3537
native:
@@ -42,16 +44,6 @@ jobs:
4244
with:
4345
path: 'uutils'
4446
persist-credentials: false
45-
- name: Extract GNU version from build-gnu.sh
46-
id: gnu-version
47-
run: |
48-
GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
49-
if [ -z "$GNU_VERSION" ]; then
50-
echo "Error: Failed to extract GNU version from build-gnu.sh"
51-
exit 1
52-
fi
53-
echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
54-
echo "Extracted GNU version: ${GNU_VERSION}"
5547
- uses: dtolnay/rust-toolchain@master
5648
with:
5749
toolchain: stable
@@ -60,20 +52,15 @@ jobs:
6052
with:
6153
workspaces: "./uutils -> target"
6254
- name: Checkout code (GNU coreutils)
63-
uses: actions/checkout@v6
55+
run: (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
56+
- name: Restore files for faster configure and skipping make
57+
uses: actions/cache@v5
58+
id: cache-config-gnu
6459
with:
65-
repository: 'coreutils/coreutils'
66-
path: 'gnu'
67-
ref: ${{ env.REPO_GNU_REF }}
68-
submodules: false
69-
persist-credentials: false
70-
- name: Override submodule URL and initialize submodules
71-
# Use github instead of upstream git server
72-
run: |
73-
git submodule sync --recursive
74-
git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
75-
git submodule update --init --recursive --depth 1
76-
working-directory: gnu
60+
path: |
61+
gnu/config.cache
62+
gnu/src/getlimits
63+
key: ${{ runner.os }}-gnu-config-${{ hashFiles('gnu/NEWS') }}-${{ hashFiles('uutils/util/build-gnu.sh') }} # use build-gnu.sh for extremely safe caching
7764

7865
#### Build environment setup
7966
- name: Install dependencies
@@ -83,6 +70,8 @@ jobs:
8370
sudo apt-get update
8471
## Check that build-gnu.sh works on the non SELinux system by installing libselinux only on lima
8572
sudo apt-get install -y autopoint gperf gdb python3-pyinotify valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev attr quilt
73+
curl http://launchpadlibrarian.net/831710181/automake_1.18.1-3_all.deb > automake-1.18.deb
74+
sudo dpkg -i --force-depends automake-1.18.deb
8675
- name: Add various locales
8776
shell: bash
8877
run: |
@@ -103,6 +92,7 @@ jobs:
10392
sudo locale-gen --keep-existing fa_IR.UTF-8 # Iran
10493
sudo locale-gen --keep-existing am_ET.UTF-8 # Ethiopia
10594
sudo locale-gen --keep-existing th_TH.UTF-8 # Thailand
95+
sudo locale-gen --keep-existing zh_CN.GB18030 # China
10696
10797
sudo update-locale
10898
echo "After:"
@@ -115,11 +105,23 @@ jobs:
115105
## Build binaries
116106
cd 'uutils'
117107
env PROFILE=release-small bash util/build-gnu.sh
108+
109+
- name: Save files for faster configure and skipping make
110+
uses: actions/cache/save@v5
111+
if: always() && steps.cache-config-gnu.outputs.cache-hit != 'true'
112+
with:
113+
path: |
114+
gnu/config.cache
115+
gnu/src/getlimits
116+
key: ${{ runner.os }}-gnu-config-${{ hashFiles('gnu/NEWS') }}-${{ hashFiles('uutils/util/build-gnu.sh') }}
118117

119118
### Run tests as user
120119
- name: Run GNU tests
121120
shell: bash
122121
run: |
122+
## Use unshare
123+
sudo sysctl -w kernel.unprivileged_userns_clone=1
124+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
123125
## Run GNU tests
124126
path_GNU='gnu'
125127
path_UUTILS='uutils'
@@ -206,16 +208,6 @@ jobs:
206208
with:
207209
path: 'uutils'
208210
persist-credentials: false
209-
- name: Extract GNU version from build-gnu.sh
210-
id: gnu-version-selinux
211-
run: |
212-
GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
213-
if [ -z "$GNU_VERSION" ]; then
214-
echo "Error: Failed to extract GNU version from build-gnu.sh"
215-
exit 1
216-
fi
217-
echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
218-
echo "Extracted GNU version: ${GNU_VERSION}"
219211
- uses: dtolnay/rust-toolchain@master
220212
with:
221213
toolchain: stable
@@ -224,20 +216,7 @@ jobs:
224216
with:
225217
workspaces: "./uutils -> target"
226218
- name: Checkout code (GNU coreutils)
227-
uses: actions/checkout@v6
228-
with:
229-
repository: 'coreutils/coreutils'
230-
path: 'gnu'
231-
ref: ${{ env.REPO_GNU_REF }}
232-
submodules: false
233-
persist-credentials: false
234-
- name: Override submodule URL and initialize submodules
235-
# Use github instead of upstream git server
236-
run: |
237-
git submodule sync --recursive
238-
git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
239-
git submodule update --init --recursive --depth 1
240-
working-directory: gnu
219+
run: (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
241220

242221
#### Lima build environment setup
243222
- name: Setup Lima
@@ -340,8 +319,52 @@ jobs:
340319
gnu/tests-selinux/*.log
341320
gnu/tests-selinux/*/*.log.gz
342321
322+
smack:
323+
name: Run GNU tests (SMACK)
324+
runs-on: ubuntu-24.04
325+
steps:
326+
- name: Checkout code (uutils)
327+
uses: actions/checkout@v6
328+
with:
329+
path: 'uutils'
330+
persist-credentials: false
331+
- uses: dtolnay/rust-toolchain@master
332+
with:
333+
toolchain: stable
334+
components: rustfmt
335+
- uses: Swatinem/rust-cache@v2
336+
with:
337+
workspaces: "./uutils -> target"
338+
- name: Checkout code (GNU coreutils)
339+
run: (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
340+
- name: Install dependencies
341+
run: |
342+
sudo apt-get update
343+
sudo apt-get install -y qemu-system-x86 zstd cpio
344+
- name: Run GNU SMACK tests
345+
run: |
346+
cd uutils
347+
bash util/run-gnu-tests-smack-ci.sh "$GITHUB_WORKSPACE/gnu" "$GITHUB_WORKSPACE/gnu/tests-smack"
348+
- name: Extract testing info into JSON
349+
run: |
350+
python3 uutils/util/gnu-json-result.py gnu/tests-smack > ${{ env.TEST_SMACK_FULL_SUMMARY_FILE }}
351+
- name: Upload SMACK json results
352+
uses: actions/upload-artifact@v6
353+
with:
354+
name: smack-gnu-full-result
355+
path: ${{ env.TEST_SMACK_FULL_SUMMARY_FILE }}
356+
- name: Compress SMACK test logs
357+
run: gzip gnu/tests-smack/*/*.log 2>/dev/null || true
358+
- name: Upload SMACK test logs
359+
uses: actions/upload-artifact@v6
360+
with:
361+
name: smack-test-logs
362+
path: |
363+
gnu/tests-smack/*.log
364+
gnu/tests-smack/*/*.log.gz
365+
343366
aggregate:
344-
needs: [native, selinux]
367+
needs: [native, selinux, smack]
345368
permissions:
346369
actions: read # for dawidd6/action-download-artifact to query and download artifacts
347370
contents: read # for actions/checkout to fetch code
@@ -366,7 +389,7 @@ jobs:
366389
path: 'uutils'
367390
persist-credentials: false
368391
- name: Retrieve reference artifacts
369-
uses: dawidd6/action-download-artifact@v11
392+
uses: dawidd6/action-download-artifact@v12
370393
# ref: <https://github.com/dawidd6/action-download-artifact>
371394
continue-on-error: true ## don't break the build for missing reference artifacts (may be expired or just not generated yet)
372395
with:
@@ -406,6 +429,12 @@ jobs:
406429
name: selinux-root-gnu-full-result
407430
path: results
408431
merge-multiple: true
432+
- name: Download smack json results
433+
uses: actions/download-artifact@v7
434+
with:
435+
name: smack-gnu-full-result
436+
path: results
437+
merge-multiple: true
409438
- name: Extract/summarize testing info
410439
id: summary
411440
shell: bash
@@ -416,8 +445,8 @@ jobs:
416445
path_UUTILS='uutils'
417446
418447
json_count=$(ls -l results/*.json | wc -l)
419-
if [[ "$json_count" -ne 5 ]]; then
420-
echo "::error ::Failed to download all results json files (expected 4 files, found $json_count); failing early"
448+
if [[ "$json_count" -ne 6 ]]; then
449+
echo "::error ::Failed to download all results json files (expected 6 files, found $json_count); failing early"
421450
ls -lR results || true
422451
exit 1
423452
fi

.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 }

.github/workflows/openbsd.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ jobs:
4444
# We need jq and GNU coreutils to run show-utils.sh and bash to use inline shell string replacement
4545
# Use sudo-- to get the default sudo package without ambiguity
4646
# Install rust and cargo from OpenBSD packages
47-
prepare: pkg_add curl sudo-- jq coreutils bash rust rust-clippy rust-rustfmt llvm--
47+
prepare: |
48+
# Clean up disk space before installing packages
49+
df -h
50+
rm -rf /usr/share/doc/* /usr/share/man/* /var/cache/* /tmp/* || true
51+
pkg_add curl sudo-- jq coreutils bash rust rust-clippy rust-rustfmt llvm--
52+
# Clean up package cache after installation
53+
pkg_delete -a || true
54+
df -h
4855
run: |
4956
## Prepare, build, and test
5057
# implementation modelled after ref: <https://github.com/rust-lang/rustup/pull/2783>
@@ -106,8 +113,10 @@ jobs:
106113
# * convert any warnings to GHA UI annotations; ref: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message>
107114
S=\$(cargo clippy --all-targets \${CARGO_UTILITY_LIST_OPTIONS} -- -D warnings 2>&1) && printf "%s\n" "\$S" || { printf "%s\n" "\$S" ; printf "%s" "\$S" | sed -E -n -e '/^error:/{' -e "N; s/^error:[[:space:]]+(.*)\\n[[:space:]]+-->[[:space:]]+(.*):([0-9]+):([0-9]+).*\$/::\${FAULT_TYPE} file=\2,line=\3,col=\4::\${FAULT_PREFIX}: \\\`cargo clippy\\\`: \1 (file:'\2', line:\3)/p;" -e '}' ; FAULT=true ; }
108115
fi
109-
# Clean to avoid to rsync back the files
116+
# Clean to avoid to rsync back the files and free up disk space
110117
cargo clean
118+
# Additional cleanup to free disk space
119+
rm -rf ~/.cargo/registry/cache ~/.cargo/git/db || true
111120
if [ -n "\${FAIL_ON_FAULT}" ] && [ -n "\${FAULT}" ]; then exit 1 ; fi
112121
EOF
113122
@@ -132,7 +141,14 @@ jobs:
132141
copyback: false
133142
mem: 4096
134143
# Install rust and build dependencies from OpenBSD packages (llvm provides libclang for bindgen)
135-
prepare: pkg_add curl gmake sudo-- jq rust llvm--
144+
prepare: |
145+
# Clean up disk space before installing packages
146+
df -h
147+
rm -rf /usr/share/doc/* /usr/share/man/* /var/cache/* /tmp/* || true
148+
pkg_add curl gmake sudo-- jq rust llvm--
149+
# Clean up package cache after installation
150+
pkg_delete -a || true
151+
df -h
136152
run: |
137153
## Prepare, build, and test
138154
# implementation modelled after ref: <https://github.com/rust-lang/rustup/pull/2783>
@@ -181,9 +197,13 @@ jobs:
181197
cd "${WORKSPACE}"
182198
unset FAULT
183199
cargo build || FAULT=1
200+
# Clean build artifacts to save disk space before testing
201+
rm -rf target/debug/build target/debug/incremental || true
184202
export PATH=~/.cargo/bin:${PATH}
185203
export RUST_BACKTRACE=1
186204
export CARGO_TERM_COLOR=always
205+
# Avoid filling disk space
206+
export RUSTFLAGS="-C strip=symbols"
187207
# Use cargo test since nextest might not support OpenBSD
188208
if (test -z "\$FAULT"); then cargo test --features '${{ matrix.job.features }}' || FAULT=1 ; fi
189209
# There is no systemd-logind on OpenBSD, so test all features except feat_systemd_logind
@@ -193,7 +213,9 @@ jobs:
193213
fi
194214
# Test building with make
195215
if (test -z "\$FAULT"); then make || FAULT=1 ; fi
196-
# Clean to avoid to rsync back the files
216+
# Clean to avoid to rsync back the files and free up disk space
197217
cargo clean
218+
# Additional cleanup to free disk space
219+
rm -rf ~/.cargo/registry/cache ~/.cargo/git/db target/debug/deps target/release/deps || true
198220
if (test -n "\$FAULT"); then exit 1 ; fi
199221
EOF

.vscode/cspell.dictionaries/acronyms+names.wordlist.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ aarch
33
AIX
44
ASLR # address space layout randomization
55
AST # abstract syntax tree
6+
CATN # busybox cat -n feature flag
7+
CATV # busybox cat -v feature flag
68
CICD # continuous integration/deployment
79
CPU
810
CPUs

0 commit comments

Comments
 (0)