Skip to content

Commit 64c9dda

Browse files
authored
Merge branch 'main' into followup-10036
2 parents 29061b6 + 938039e commit 64c9dda

File tree

142 files changed

+2208
-765
lines changed

Some content is hidden

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

142 files changed

+2208
-765
lines changed

.github/workflows/CICD.yml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CICD
22

33
# spell-checker:ignore (abbrev/names) CACHEDIR CICD CodeCOV MacOS MinGW MSVC musl taiki
4-
# spell-checker:ignore (env/flags) Awarnings Ccodegen Coverflow Cpanic Dwarnings RUSTDOCFLAGS RUSTFLAGS Zpanic CARGOFLAGS
4+
# spell-checker:ignore (env/flags) Awarnings Ccodegen Coverflow Cpanic Dwarnings RUSTDOCFLAGS RUSTFLAGS Zpanic CARGOFLAGS CLEVEL
55
# spell-checker:ignore (jargon) SHAs deps dequote softprops subshell toolchain fuzzers dedupe devel profdata
66
# spell-checker:ignore (people) Peltoche rivy dtolnay Anson dawidd
77
# spell-checker:ignore (shell/tools) binutils choco clippy dmake esac fakeroot fdesc fdescfs gmake grcov halium lcov libclang libfuse libssl limactl mkdir nextest nocross pacman popd printf pushd redoxer rsync rustc rustfmt rustup shopt sccache utmpdump xargs zstd
@@ -298,6 +298,8 @@ jobs:
298298
fi
299299
# Check that we don't cross-build uudoc
300300
env CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu make install-manpages PREFIX=/tmp/usr UTILS=true
301+
# We don't build coreutils without MULTICALL=y
302+
! test -e target/debug/coreutils
301303
# build (host)
302304
make build
303305
echo "Check that target directory will be ignored by backup tools"
@@ -477,6 +479,8 @@ jobs:
477479
name: Binary sizes
478480
needs: [ min_version, deps ]
479481
runs-on: ${{ matrix.job.os }}
482+
permissions:
483+
contents: write
480484
env:
481485
SCCACHE_GHA_ENABLED: "true"
482486
RUSTC_WRAPPER: "sccache"
@@ -493,18 +497,25 @@ jobs:
493497
- uses: Swatinem/rust-cache@v2
494498
- name: Run sccache-cache
495499
uses: mozilla-actions/sccache-action@v0.0.9
496-
- name: Install dependencies
500+
- name: "`make install PROFILE=release-fast`"
497501
shell: bash
498502
run: |
499-
## Install dependencies
500-
sudo apt-get update
501-
sudo apt-get install libselinux1-dev libsystemd-dev
502-
- name: "`make install`"
503-
shell: bash
504-
run: |
505-
## `make install`
506-
RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" make install DESTDIR=target/size-release/
507-
RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" make install MULTICALL=y LN="ln -vf" DESTDIR=target/size-multi-release/
503+
export CARGO_TARGET_DIR=cargo-target RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" PROFILE=release-fast MANPAGES=n COMPLETIONS=n LOCALES=n
504+
mkdir -p "${CARGO_TARGET_DIR}" && sudo mount -t tmpfs -o noatime,size=16G tmpfs "${CARGO_TARGET_DIR}"
505+
make install DESTDIR=target/size-release/
506+
make install COMPLETIONS=n MULTICALL=y LN="ln -vf" DESTDIR=target/size-multi-release/
507+
ZSTD_CLEVEL=19 tar --zstd -caf individual-x86_64-unknown-linux-gnu.tar.zst -C target/size-release/usr/local bin
508+
- name: Publish
509+
uses: softprops/action-gh-release@v2
510+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
511+
with:
512+
tag_name: latest-commit
513+
draft: false
514+
prerelease: true
515+
files: |
516+
individual-x86_64-unknown-linux-gnu.tar.zst
517+
env:
518+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
508519
- name: Test for hardlinks
509520
shell: bash
510521
run: |
@@ -837,16 +848,8 @@ jobs:
837848
run: |
838849
## Test
839850
${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} test --target=${{ matrix.job.target }} \
840-
${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }}
841-
env:
842-
RUST_BACKTRACE: "1"
843-
- name: Test individual utilities
844-
if: matrix.job.skip-tests != true
845-
shell: bash
846-
run: |
847-
## Test individual utilities
848-
${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} test --target=${{ matrix.job.target }} \
849-
${{ matrix.job.cargo-options }} ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
851+
${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }} \
852+
${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }} -p coreutils
850853
env:
851854
RUST_BACKTRACE: "1"
852855
- name: Archive executable artifacts
@@ -1277,7 +1280,6 @@ jobs:
12771280
- uses: actions/checkout@v6
12781281
with:
12791282
persist-credentials: false
1280-
- uses: dtolnay/rust-toolchain@stable
12811283
- name: Setup Lima
12821284
uses: lima-vm/lima-actions/setup@v1
12831285
id: lima-actions-setup
@@ -1292,17 +1294,17 @@ jobs:
12921294
- name: Setup Rust and other build deps in VM
12931295
run: |
12941296
lima sudo dnf install gcc g++ git rustup libselinux-devel clang-devel attr -y
1295-
lima rustup-init -y --default-toolchain stable
1297+
lima rustup-init -y --default-toolchain stable --profile minimal -c clippy
12961298
- name: Verify SELinux Status
12971299
run: |
12981300
lima getenforce
12991301
lima ls -laZ /etc/selinux
13001302
- name: Build and Test with SELinux
13011303
run: |
13021304
lima ls
1303-
lima bash -c "cd work && cargo test --features 'feat_selinux'"
1305+
lima bash -c "cd work && cargo test --features 'feat_selinux' --no-default-features"
13041306
- name: Lint with SELinux
1305-
run: lima bash -c "cd work && cargo clippy --all-targets --features 'feat_selinux' -- -D warnings"
1307+
run: lima bash -c "cd work && cargo clippy --all-targets --features 'feat_selinux' --no-default-features -- -D warnings"
13061308

