Skip to content

Commit 2cdc331

Browse files
authored
Merge branch 'main' into unit1
2 parents 58c49d5 + aaa0610 commit 2cdc331

File tree

267 files changed

+11208
-4466
lines changed

Some content is hidden

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

267 files changed

+11208
-4466
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

.devcontainer/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ RUN apt-get update \
1212
gcc \
1313
gdb \
1414
gperf \
15-
jq \
1615
libacl1-dev \
1716
libattr1-dev \
1817
libcap-dev \

.github/workflows/CICD.yml

Lines changed: 46 additions & 98 deletions
Large diffs are not rendered by default.

.github/workflows/CheckScripts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
permissions:
3030
contents: read
3131
steps:
32-
- uses: actions/checkout@v5
32+
- uses: actions/checkout@v6
3333
with:
3434
persist-credentials: false
3535
- name: Run ShellCheck
@@ -47,7 +47,7 @@ jobs:
4747
permissions:
4848
contents: read
4949
steps:
50-
- uses: actions/checkout@v5
50+
- uses: actions/checkout@v6
5151
with:
5252
persist-credentials: false
5353
- name: Setup shfmt

.github/workflows/FixPR.yml

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
job:
2727
- { os: ubuntu-latest , features: feat_os_unix }
2828
steps:
29-
- uses: actions/checkout@v5
29+
- uses: actions/checkout@v6
3030
with:
3131
persist-credentials: false
3232
- name: Initialize job variables
@@ -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: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ env:
2727
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
2828
TEST_FULL_SUMMARY_FILE: 'gnu-full-result.json'
2929
TEST_ROOT_FULL_SUMMARY_FILE: 'gnu-root-full-result.json'
30+
TEST_STTY_FULL_SUMMARY_FILE: 'gnu-stty-full-result.json'
3031
TEST_SELINUX_FULL_SUMMARY_FILE: 'selinux-gnu-full-result.json'
3132
TEST_SELINUX_ROOT_FULL_SUMMARY_FILE: 'selinux-root-gnu-full-result.json'
32-
REPO_GNU_REF: "v9.8"
3333

