Skip to content

Commit 2f76144

Browse files
authored
Merge branch 'main' into fix/id-human-readable-output
2 parents e56dfa5 + b0f41e7 commit 2f76144

File tree

263 files changed

+12168
-3525
lines changed

Some content is hidden

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

263 files changed

+12168
-3525
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
[target.x86_64-unknown-redox]
66
linker = "x86_64-unknown-redox-gcc"
7+
[target.aarch64-unknown-linux-gnu]
8+
linker = "aarch64-linux-gnu-gcc"
79

810
[env]
911
# See feat_external_libstdbuf in src/uu/stdbuf/Cargo.toml

.github/workflows/CICD.yml

Lines changed: 53 additions & 150 deletions
Large diffs are not rendered by default.

.github/workflows/FixPR.yml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -77,49 +77,3 @@ jobs:
7777
add: Cargo.lock fuzz/Cargo.lock
7878
env:
7979
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
81-
code_format:
82-
# Recheck/refresh code formatting
83-
if: github.event.pull_request.merged == true ## only for PR merges
84-
name: Update/format
85-
runs-on: ${{ matrix.job.os }}
86-
strategy:
87-
fail-fast: false
88-
matrix:
89-
job:
90-
- { os: ubuntu-latest , features: feat_os_unix }
91-
steps:
92-
- uses: actions/checkout@v5
93-
with:
94-
persist-credentials: false
95-
- name: Initialize job variables
96-
id: vars
97-
shell: bash
98-
run: |
99-
# target-specific options
100-
# * CARGO_FEATURES_OPTION
101-
CARGO_FEATURES_OPTION='' ;
102-
if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi
103-
echo "CARGO_FEATURES_OPTION=${CARGO_FEATURES_OPTION}" >> $GITHUB_OUTPUT
104-
- uses: dtolnay/rust-toolchain@master
105-
with:
106-
toolchain: stable
107-
components: rustfmt
108-
- uses: Swatinem/rust-cache@v2
109-
- name: "`cargo fmt`"
110-
shell: bash
111-
run: |
112-
cargo fmt
113-
- name: "`cargo fmt` tests"
114-
shell: bash
115-
run: |
116-
# `cargo fmt` of tests
117-
find tests -name "*.rs" -print0 | xargs -0 cargo fmt --
118-
- name: Commit any changes (to '${{ env.BRANCH_TARGET }}')
119-
uses: EndBug/add-and-commit@v9
120-
with:
121-
new_branch: ${{ env.BRANCH_TARGET }}
122-
default_author: github_actions
123-
message: "maint ~ rustfmt (`cargo fmt`)"
124-
env:
125-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/GnuTests.yml

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ env:
2929
TEST_ROOT_FULL_SUMMARY_FILE: 'gnu-root-full-result.json'
3030
TEST_SELINUX_FULL_SUMMARY_FILE: 'selinux-gnu-full-result.json'
3131
TEST_SELINUX_ROOT_FULL_SUMMARY_FILE: 'selinux-root-gnu-full-result.json'
32-
REPO_GNU_REF: "v9.8"
3332

