Skip to content

Commit 09459c4

Browse files
authored
Merge branch 'main' into rm-preserve
2 parents a1eeffa + 938039e commit 09459c4

File tree

339 files changed

+12668
-5012
lines changed

Some content is hidden

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

339 files changed

+12668
-5012
lines changed

.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

.config/nextest.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ final-status-level = "skip"
55
failure-output = "immediate-final"
66
fail-fast = false
77

8+
[profile.ci.junit]
9+
path = "junit.xml"
10+
811
[profile.coverage]
912
retries = 0
1013
status-level = "all"
1114
final-status-level = "skip"
1215
failure-output = "immediate-final"
1316
fail-fast = false
17+
18+
[profile.coverage.junit]
19+
path = "junit.xml"

.github/workflows/CICD.yml

Lines changed: 133 additions & 64 deletions
Large diffs are not rendered by default.

.github/workflows/FixPR.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
# Ensure updated '*/Cargo.lock'
4747
# * '*/Cargo.lock' is required to be in a format that `cargo` of MinSRV can interpret (eg, v1-format for MinSRV < v1.38)
4848
for dir in "." "fuzz"; do
49-
( cd "$dir" && (cargo fetch --locked --quiet || cargo +${{ steps.vars.outputs.RUST_MIN_SRV }} update) )
49+
( cd "$dir" && (cargo fetch --locked --quiet --target $(rustc --print host-tuple) || cargo +${{ steps.vars.outputs.RUST_MIN_SRV }} update) )
5050
done
5151
- name: Info
5252
shell: bash
@@ -65,7 +65,7 @@ jobs:
6565
cargo tree -V
6666
## dependencies
6767
echo "## dependency list"
68-
cargo fetch --locked --quiet
68+
cargo fetch --locked --quiet --target $(rustc --print host-tuple)
6969
## * using the 'stable' toolchain is necessary to avoid "unexpected '--filter-platform'" errors
7070
RUSTUP_TOOLCHAIN=stable cargo tree --locked --no-dedupe -e=no-dev --prefix=none --features ${{ matrix.job.features }} | grep -vE "$PWD" | sort --unique
7171
- name: Commit any changes (to '${{ env.BRANCH_TARGET }}')

.github/workflows/GnuTests.yml

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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 dpkg getenforce getlimits gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e zstd cpio
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
@@ -31,7 +31,7 @@ env:
3131
TEST_STTY_FULL_SUMMARY_FILE: 'gnu-stty-full-result.json'
3232
TEST_SELINUX_FULL_SUMMARY_FILE: 'selinux-gnu-full-result.json'
3333
TEST_SELINUX_ROOT_FULL_SUMMARY_FILE: 'selinux-root-gnu-full-result.json'
34-
TEST_SMACK_FULL_SUMMARY_FILE: 'smack-gnu-full-result.json'
34+
TEST_QEMU_FULL_SUMMARY_FILE: 'qemu-gnu-full-result.json'
3535