3434
jobs:
3535
native:
@@ -38,10 +38,20 @@ jobs:
3838
steps:
3939
#### Get the code, setup cache
4040
- name: Checkout code (uutils)
41-
uses: actions/checkout@v5
41+
uses: actions/checkout@v6
4242
with:
4343
path: 'uutils'
4444
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}"
4555
- uses: dtolnay/rust-toolchain@master
4656
with:
4757
toolchain: stable
@@ -50,7 +60,7 @@ jobs:
5060
with:
5161
workspaces: "./uutils -> target"
5262
- name: Checkout code (GNU coreutils)
53-
uses: actions/checkout@v5
63+
uses: actions/checkout@v6
5464
with:
5565
repository: 'coreutils/coreutils'
5666
path: 'gnu'
@@ -71,7 +81,8 @@ jobs:
7181
run: |
7282
## Install dependencies
7383
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
84+
## 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
7586
- name: Add various locales
7687
shell: bash
7788
run: |
@@ -89,6 +100,9 @@ jobs:
89100
sudo locale-gen --keep-existing en_US
90101
sudo locale-gen --keep-existing en_US.UTF-8
91102
sudo locale-gen --keep-existing ru_RU.KOI8-R
103+
sudo locale-gen --keep-existing fa_IR.UTF-8 # Iran
104+
sudo locale-gen --keep-existing am_ET.UTF-8 # Ethiopia
105+
sudo locale-gen --keep-existing th_TH.UTF-8 # Thailand
92106
93107
sudo update-locale
94108
echo "After:"
@@ -100,7 +114,7 @@ jobs:
100114
run: |
101115
## Build binaries
102116
cd 'uutils'
103-
bash util/build-gnu.sh --release-build
117+
env PROFILE=release-small bash util/build-gnu.sh
104118
105119
### Run tests as user
106120
- name: Run GNU tests
@@ -124,12 +138,34 @@ jobs:
124138
path_GNU='gnu'
125139
path_UUTILS='uutils'
126140
bash "uutils/util/run-gnu-test.sh" run-root
141+
127142
- name: Extract testing info from individual logs (run as root) into JSON
128143
shell: bash
129144
run : |
130145
path_UUTILS='uutils'
131146
python uutils/util/gnu-json-result.py gnu/tests > ${{ env.TEST_ROOT_FULL_SUMMARY_FILE }}
132147
148+
### This shell has been changed from "bash" to this command
149+
### "script" will start a pty and the -q command removes the "script" initiation log
150+
### the -e flag makes it propagate the error code and -c runs the command in a pty
151+
### the primary purpose of this change is to run the tty GNU tests
152+
### The reason its separated from the rest of the tests is because one test can corrupt the other
153+
### tests through the use of the shared terminal and it changes the environment that the other
154+
### tests are run in, which can cause different results.
155+
- name: Run GNU stty tests
156+
shell: 'script -q -e -c "bash {0}"'
157+
run: |
158+
## Run GNU root tests
159+
path_GNU='gnu'
160+
path_UUTILS='uutils'
161+
bash "uutils/util/run-gnu-test.sh" run-tty
162+
163+
- name: Extract testing info from individual logs (stty) into JSON
164+
shell: bash
165+
run : |
166+
path_UUTILS='uutils'
167+
python uutils/util/gnu-json-result.py gnu/tests > ${{ env.TEST_STTY_FULL_SUMMARY_FILE }}
168+
133169
### Upload artifacts
134170
- name: Upload full json results
135171
uses: actions/upload-artifact@v5
@@ -141,6 +177,12 @@ jobs:
141177
with:
142178
name: gnu-root-full-result
143179
path: ${{ env.TEST_ROOT_FULL_SUMMARY_FILE }}
180+
- name: Upload stty json results
181+
uses: actions/upload-artifact@v5
182+
with:
183+
name: gnu-stty-full-result
184+
path: ${{ env.TEST_STTY_FULL_SUMMARY_FILE }}
185+
144186
- name: Compress test logs
145187
shell: bash
146188
run : |
@@ -160,10 +202,20 @@ jobs:
160202
steps:
161203
#### Get the code, setup cache
162204
- name: Checkout code (uutils)
163-
uses: actions/checkout@v5
205+
uses: actions/checkout@v6
164206
with:
165207
path: 'uutils'
166208
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}"
167219
- uses: dtolnay/rust-toolchain@master
168220
with:
169221
toolchain: stable
@@ -172,7 +224,7 @@ jobs:
172224
with:
173225
workspaces: "./uutils -> target"
174226
- name: Checkout code (GNU coreutils)
175-
uses: actions/checkout@v5
227+
uses: actions/checkout@v6
176228
with:
177229
repository: 'coreutils/coreutils'
178230
path: 'gnu'
@@ -197,9 +249,7 @@ jobs:
197249
path: ~/.cache/lima
198250
key: lima-${{ steps.lima-actions-setup.outputs.version }}
199251
- 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
252+
run: limactl start --plain --name=default --cpus=4 --disk=40 --memory=8 --network=lima:user-v2 template:fedora
203253
- name: Verify SELinux Status and Configuration
204254
run: |
205255
lima getenforce
@@ -218,7 +268,7 @@ jobs:
218268
- name: Install dependencies in VM
219269
run: |
220270
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
271+
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
222272
lima rustup-init -y --default-toolchain stable
223273
- name: Copy the sources to VM
224274
run: |
@@ -227,7 +277,7 @@ jobs:
227277
### Build
228278
- name: Build binaries
229279
run: |
230-
lima bash -c "cd ~/work/uutils/ && bash util/build-gnu.sh --release-build"
280+
lima bash -c "cd ~/work/uutils/ && SELINUX_ENABLED=1 PROFILE=release-small bash util/build-gnu.sh"
231281
232282
### Run tests as user
233283
- name: Generate SELinux tests list
@@ -311,7 +361,7 @@ jobs:
311361
312362
outputs TEST_SUMMARY_FILE AGGREGATED_SUMMARY_FILE
313363
- name: Checkout code (uutils)
314-
uses: actions/checkout@v5
364+
uses: actions/checkout@v6
315365
with:
316366
path: 'uutils'
317367
persist-credentials: false
@@ -337,6 +387,13 @@ jobs:
337387
name: gnu-root-full-result
338388
path: results
339389
merge-multiple: true
390+
- name: Download stty json results
391+
uses: actions/download-artifact@v6
392+
with:
393+
name: gnu-stty-full-result
394+
path: results
395+
merge-multiple: true
396+
340397
- name: Download selinux json results
341398
uses: actions/download-artifact@v6
342399
with:
@@ -359,7 +416,7 @@ jobs:
359416
path_UUTILS='uutils'
360417
361418
json_count=$(ls -l results/*.json | wc -l)
362-
if [[ "$json_count" -ne 4 ]]; then
419+
if [[ "$json_count" -ne 5 ]]; then
363420
echo "::error ::Failed to download all results json files (expected 4 files, found $json_count); failing early"
364421
ls -lR results || true
365422
exit 1

.github/workflows/android.yml

Lines changed: 5 additions & 10 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 swiftshader_indirect -metrics-collection
25+
COMMON_EMULATOR_OPTIONS: -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
@@ -36,15 +36,10 @@ jobs:
3636
matrix:
3737
os: [ubuntu-latest] # , macos-latest
3838
cores: [4] # , 6
39-
ram: [4096, 8192]
39+
ram: [4096]
4040
api-level: [28]
4141
target: [google_apis_playstore]
4242
arch: [x86, x86_64] # , arm64-v8a
43-
exclude:
44-
- ram: 8192
45-
arch: x86
46-
- ram: 4096
47-
arch: x86_64
4843
runs-on: ${{ matrix.os }}
4944
env:
5045
EMULATOR_RAM_SIZE: ${{ matrix.ram }}
@@ -80,7 +75,7 @@ jobs:
8075
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
8176
sudo udevadm control --reload-rules
8277
sudo udevadm trigger --name-match=kvm
83-
- uses: actions/checkout@v5
78+
- uses: actions/checkout@v6
8479
with:
8580
persist-credentials: false
8681
- name: Collect information about runner
@@ -116,7 +111,7 @@ jobs:
116111
~/.android/avd/*/*.lock
117112
- name: Create and cache emulator image
118113
if: steps.avd-cache.outputs.cache-hit != 'true'
119-
uses: reactivecircus/android-emulator-runner@v2.34.0
114+
uses: reactivecircus/android-emulator-runner@v2.35.0
120115
with:
121116
api-level: ${{ matrix.api-level }}
122117
target: ${{ matrix.target }}
@@ -161,7 +156,7 @@ jobs:
161156
free -mh
162157
df -Th
163158
- name: Build and Test
164-
uses: reactivecircus/android-emulator-runner@v2.34.0
159+
uses: reactivecircus/android-emulator-runner@v2.35.0
165160
with:
166161
api-level: ${{ matrix.api-level }}
167162
target: ${{ matrix.target }}

.github/workflows/benchmarks.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
matrix:
2525
benchmark-target:
2626
- { package: uu_base64 }
27+
- { package: uu_cksum }
2728
- { package: uu_cp }
2829
- { package: uu_cut }
2930
- { package: uu_du }
@@ -36,14 +37,16 @@ jobs:
3637
- { package: uu_numfmt }
3738
- { package: uu_rm }
3839
- { package: uu_seq }
40+
- { package: uu_shuf }
3941
- { package: uu_sort }
4042
- { package: uu_split }
4143
- { package: uu_tsort }
4244
- { package: uu_unexpand }
4345
- { package: uu_uniq }
4446
- { package: uu_wc }
47+
- { package: uu_factor }
4548
steps:
46-
- uses: actions/checkout@v5
49+
- uses: actions/checkout@v6
4750
with:
4851
persist-credentials: false
4952

0 commit comments

Comments
 (0)