3433
jobs:
3534
native:
@@ -42,6 +41,16 @@ jobs:
4241
with:
4342
path: 'uutils'
4443
persist-credentials: false
44+
- name: Extract GNU version from build-gnu.sh
45+
id: gnu-version
46+
run: |
47+
GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
48+
if [ -z "$GNU_VERSION" ]; then
49+
echo "Error: Failed to extract GNU version from build-gnu.sh"
50+
exit 1
51+
fi
52+
echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
53+
echo "Extracted GNU version: ${GNU_VERSION}"
4554
- uses: dtolnay/rust-toolchain@master
4655
with:
4756
toolchain: stable
@@ -71,7 +80,7 @@ jobs:
7180
run: |
7281
## Install dependencies
7382
sudo apt-get update
74-
sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev libselinux1-dev attr quilt
83+
sudo apt-get install -y autopoint gperf gdb python3-pyinotify valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev libselinux1-dev attr quilt
7584
- name: Add various locales
7685
shell: bash
7786
run: |
@@ -132,12 +141,12 @@ jobs:
132141
133142
### Upload artifacts
134143
- name: Upload full json results
135-
uses: actions/upload-artifact@v4
144+
uses: actions/upload-artifact@v5
136145
with:
137146
name: gnu-full-result
138147
path: ${{ env.TEST_FULL_SUMMARY_FILE }}
139148
- name: Upload root json results
140-
uses: actions/upload-artifact@v4
149+
uses: actions/upload-artifact@v5
141150
with:
142151
name: gnu-root-full-result
143152
path: ${{ env.TEST_ROOT_FULL_SUMMARY_FILE }}
@@ -147,7 +156,7 @@ jobs:
147156
# Compress logs before upload (fails otherwise)
148157
gzip gnu/tests/*/*.log
149158
- name: Upload test logs
150-
uses: actions/upload-artifact@v4
159+
uses: actions/upload-artifact@v5
151160
with:
152161
name: test-logs
153162
path: |
@@ -164,6 +173,16 @@ jobs:
164173
with:
165174
path: 'uutils'
166175
persist-credentials: false
176+
- name: Extract GNU version from build-gnu.sh
177+
id: gnu-version-selinux
178+
run: |
179+
GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
180+
if [ -z "$GNU_VERSION" ]; then
181+
echo "Error: Failed to extract GNU version from build-gnu.sh"
182+
exit 1
183+
fi
184+
echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
185+
echo "Extracted GNU version: ${GNU_VERSION}"
167186
- uses: dtolnay/rust-toolchain@master
168187
with:
169188
toolchain: stable
@@ -197,9 +216,7 @@ jobs:
197216
path: ~/.cache/lima
198217
key: lima-${{ steps.lima-actions-setup.outputs.version }}
199218
- name: Start Fedora VM with SELinux
200-
run: limactl start --plain --name=default --cpus=4 --disk=40 --memory=8 --network=lima:user-v2 template://fedora
201-
- name: Setup SSH
202-
uses: lima-vm/lima-actions/ssh@v1
219+
run: limactl start --plain --name=default --cpus=4 --disk=40 --memory=8 --network=lima:user-v2 template:fedora
203220
- name: Verify SELinux Status and Configuration
204221
run: |
205222
lima getenforce
@@ -218,7 +235,7 @@ jobs:
218235
- name: Install dependencies in VM
219236
run: |
220237
lima sudo dnf -y update
221-
lima sudo dnf -y install git autoconf autopoint bison texinfo gperf gcc g++ gdb jq libacl-devel libattr-devel libcap-devel libselinux-devel attr rustup clang-devel texinfo-tex wget automake patch quilt
238+
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 wget automake patch quilt
222239
lima rustup-init -y --default-toolchain stable
223240
- name: Copy the sources to VM
224241
run: |
@@ -227,7 +244,7 @@ jobs:
227244
### Build
228245
- name: Build binaries
229246
run: |
230-
lima bash -c "cd ~/work/uutils/ && bash util/build-gnu.sh --release-build"
247+
lima bash -c "cd ~/work/uutils/ && SELINUX_ENABLED=1 bash util/build-gnu.sh --release-build"
231248
232249
### Run tests as user
233250
- name: Generate SELinux tests list
@@ -268,12 +285,12 @@ jobs:
268285
# Copy the test directory now
269286
rsync -v -a -e ssh lima-default:~/work/gnu/tests/ ./gnu/tests-selinux/
270287
- name: Upload SELinux json results
271-
uses: actions/upload-artifact@v4
288+
uses: actions/upload-artifact@v5
272289
with:
273290
name: selinux-gnu-full-result
274291
path: ${{ env.TEST_SELINUX_FULL_SUMMARY_FILE }}
275292
- name: Upload SELinux root json results
276-
uses: actions/upload-artifact@v4
293+
uses: actions/upload-artifact@v5
277294
with:
278295
name: selinux-root-gnu-full-result
279296
path: ${{ env.TEST_SELINUX_ROOT_FULL_SUMMARY_FILE }}
@@ -283,7 +300,7 @@ jobs:
283300
# Compress logs before upload (fails otherwise)
284301
gzip gnu/tests-selinux/*/*.log
285302
- name: Upload SELinux test logs
286-
uses: actions/upload-artifact@v4
303+
uses: actions/upload-artifact@v5
287304
with:
288305
name: selinux-test-logs
289306
path: |
@@ -326,25 +343,25 @@ jobs:
326343
workflow_conclusion: completed ## continually recalibrates to last commit of default branch with a successful GnuTests (ie, "self-heals" from GnuTest regressions, but needs more supervision for/of regressions)
327344
path: "reference"
328345
- name: Download full json results
329-
uses: actions/download-artifact@v5
346+
uses: actions/download-artifact@v6
330347
with:
331348
name: gnu-full-result
332349
path: results
333350
merge-multiple: true
334351
- name: Download root json results
335-
uses: actions/download-artifact@v5
352+
uses: actions/download-artifact@v6
336353
with:
337354
name: gnu-root-full-result
338355
path: results
339356
merge-multiple: true
340357
- name: Download selinux json results
341-
uses: actions/download-artifact@v5
358+
uses: actions/download-artifact@v6
342359
with:
343360
name: selinux-gnu-full-result
344361
path: results
345362
merge-multiple: true
346363
- name: Download selinux root json results
347-
uses: actions/download-artifact@v5
364+
uses: actions/download-artifact@v6
348365
with:
349366
name: selinux-root-gnu-full-result
350367
path: results
@@ -393,17 +410,17 @@ jobs:
393410
HASH=$(sha1sum '${{ steps.vars.outputs.TEST_SUMMARY_FILE }}' | cut --delim=" " -f 1)
394411
outputs HASH
395412
- name: Upload SHA1/ID of 'test-summary'
396-
uses: actions/upload-artifact@v4
413+
uses: actions/upload-artifact@v5
397414
with:
398415
name: "${{ steps.summary.outputs.HASH }}"
399416
path: "${{ steps.vars.outputs.TEST_SUMMARY_FILE }}"
400417
- name: Upload test results summary
401-
uses: actions/upload-artifact@v4
418+
uses: actions/upload-artifact@v5
402419
with:
403420
name: test-summary
404421
path: "${{ steps.vars.outputs.TEST_SUMMARY_FILE }}"
405422
- name: Upload aggregated json results
406-
uses: actions/upload-artifact@v4
423+
uses: actions/upload-artifact@v5
407424
with:
408425
name: aggregated-result
409426
path: ${{ steps.vars.outputs.AGGREGATED_SUMMARY_FILE }}
@@ -455,7 +472,7 @@ jobs:
455472
fi
456473
- name: Upload comparison log (for GnuComment workflow)
457474
if: success() || failure() # run regardless of prior step success/failure
458-
uses: actions/upload-artifact@v4
475+
uses: actions/upload-artifact@v5
459476
with:
460477
name: comment
461478
path: reference/comment/