3636
jobs:
3737
native:
@@ -47,7 +47,6 @@ jobs:
4747
- uses: dtolnay/rust-toolchain@master
4848
with:
4949
toolchain: stable
50-
components: rustfmt
5150
- uses: Swatinem/rust-cache@v2
5251
with:
5352
workspaces: "./uutils -> target"
@@ -69,7 +68,7 @@ jobs:
6968
## Install dependencies
7069
sudo apt-get update
7170
## Check that build-gnu.sh works on the non SELinux system by installing libselinux only on lima
72-
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
7372
curl http://launchpadlibrarian.net/831710181/automake_1.18.1-3_all.deb > automake-1.18.deb
7473
sudo dpkg -i --force-depends automake-1.18.deb
7574
- name: Add various locales
@@ -105,7 +104,7 @@ jobs:
105104
## Build binaries
106105
cd 'uutils'
107106
env PROFILE=release-small bash util/build-gnu.sh
108-
107+
109108
- name: Save files for faster configure and skipping make
110109
uses: actions/cache/save@v5
111110
if: always() && steps.cache-config-gnu.outputs.cache-hit != 'true'
@@ -211,7 +210,6 @@ jobs:
211210
- uses: dtolnay/rust-toolchain@master
212211
with:
213212
toolchain: stable
214-
components: rustfmt
215213
- uses: Swatinem/rust-cache@v2
216214
with:
217215
workspaces: "./uutils -> target"
@@ -235,20 +233,11 @@ jobs:
235233
lima ls -laZ /etc/selinux
236234
lima sudo sestatus
237235
238-
# Ensure we're running in enforcing mode
239-
lima sudo setenforce 1
240-
lima getenforce
241-
242-
# Create test files with SELinux contexts for testing
243-
lima sudo mkdir -p /var/test_selinux
244-
lima sudo touch /var/test_selinux/test_file
245-
lima sudo chcon -t etc_t /var/test_selinux/test_file
246-
lima ls -Z /var/test_selinux/test_file # Verify context
247236
- name: Install dependencies in VM
248237
run: |
249238
lima sudo dnf -y update
250-
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
251-
lima rustup-init -y --default-toolchain stable
239+
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
240+
lima rustup-init -y --profile=minimal --default-toolchain stable
252241
- name: Copy the sources to VM
253242
run: |
254243
rsync -a -e ssh . lima-default:~/work/
@@ -269,8 +258,16 @@ jobs:
269258
lima bash -c "cd ~/work/uutils/ && echo 'Found SELinux tests:'; wc -l selinux-tests.txt"
270259
- name: Run GNU SELinux tests
271260
run: |
261+
# Ensure we're running in enforcing mode
272262
lima sudo setenforce 1
273263
lima getenforce
264+
265+
# Create test files with SELinux contexts for testing
266+
lima sudo mkdir -p /var/test_selinux
267+
lima sudo touch /var/test_selinux/test_file
268+
lima sudo chcon -t etc_t /var/test_selinux/test_file
269+
lima ls -Z /var/test_selinux/test_file # Verify context
270+
274271
lima cat /proc/filesystems
275272
lima bash -c "cd ~/work/uutils/ && bash util/run-gnu-test.sh \$(cat selinux-tests.txt)"
276273
- name: Extract testing info from individual logs into JSON
@@ -319,8 +316,8 @@ jobs:
319316
gnu/tests-selinux/*.log
320317
gnu/tests-selinux/*/*.log.gz
321318
322-
smack:
323-
name: Run GNU tests (SMACK)
319+
qemu:
320+
name: Run GNU tests (SMACK/ROOTFS)
324321
runs-on: ubuntu-24.04
325322
steps:
326323
- name: Checkout code (uutils)
@@ -331,7 +328,6 @@ jobs:
331328
- uses: dtolnay/rust-toolchain@master
332329
with:
333330
toolchain: stable
334-
components: rustfmt
335331
- uses: Swatinem/rust-cache@v2
336332
with:
337333
workspaces: "./uutils -> target"
@@ -341,30 +337,30 @@ jobs:
341337
run: |
342338
sudo apt-get update
343339
sudo apt-get install -y qemu-system-x86 zstd cpio
344-
- name: Run GNU SMACK tests
340+
- name: Run GNU SMACK/ROOTFS tests
345341
run: |
346342
cd uutils
347-
bash util/run-gnu-tests-smack-ci.sh "$GITHUB_WORKSPACE/gnu" "$GITHUB_WORKSPACE/gnu/tests-smack"
343+
bash util/run-gnu-tests-smack-ci.sh "$GITHUB_WORKSPACE/gnu" "$GITHUB_WORKSPACE/gnu/tests-qemu"
348344
- name: Extract testing info into JSON
349345
run: |
350-
python3 uutils/util/gnu-json-result.py gnu/tests-smack > ${{ env.TEST_SMACK_FULL_SUMMARY_FILE }}
351-
- name: Upload SMACK json results
346+
python3 uutils/util/gnu-json-result.py gnu/tests-qemu > ${{ env.TEST_QEMU_FULL_SUMMARY_FILE }}
347+
- name: Upload SMACK/ROOTFS json results
352348
uses: actions/upload-artifact@v6
353349
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
350+
name: qemu-gnu-full-result
351+
path: ${{ env.TEST_QEMU_FULL_SUMMARY_FILE }}
352+
- name: Compress SMACK/ROOTFS test logs
353+
run: gzip gnu/tests-qemu/*/*.log 2>/dev/null || true
354+
- name: Upload SMACK/ROOTFS test logs
359355
uses: actions/upload-artifact@v6
360356
with:
361-
name: smack-test-logs
357+
name: qemu-test-logs
362358
path: |
363-
gnu/tests-smack/*.log
364-
gnu/tests-smack/*/*.log.gz
359+
gnu/tests-qemu/*.log
360+
gnu/tests-qemu/*/*.log.gz
365361
366362
aggregate:
367-
needs: [native, selinux, smack]
363+
needs: [native, selinux, qemu]
368364
permissions:
369365
actions: read # for dawidd6/action-download-artifact to query and download artifacts
370366
contents: read # for actions/checkout to fetch code
@@ -429,10 +425,10 @@ jobs:
429425
name: selinux-root-gnu-full-result
430426
path: results
431427
merge-multiple: true
432-
- name: Download smack json results
428+
- name: Download SMACK/ROOTFS json results
433429
uses: actions/download-artifact@v7
434430
with:
435-
name: smack-gnu-full-result
431+
name: qemu-gnu-full-result
436432
path: results
437433
merge-multiple: true
438434
- name: Extract/summarize testing info

