Skip to content

Commit 5182e80

Browse files
authored
Merge branch 'main' into sort-locale-month
2 parents 2395316 + 2da2c90 commit 5182e80

File tree

277 files changed

+9478
-2750
lines changed

Some content is hidden

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

277 files changed

+9478
-2750
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

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
linker = "x86_64-unknown-redox-gcc"
77
[target.aarch64-unknown-linux-gnu]
88
linker = "aarch64-linux-gnu-gcc"
9+
[target.riscv64gc-unknown-linux-musl]
10+
rustflags = ["-C", "target-feature=+crt-static"]
911

1012
[env]
1113
# See feat_external_libstdbuf in src/uu/stdbuf/Cargo.toml

.github/workflows/CICD.yml

Lines changed: 22 additions & 12 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
@@ -576,6 +576,7 @@ jobs:
576576
- { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , features: feat_os_unix_gnueabihf , use-cross: use-cross , skip-tests: true }
577577
- { os: ubuntu-24.04-arm , target: aarch64-unknown-linux-gnu , features: feat_os_unix_gnueabihf }
578578
- { os: ubuntu-latest , target: aarch64-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross , skip-tests: true }
579+
- { os: ubuntu-latest , target: riscv64gc-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross , skip-tests: true }
579580
# - { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: feat_selinux , use-cross: use-cross }
580581
- { os: ubuntu-latest , target: i686-unknown-linux-gnu , features: "feat_os_unix,test_risky_names", use-cross: use-cross }
581582
- { os: ubuntu-latest , target: i686-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross }
@@ -636,6 +637,7 @@ jobs:
636637
unset TARGET_ARCH
637638
case '${{ matrix.job.target }}' in
638639
aarch64-*) TARGET_ARCH=arm64 ;;
640+
riscv64gc-*) TARGET_ARCH=riscv64 ;;
639641
arm-*-*hf) TARGET_ARCH=armhf ;;
640642
i686-*) TARGET_ARCH=i686 ;;
641643
x86_64-*) TARGET_ARCH=x86_64 ;;
@@ -700,6 +702,7 @@ jobs:
700702
STRIP="strip"
701703
case ${{ matrix.job.target }} in
702704
aarch64-*-linux-*) STRIP="aarch64-linux-gnu-strip" ;;
705+
riscv64gc-*-linux-*) STRIP="riscv64-linux-gnu-strip" ;;
703706
arm-*-linux-gnueabihf) STRIP="arm-linux-gnueabihf-strip" ;;
704707
*-pc-windows-msvc) STRIP="" ;;
705708
esac;
@@ -726,6 +729,10 @@ jobs:
726729
sudo apt-get -y update
727730
sudo apt-get -y install gcc-aarch64-linux-gnu
728731
;;
732+
riscv64gc-unknown-linux-*)
733+
sudo apt-get -y update
734+
sudo apt-get -y install gcc-riscv64-linux-gnu
735+
;;
729736
*-redox*)
730737
sudo apt-get -y update
731738
sudo apt-get -y install fuse3 libfuse-dev
@@ -814,6 +821,8 @@ jobs:
814821
if: matrix.job.skip-tests != true
815822
shell: bash
816823
run: |
824+
command -v sudo && sudo rm -rf /usr/local/lib/android /usr/share/dotnet # avoid no space left
825+
df -h ||:
817826
## Test individual utilities
818827
${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} test --target=${{ matrix.job.target }} \
819828
${{ matrix.job.cargo-options }} ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
@@ -1194,7 +1203,8 @@ jobs:
11941203
- name: build and test all features individually
11951204
shell: bash
11961205
run: |
1197-
command -v sudo && sudo rm -rf /usr/share/dotnet # avoid no space left
1206+
command -v sudo && sudo rm -rf /usr/local/lib/android /usr/share/dotnet # avoid no space left
1207+
df -h ||:
11981208
CARGO_FEATURES_OPTION='--features=${{ matrix.job.features }}' ;
11991209
for f in $(util/show-utils.sh ${CARGO_FEATURES_OPTION})
12001210
do

.github/workflows/GnuTests.yml