13071309
test_selinux_stubs:
13081310
name: Build/SELinux-Stubs (Non-Linux)
@@ -1345,6 +1347,6 @@ jobs:
13451347
- name: Install strace
13461348
run: sudo apt-get update && sudo apt-get install -y strace
13471349
- name: Build utilities with safe traversal
1348-
run: cargo build --release -p uu_rm -p uu_chmod -p uu_chown -p uu_chgrp -p uu_mv -p uu_du
1350+
run: cargo build --profile=release-small -p uu_rm -p uu_chmod -p uu_chown -p uu_chgrp -p uu_mv -p uu_du
13491351
- name: Run safe traversal verification
13501352
run: ./util/check-safe-traversal.sh

.github/workflows/android.yml

Lines changed: 3 additions & 3 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 }}
@@ -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-metrics -no-snapshot-save -snapshot ${{ env.AVD_CACHE_KEY }}
169+
emulator-options: ${{ env.COMMON_EMULATOR_OPTIONS }} -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

.github/workflows/benchmarks.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
type: [performance, memory]
25+
type: [simulation] # , memory] # memory profile disabled due to variance
2626
package: [
2727
uu_base64,
2828
uu_cksum,
@@ -62,6 +62,14 @@ jobs:
6262
- name: Run sccache-cache
6363
uses: mozilla-actions/sccache-action@v0.0.9
6464

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+
6573
- name: Install cargo-codspeed
6674
shell: bash
6775
run: cargo install cargo-codspeed --locked
@@ -70,18 +78,14 @@ jobs:
7078
shell: bash
7179
run: |
7280
echo "Building ${{ matrix.type }} benchmarks for ${{ matrix.package }}"
73-
if [ "${{ matrix.type }}" = "memory" ]; then
74-
cargo codspeed build -m analysis -p ${{ matrix.package }}
75-
else
76-
cargo codspeed build -p ${{ matrix.package }}
77-
fi
81+
cargo codspeed build -m ${{ matrix.type }} -p ${{ matrix.package }}
7882
7983
- name: Run ${{ matrix.type }} benchmarks for ${{ matrix.package }}
8084
uses: CodSpeedHQ/action@v4
8185
env:
8286
CODSPEED_LOG: debug
8387
with:
84-
mode: ${{ matrix.type == 'memory' && 'memory' || 'simulation' }}
88+
mode: ${{ matrix.type }}
8589
run: |
8690
echo "Running ${{ matrix.type }} benchmarks for ${{ matrix.package }}"
8791
cargo codspeed run -p ${{ matrix.package }} > /dev/null

.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: 1 addition & 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,19 +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
136126
- name: Avoid no space left on device (Ubuntu runner)
137127
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android &
138-
- uses: Swatinem/rust-cache@v2
139-
- name: Run sccache-cache
140-
uses: mozilla-actions/sccache-action@v0.0.9
141-
with:
142-
disable_annotations: true
143128
- name: Prepare, build and test
144129
uses: vmactions/freebsd-vm@v1.2.9
145130
with:

.github/workflows/l10n.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ jobs:
735735
run: |
736736
## Download additional locale files from coreutils-l10n repository
737737
echo "Downloading additional locale files from coreutils-l10n..."
738-
git clone https://github.com/uutils/coreutils-l10n.git coreutils-l10n-repo
738+
git clone --depth=1 https://github.com/uutils/coreutils-l10n.git coreutils-l10n-repo
739739
740740
# Create installation directory
741741
CARGO_INSTALL_DIR="$PWD/cargo-install-dir"

.github/workflows/openbsd.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ jobs:
4747
prepare: |
4848
# Clean up disk space before installing packages
4949
df -h
50-
rm -rf /usr/share/relink/* /usr/X11R6/* /usr/share/doc/* /usr/share/man/* || :
5150
pkg_add curl sudo-- jq coreutils bash rust rust-clippy rust-rustfmt llvm--
51+
rm -rf /usr/share/relink/* /usr/X11R6/* /usr/share/doc/* /usr/share/man/* &
5252
# Clean up package cache after installation
53-
pkg_delete -a || true
53+
pkg_delete -a &
5454
df -h
5555
run: |
5656
## Prepare, build, and test
@@ -137,15 +137,15 @@ jobs:
137137
usesh: true
138138
sync: rsync
139139
copyback: false
140-
mem: 4096
140+
mem: 6144
141141
# Install rust and build dependencies from OpenBSD packages (llvm provides libclang for bindgen)
142142
prepare: |
143143
# Clean up disk space before installing packages
144144
df -h
145-
rm -rf /usr/share/relink/* /usr/X11R6/* /usr/share/doc/* /usr/share/man/* || :
145+
rm -rf /usr/share/relink/* /usr/X11R6/* /usr/share/doc/* /usr/share/man/* &
146146
pkg_add curl gmake sudo-- jq rust llvm--
147147
# Clean up package cache after installation
148-
pkg_delete -a || :
148+
pkg_delete -a &
149149
df -h
150150
run: |
151151
## Prepare, build, and test
@@ -194,7 +194,7 @@ jobs:
194194
set +e
195195
cd "${WORKSPACE}"
196196
unset FAULT
197-
cargo build || FAULT=1
197+
# openbsd is very slow. Omit duplicated cargo build and do test only
198198
export PATH=~/.cargo/bin:${PATH}
199199
export RUST_BACKTRACE=1
200200
export CARGO_TERM_COLOR=always
@@ -208,7 +208,7 @@ jobs:
208208
cargo test --features "\$UUCORE_FEATURES" -p uucore || FAULT=1
209209
fi
210210
# Test building with make
211-
if (test -z "\$FAULT"); then make || FAULT=1 ; fi
211+
if (test -z "\$FAULT"); then make MULTICALL=Y || FAULT=1 ; fi
212212
# Clean to avoid to rsync back the files and free up disk space
213213
cargo clean
214214
# Additional cleanup to free disk space

0 commit comments

Comments
 (0)