.github/workflows/android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ concurrency:
2222
env:
2323
TERMUX: v0.118.0
2424
KEY_POSTFIX: nextest+rustc-hash+adb+sshd+upgrade+XGB+inc18
25-
COMMON_EMULATOR_OPTIONS: -no-window -noaudio -no-boot-anim -camera-back none -gpu off
25+
COMMON_EMULATOR_OPTIONS: -no-metrics -no-window -noaudio -no-boot-anim -camera-back none -gpu off
2626
EMULATOR_DISK_SIZE: 12GB
2727
EMULATOR_HEAP_SIZE: 2048M
2828
EMULATOR_BOOT_TIMEOUT: 1200 # 20min
@@ -39,7 +39,7 @@ jobs:
3939
ram: [4096]
4040
api-level: [28]
4141
target: [google_apis_playstore]
42-
arch: [x86, x86_64] # , arm64-v8a
42+
arch: [x86_64] # ,x86 ,arm64-v8a
4343
runs-on: ${{ matrix.os }}
4444
env:
4545
EMULATOR_RAM_SIZE: ${{ matrix.ram }}

.github/workflows/benchmarks.yml

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,38 @@ concurrency:
1818

1919
jobs:
2020
benchmarks:
21-
name: Run benchmarks (CodSpeed)
21+
name: Run ${{ matrix.type }} benchmarks for ${{ matrix.package }} (CodSpeed)
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
benchmark-target:
26-
- { package: uu_base64 }
27-
- { package: uu_cksum }
28-
- { package: uu_cp }
29-
- { package: uu_cut }
30-
- { package: uu_du }
31-
- { package: uu_expand }
32-
- { package: uu_fold }
33-
- { package: uu_hashsum }
34-
- { package: uu_ls }
35-
- { package: uu_mv }
36-
- { package: uu_nl }
37-
- { package: uu_numfmt }
38-
- { package: uu_rm }
39-
- { package: uu_seq }
40-
- { package: uu_shuf }
41-
- { package: uu_sort }
42-
- { package: uu_split }
43-
- { package: uu_tsort }
44-
- { package: uu_unexpand }
45-
- { package: uu_uniq }
46-
- { package: uu_wc }
47-
- { package: uu_factor }
25+
type: [simulation] # , memory] # memory profile disabled due to variance
26+
package: [
27+
uu_base64,
28+
uu_cksum,
29+
uu_cp,
30+
uu_cut,
31+
uu_dd,
32+
uu_df,
33+
uu_du,
34+
uu_expand,
35+
uu_fold,
36+
uu_join,
37+
uu_ls,
38+
uu_mv,
39+
uu_nl,
40+
uu_numfmt,
41+
uu_rm,
42+
uu_seq,
43+
uu_shuf,
44+
uu_sort,
45+
uu_split,
46+
uu_tsort,
47+
uu_unexpand,
48+
uu_uniq,
49+
uu_wc,
50+
uu_factor,
51+
uu_date
52+
]
4853
steps:
4954
- uses: actions/checkout@v6
5055
with:
@@ -57,23 +62,31 @@ jobs:
5762
- name: Run sccache-cache
5863
uses: mozilla-actions/sccache-action@v0.0.9
5964

65+
- name: Install locales
66+
shell: bash
67+
run: |
68+
sudo apt-get update
69+
sudo apt-get install -y locales
70+
sudo locale-gen fr_FR.UTF-8
71+
sudo update-locale
72+
6073
- name: Install cargo-codspeed
6174
shell: bash
6275
run: cargo install cargo-codspeed --locked
6376