.github/workflows/android.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
~/.android/avd/*/*.lock
117117
- name: Create and cache emulator image
118118
if: steps.avd-cache.outputs.cache-hit != 'true'
119-
uses: reactivecircus/android-emulator-runner@v2.34.0
119+
uses: reactivecircus/android-emulator-runner@v2.35.0
120120
with:
121121
api-level: ${{ matrix.api-level }}
122122
target: ${{ matrix.target }}
@@ -161,7 +161,7 @@ jobs:
161161
free -mh
162162
df -Th
163163
- name: Build and Test
164-
uses: reactivecircus/android-emulator-runner@v2.34.0
164+
uses: reactivecircus/android-emulator-runner@v2.35.0
165165
with:
166166
api-level: ${{ matrix.api-level }}
167167
target: ${{ matrix.target }}
@@ -195,7 +195,7 @@ jobs:
195195
key: ${{ matrix.arch }}_${{ matrix.target}}_${{ steps.read_rustc_hash.outputs.content }}_${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}_v3
196196
- name: archive any output (error screenshots)
197197
if: always()
198-
uses: actions/upload-artifact@v4
198+
uses: actions/upload-artifact@v5
199199
with:
200200
name: test_output_${{ env.AVD_CACHE_KEY }}
201201
path: output

.github/workflows/benchmarks.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Benchmarks
2+
3+
# spell-checker:ignore codspeed dtolnay Swatinem sccache
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- '*'
10+
11+
permissions:
12+
contents: read # to fetch code (actions/checkout)
13+
14+
# End the current execution if there is a new changeset in the PR.
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
18+
19+
jobs:
20+
benchmarks:
21+
name: Run benchmarks (CodSpeed)
22+
runs-on: ubuntu-latest
23+
strategy:
24+
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 }
48+
steps:
49+
- uses: actions/checkout@v5
50+
with:
51+
persist-credentials: false
52+
53+
- name: Install system dependencies
54+
shell: bash
55+
run: |
56+
sudo apt-get -y update
57+
sudo apt-get -y install libselinux1-dev
58+
59+
- uses: dtolnay/rust-toolchain@stable
60+
61+
- uses: Swatinem/rust-cache@v2
62+
63+
- name: Run sccache-cache
64+
uses: mozilla-actions/sccache-action@v0.0.9
65+
66+
- name: Install cargo-codspeed
67+
shell: bash
68+
run: cargo install cargo-codspeed --locked
69+
70+
- name: Build benchmarks for ${{ matrix.benchmark-target.package }}
71+
shell: bash
72+
run: |
73+
echo "Building benchmarks for ${{ matrix.benchmark-target.package }}"
74+
cargo codspeed build -p ${{ matrix.benchmark-target.package }}
75+
76+
- name: Run benchmarks for ${{ matrix.benchmark-target.package }}
77+
uses: CodSpeedHQ/action@v4
78+
env:
79+
CODSPEED_LOG: debug
80+
with:
81+
mode: instrumentation
82+
run: |
83+
echo "Running benchmarks for ${{ matrix.benchmark-target.package }}"
84+
cargo codspeed run -p ${{ matrix.benchmark-target.package }} > /dev/null
85+
token: ${{ secrets.CODSPEED_TOKEN }}

.github/workflows/code-quality.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ jobs:
110110
## Install/setup prerequisites
111111
case '${{ matrix.job.os }}' in
112112
ubuntu-*)
113+
sudo apt-get -y update
113114
# selinux and systemd headers needed to enable all features
114115
sudo apt-get -y install libselinux1-dev libsystemd-dev
115116
;;
@@ -132,7 +133,7 @@ jobs:
132133
else
133134
extra="--features ${{ matrix.job.features }}"
134135
fi
135-
case '${{ matrix.job.workspace-tests }}' in
136+
case '${{ matrix.job.workspace }}' in
136137
1|t|true|y|yes)
137138
extra="${extra} --workspace"
138139
;;
@@ -185,7 +186,7 @@ jobs:
185186
cfg_files=($(shopt -s nullglob ; echo {.vscode,.}/{,.}c[sS]pell{.json,.config{.js,.cjs,.json,.yaml,.yml},.yaml,.yml} ;))
186187
cfg_file=${cfg_files[0]}
187188
unset CSPELL_CFG_OPTION ; if [ -n "$cfg_file" ]; then CSPELL_CFG_OPTION="--config $cfg_file" ; fi
188-
S=$(cspell ${CSPELL_CFG_OPTION} --no-summary --no-progress .) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n "s/${PWD//\//\\/}\/(.*):(.*):(.*) - (.*)/::${fault_type} file=\1,line=\2,col=\3::${fault_type^^}: \4 (file:'\1', line:\2)/p" ; fault=true ; true ; }
189+
S=$(cspell ${CSPELL_CFG_OPTION} --no-summary --no-progress .) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n "s/^(.*):([0-9]+):([0-9]+) - Unknown word \(([^)]+)\).*$/::${fault_type} file=\1,line=\2,col=\3::${fault_type^^}: \`cspell\`: Unknown word '\4' (file:'\1', line:\2)/p" ; fault=true ; true ; }
189190
if [ -n "${{ steps.vars.outputs.FAIL_ON_FAULT }}" ] && [ -n "$fault" ]; then exit 1 ; fi
190191
191192
toml_format:

0 commit comments

Comments
 (0)