Lines changed: 83 additions & 57 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) chksum dpkg getenforce getlimits gperf lcov libexpect limactl pyinotify setenforce shopt 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,38 +44,22 @@ 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
58-
components: rustfmt
5950
- uses: Swatinem/rust-cache@v2
6051
with:
6152
workspaces: "./uutils -> target"
6253
- name: Checkout code (GNU coreutils)
63-
uses: actions/checkout@v6
54+
run: (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
55+
- name: Restore files for faster configure and skipping make
56+
uses: actions/cache@v5
57+
id: cache-config-gnu
6458
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
59+
path: |
60+
gnu/config.cache
61+
gnu/src/getlimits
62+
key: ${{ runner.os }}-gnu-config-${{ hashFiles('gnu/NEWS') }}-${{ hashFiles('uutils/util/build-gnu.sh') }} # use build-gnu.sh for extremely safe caching
7763

7864
#### Build environment setup
7965
- name: Install dependencies
@@ -82,7 +68,9 @@ jobs:
8268
## Install dependencies
8369
sudo apt-get update
8470
## Check that build-gnu.sh works on the non SELinux system by installing libselinux only on lima
85-
sudo apt-get install -y autopoint gperf gdb python3-pyinotify valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev attr quilt
71+
sudo apt-get install -y gperf gdb python3-pyinotify valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev attr quilt
72+
curl http://launchpadlibrarian.net/831710181/automake_1.18.1-3_all.deb > automake-1.18.deb
73+
sudo dpkg -i --force-depends automake-1.18.deb
8674
- name: Add various locales
8775
shell: bash
8876
run: |
@@ -104,6 +92,7 @@ jobs:
10492
sudo locale-gen --keep-existing am_ET.UTF-8 # Ethiopia
10593
sudo locale-gen --keep-existing th_TH.UTF-8 # Thailand
10694
sudo locale-gen --keep-existing ja_JP.UTF-8 # Japan
95+
sudo locale-gen --keep-existing zh_CN.GB18030 # China
10796
10897
sudo update-locale
10998
echo "After:"
@@ -117,10 +106,22 @@ jobs:
117106
cd 'uutils'
118107
env PROFILE=release-small bash util/build-gnu.sh
119108
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') }}
117+
120118
### Run tests as user
121119
- name: Run GNU tests
122120
shell: bash
123121
run: |
122+
## Use unshare
123+
sudo sysctl -w kernel.unprivileged_userns_clone=1
124+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
124125
## Run GNU tests
125126
path_GNU='gnu'
126127
path_UUTILS='uutils'
@@ -207,38 +208,14 @@ jobs:
207208
with:
208209
path: 'uutils'
209210
persist-credentials: false
210-
- name: Extract GNU version from build-gnu.sh
211-
id: gnu-version-selinux
212-
run: |
213-
GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
214-
if [ -z "$GNU_VERSION" ]; then
215-
echo "Error: Failed to extract GNU version from build-gnu.sh"
216-
exit 1
217-
fi
218-
echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
219-
echo "Extracted GNU version: ${GNU_VERSION}"
220211
- uses: dtolnay/rust-toolchain@master
221212
with:
222213
toolchain: stable
223-
components: rustfmt
224214
- uses: Swatinem/rust-cache@v2
225215
with:
226216
workspaces: "./uutils -> target"
227217
- name: Checkout code (GNU coreutils)
228-
uses: actions/checkout@v6
229-
with:
230-
repository: 'coreutils/coreutils'
231-
path: 'gnu'
232-
ref: ${{ env.REPO_GNU_REF }}
233-
submodules: false
234-
persist-credentials: false
235-
- name: Override submodule URL and initialize submodules
236-
# Use github instead of upstream git server
237-
run: |
238-
git submodule sync --recursive
239-
git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
240-
git submodule update --init --recursive --depth 1
241-
working-directory: gnu
218+
run: (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
242219

243220
#### Lima build environment setup
244221
- name: Setup Lima
@@ -269,8 +246,8 @@ jobs:
269246
- name: Install dependencies in VM
270247
run: |
271248
lima sudo dnf -y update
272-
lima sudo dnf -y install git autoconf autopoint bison texinfo gperf gcc gdb jq libacl-devel libattr-devel libcap-devel libselinux-devel attr rustup clang-devel texinfo-tex automake patch quilt
273-
lima rustup-init -y --default-toolchain stable
249+
lima sudo dnf -y install autoconf bison gperf gcc gdb jq libacl-devel libattr-devel libcap-devel libselinux-devel attr rustup clang-devel automake patch quilt
250+
lima rustup-init -y --profile=minimal --default-toolchain stable
274251
- name: Copy the sources to VM
275252
run: |
276253
rsync -a -e ssh . lima-default:~/work/
@@ -341,8 +318,51 @@ jobs:
341318
gnu/tests-selinux/*.log
342319
gnu/tests-selinux/*/*.log.gz
343320
321+
smack:
322+
name: Run GNU tests (SMACK)
323+
runs-on: ubuntu-24.04
324+
steps:
325+
- name: Checkout code (uutils)
326+
uses: actions/checkout@v6
327+
with:
328+
path: 'uutils'
329+
persist-credentials: false
330+
- uses: dtolnay/rust-toolchain@master
331+
with:
332+
toolchain: stable
333+
- uses: Swatinem/rust-cache@v2
334+
with:
335+
workspaces: "./uutils -> target"
336+
- name: Checkout code (GNU coreutils)
337+
run: (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
338+
- name: Install dependencies
339+
run: |
340+
sudo apt-get update
341+
sudo apt-get install -y qemu-system-x86 zstd cpio
342+
- name: Run GNU SMACK tests
343+
run: |
344+
cd uutils
345+
bash util/run-gnu-tests-smack-ci.sh "$GITHUB_WORKSPACE/gnu" "$GITHUB_WORKSPACE/gnu/tests-smack"
346+
- name: Extract testing info into JSON
347+
run: |
348+
python3 uutils/util/gnu-json-result.py gnu/tests-smack > ${{ env.TEST_SMACK_FULL_SUMMARY_FILE }}
349+
- name: Upload SMACK json results
350+
uses: actions/upload-artifact@v6
351+
with:
352+
name: smack-gnu-full-result
353+
path: ${{ env.TEST_SMACK_FULL_SUMMARY_FILE }}
354+
- name: Compress SMACK test logs
355+
run: gzip gnu/tests-smack/*/*.log 2>/dev/null || true
356+
- name: Upload SMACK test logs
357+
uses: actions/upload-artifact@v6
358+
with:
359+
name: smack-test-logs
360+
path: |
361+
gnu/tests-smack/*.log
362+
gnu/tests-smack/*/*.log.gz
363+
344364
aggregate:
345-
needs: [native, selinux]
365+
needs: [native, selinux, smack]
346366
permissions:
347367
actions: read # for dawidd6/action-download-artifact to query and download artifacts
348368
contents: read # for actions/checkout to fetch code
@@ -367,7 +387,7 @@ jobs:
367387
path: 'uutils'
368388
persist-credentials: false
369389
- name: Retrieve reference artifacts
370-
uses: dawidd6/action-download-artifact@v11
390+
uses: dawidd6/action-download-artifact@v12
371391
# ref: <https://github.com/dawidd6/action-download-artifact>
372392
continue-on-error: true ## don't break the build for missing reference artifacts (may be expired or just not generated yet)
373393
with:
@@ -407,6 +427,12 @@ jobs:
407427
name: selinux-root-gnu-full-result
408428
path: results
409429
merge-multiple: true
430+
- name: Download smack json results
431+
uses: actions/download-artifact@v7
432+
with:
433+
name: smack-gnu-full-result
434+
path: results
435+
merge-multiple: true
410436
- name: Extract/summarize testing info
411437
id: summary
412438
shell: bash
@@ -417,8 +443,8 @@ jobs:
417443
path_UUTILS='uutils'
418444
419445
json_count=$(ls -l results/*.json | wc -l)
420-
if [[ "$json_count" -ne 5 ]]; then
421-
echo "::error ::Failed to download all results json files (expected 4 files, found $json_count); failing early"
446+
if [[ "$json_count" -ne 6 ]]; then
447+
echo "::error ::Failed to download all results json files (expected 6 files, found $json_count); failing early"
422448
ls -lR results || true
423449
exit 1
424450
fi

.github/workflows/android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ jobs:
166166
disk-size: ${{ env.EMULATOR_DISK_SIZE }}
167167
cores: ${{ env.EMULATOR_CORES }}
168168
force-avd-creation: false
169-
emulator-options: ${{ env.COMMON_EMULATOR_OPTIONS }} -no-snapshot-save -snapshot ${{ env.AVD_CACHE_KEY }}
169+
emulator-options: ${{ env.COMMON_EMULATOR_OPTIONS }} -no-metrics -no-snapshot-save -snapshot ${{ env.AVD_CACHE_KEY }}
170170
emulator-boot-timeout: ${{ env.EMULATOR_BOOT_TIMEOUT }}
171171
# This is not a usual script. Every line is executed in a separate shell with `sh -c`. If
172172
# one of the lines returns with error the whole script is failed (like running a script with

0 commit comments

Comments
 (0)