64-
- name: Build benchmarks for ${{ matrix.benchmark-target.package }}
77+
- name: Build benchmarks for ${{ matrix.package }} (${{ matrix.type }})
6578
shell: bash
6679
run: |
67-
echo "Building benchmarks for ${{ matrix.benchmark-target.package }}"
68-
cargo codspeed build -p ${{ matrix.benchmark-target.package }}
80+
echo "Building ${{ matrix.type }} benchmarks for ${{ matrix.package }}"
81+
cargo codspeed build -m ${{ matrix.type }} -p ${{ matrix.package }}
6982
70-
- name: Run benchmarks for ${{ matrix.benchmark-target.package }}
83+
- name: Run ${{ matrix.type }} benchmarks for ${{ matrix.package }}
7184
uses: CodSpeedHQ/action@v4
7285
env:
7386
CODSPEED_LOG: debug
7487
with:
75-
mode: instrumentation
88+
mode: ${{ matrix.type }}
7689
run: |
77-
echo "Running benchmarks for ${{ matrix.benchmark-target.package }}"
78-
cargo codspeed run -p ${{ matrix.benchmark-target.package }} > /dev/null
90+
echo "Running ${{ matrix.type }} benchmarks for ${{ matrix.package }}"
91+
cargo codspeed run -p ${{ matrix.package }} > /dev/null
7992
token: ${{ secrets.CODSPEED_TOKEN }}

.github/workflows/code-quality.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ jobs:
147147
CARGO_UTILITY_LIST_OPTIONS="$(for u in ${UTILITY_LIST}; do echo -n "-puu_${u} "; done;)"
148148
S=$(cargo clippy --all-targets $extra --tests --benches -pcoreutils ${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 ; }
149149
if [ -n "${{ steps.vars.outputs.FAIL_ON_FAULT }}" ] && [ -n "$fault" ]; then exit 1 ; fi
150+
- name: "cargo clippy on fuzz dir"
151+
if: runner.os != 'Windows'
152+
shell: bash
153+
run: |
154+
cd fuzz
155+
cargo clippy --workspace --all-targets --all-features -- -D warnings
150156
151157
style_spellcheck:
152158
name: Style/spelling

.github/workflows/freebsd.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: FreeBSD
22

3-
# spell-checker:ignore sshfs usesh vmactions taiki Swatinem esac fdescfs fdesc sccache nextest copyback logind
3+
# spell-checker:ignore sshfs usesh vmactions taiki Swatinem esac fdescfs fdesc nextest copyback logind
44

55
env:
66
# * style job configuration
@@ -30,18 +30,10 @@ jobs:
3030
matrix:
3131
job:
3232
- { os: ubuntu-24.04 , features: unix }
33-
env:
34-
SCCACHE_GHA_ENABLED: "true"
35-
RUSTC_WRAPPER: "sccache"
3633
steps:
3734
- uses: actions/checkout@v6
3835
with:
3936
persist-credentials: false
40-
- uses: Swatinem/rust-cache@v2
41-
- name: Run sccache-cache
42-
uses: mozilla-actions/sccache-action@v0.0.9
43-
with:
44-
disable_annotations: true
4537
- name: Prepare, build and test
4638
uses: vmactions/freebsd-vm@v1.2.9
4739
with:
@@ -127,17 +119,12 @@ jobs:
127119
- { os: ubuntu-24.04 , features: unix }
128120
env:
129121
mem: 4096
130-
SCCACHE_GHA_ENABLED: "true"
131-
RUSTC_WRAPPER: "sccache"
132122
steps:
133123
- uses: actions/checkout@v6
134124
with:
135125
persist-credentials: false
136-
- uses: Swatinem/rust-cache@v2
137-
- name: Run sccache-cache
138-
uses: mozilla-actions/sccache-action@v0.0.9
139-
with:
140-
disable_annotations: true
126+
- name: Avoid no space left on device (Ubuntu runner)
127+
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android &
141128
- name: Prepare, build and test
142129
uses: vmactions/freebsd-vm@v1.2.9
143130
with:
@@ -192,6 +179,7 @@ jobs:
192179
set +e
193180
cd "${WORKSPACE}"
194181
unset FAULT
182+
export RUSTFLAGS="-C strip=symbols" # for disk space
195183
cargo build || FAULT=1
196184
export PATH=~/.cargo/bin:${PATH}
197185
export RUST_BACKTRACE=1

0 commit comments

Comments
 (0)