Skip to content

Commit 1987046

Browse files
authored
Merge branch 'main' into stty-fix-hex
2 parents 8eaf946 + ec7e81e commit 1987046

381 files changed

Lines changed: 6243 additions & 2986 deletions

File tree

Some content is hidden

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

.cargo/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ rustflags = ["-C", "target-feature=+crt-static"]
1212
[env]
1313
# See feat_external_libstdbuf in src/uu/stdbuf/Cargo.toml
1414
LIBSTDBUF_DIR = "/usr/local/libexec/coreutils"
15+
16+
# remove me
17+
[build]
18+
rustflags = ["-A", "clippy::collapsible_if"]

.clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
msrv = "1.85.0"
21
avoid-breaking-exported-api = false
32
check-private-items = true
43
cognitive-complexity-threshold = 24
54
missing-docs-in-crate-items = true
5+
allow-mixed-uninlined-format-args = false

.github/workflows/CICD.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ name: CICD
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
8-
# spell-checker:ignore (misc) aarch alnum armhf bindir busytest coreutils defconfig DESTDIR gecos getenforce gnueabihf issuecomment maint manpages msys multisize noconfirm nofeatures nullglob onexitbegin onexitend pell runtest Swatinem tempfile testsuite toybox uutils libsystemd codspeed
8+
# spell-checker:ignore (misc) aarch alnum armhf bindir busytest coreutils defconfig DESTDIR gecos getenforce gnueabihf issuecomment maint manpages msys multisize noconfirm nofeatures nullglob onexitbegin onexitend pell runtest Swatinem tempfile testsuite toybox uutils libsystemd codspeed wasip
99

1010
env:
1111
PROJECT_NAME: coreutils
1212
PROJECT_DESC: "Core universal (cross-platform) utilities"
1313
PROJECT_AUTH: "uutils"
14-
RUST_MIN_SRV: "1.85.0"
14+
RUST_MIN_SRV: "1.88.0"
1515
# * style job configuration
1616
STYLE_FAIL_ON_FAULT: true ## (bool) fail the build if a style job contains a fault (error or warning); may be overridden on a per-job basis
1717

@@ -322,13 +322,13 @@ jobs:
322322
disable_search: true
323323
flags: makefile,${{ matrix.job.os }}
324324
fail_ci_if_error: false
325-
- name: "`make install PROG_PREFIX=uu- PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n`"
325+
- name: "`make install PROG_PREFIX=uu- PROFILE=release-small COMPLETIONS=n MANPAGES=n LOCALES=n`"
326326
shell: bash
327327
run: |
328328
set -x
329-
DESTDIR=/tmp/ make install PROG_PREFIX=uu- PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n
329+
DESTDIR=/tmp/ make install PROG_PREFIX=uu- PROFILE=release-small COMPLETIONS=n MANPAGES=n LOCALES=n
330330
# Check that utils are built with given profile
331-
./target/release-fast/true
331+
./target/release-small/true
332332
# Check that the progs have prefix
333333
test -f /tmp/usr/local/bin/uu-tty
334334
test -f /tmp/usr/local/libexec/uu-coreutils/libstdbuf.*
@@ -501,10 +501,10 @@ jobs:
501501
- uses: Swatinem/rust-cache@v2
502502
- name: Run sccache-cache
503503
uses: mozilla-actions/sccache-action@v0.0.9
504-
- name: "`make install PROFILE=release-fast`"
504+
- name: "`make install PROFILE=release`"
505505
shell: bash
506506
run: |
507-
export CARGO_TARGET_DIR=cargo-target RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" PROFILE=release-fast MANPAGES=n COMPLETIONS=n LOCALES=n
507+
export CARGO_TARGET_DIR=cargo-target RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" PROFILE=release MANPAGES=n COMPLETIONS=n LOCALES=n
508508
mkdir -p "${CARGO_TARGET_DIR}" && sudo mount -t tmpfs -o noatime,size=16G tmpfs "${CARGO_TARGET_DIR}"
509509
make install DESTDIR=target/size-release/
510510
make install COMPLETIONS=n MULTICALL=y LN="ln -vf" DESTDIR=target/size-multi-release/
@@ -631,7 +631,7 @@ jobs:
631631
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: "feat_os_unix,uudoc" , use-cross: no, workspace-tests: true }
632632
- { os: ubuntu-latest , target: x86_64-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross }
633633
- { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true }
634-
- { os: ubuntu-latest , target: wasm32-unknown-unknown , default-features: false, features: uucore/format, skip-tests: true, skip-package: true, skip-publish: true }
634+
- { os: ubuntu-latest , target: wasm32-wasip1, default-features: false, features: "basenc,cksum", skip-tests: true }
635635
- { os: macos-latest , target: aarch64-apple-darwin , features: feat_os_macos, workspace-tests: true } # M1 CPU
636636
# PR #7964: Mac should still build even if the feature is not enabled. Do not publish this.
637637
- { os: macos-latest , target: aarch64-apple-darwin , workspace-tests: true, skip-publish: true } # M1 CPU
@@ -672,7 +672,11 @@ jobs:
672672
STAGING='_staging'
673673
outputs STAGING
674674
# determine EXE suffix
675-
EXE_suffix="" ; case '${{ matrix.job.target }}' in *-pc-windows-*) EXE_suffix=".exe" ;; esac;
675+
unset EXE_suffix
676+
case '${{ matrix.job.target }}' in
677+
*-pc-windows-*) EXE_suffix=".exe" ;;
678+
*wasm-*) EXE_suffix=".wasm" ;;
679+
esac;
676680
outputs EXE_suffix
677681
# parse commit reference info
678682
echo GITHUB_REF=${GITHUB_REF}
@@ -868,7 +872,7 @@ jobs:
868872
run: |
869873
## Package artifact(s)
870874
# binaries
871-
cp 'target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
875+
cp 'target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}'* '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
872876
cp 'target/${{ matrix.job.target }}/release/uudoc${{ steps.vars.outputs.EXE_suffix }}' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/' || :
873877
# README and LICENSE
874878
# * spell-checker:ignore EADME ICENSE

.github/workflows/GnuComment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ jobs:
5959
issue_number: issue_number,
6060
body: 'GNU testsuite comparison:\n```\n' + content + '```'
6161
});
62-
}
62+
}

.github/workflows/audit.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Security audit
2+
3+
# spell-checker:ignore (misc) rustsec
4+
5+
on:
6+
schedule:
7+
- cron: "0 0 * * *"
8+
jobs:
9+
audit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v6
13+
- uses: rustsec/audit-check@v2
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Get current version from Cargo.toml
4343
id: version
4444
run: |
45-
VERSION=$(awk '/\[workspace\.package\]/{flag=1; next} flag && /version = /{gsub(/.*= "/, ""); gsub(/".*/, ""); print; exit}' Cargo.toml)
45+
VERSION=$(awk '/\[workspace\.package\]/{flag=1; next} flag && /^version = /{gsub(/.*= "/, ""); gsub(/".*/, ""); print; exit}' Cargo.toml)
4646
echo "version=$VERSION" >> $GITHUB_OUTPUT
4747
echo "Detected version: $VERSION"
4848

.github/workflows/freebsd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
with:
3636
persist-credentials: false
3737
- name: Prepare, build and test
38-
uses: vmactions/freebsd-vm@v1.2.9
38+
uses: vmactions/freebsd-vm@v1.3.9
3939
with:
4040
usesh: true
4141
sync: rsync
@@ -127,7 +127,7 @@ jobs:
127127
- name: Avoid no space left on device (Ubuntu runner)
128128
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android &
129129
- name: Prepare, build and test
130-
uses: vmactions/freebsd-vm@v1.2.9
130+
uses: vmactions/freebsd-vm@v1.3.9
131131
with:
132132
usesh: true
133133
sync: rsync

.github/workflows/fuzzing.yml

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Fuzzing
22

3-
# spell-checker:ignore fuzzer dtolnay Swatinem
3+
# spell-checker:ignore (people) dtolnay Swatinem taiki-e
4+
# spell-checker:ignore (misc) fuzzer
45

56
on:
67
pull_request:
@@ -19,16 +20,13 @@ concurrency:
1920
jobs:
2021
uufuzz-examples:
2122
name: Build and test uufuzz examples
23+
env:
24+
CARGO_INCREMENTAL: 0
2225
runs-on: ubuntu-latest
2326
steps:
2427
- uses: actions/checkout@v6
2528
with:
2629
persist-credentials: false
27-
- uses: dtolnay/rust-toolchain@stable
28-
- uses: Swatinem/rust-cache@v2
29-
with:
30-
shared-key: "uufuzz-cache-key"
31-
cache-directories: "fuzz/target"
3230
- name: Build uufuzz library
3331
run: |
3432
cd fuzz/uufuzz
@@ -59,15 +57,16 @@ jobs:
5957
with:
6058
persist-credentials: false
6159
- name: Install `cargo-fuzz`
62-
run: |
63-
echo "RUSTC_BOOTSTRAP=1" >> "${GITHUB_ENV}" # Use -Z
64-
cargo install cargo-fuzz --locked
65-
- uses: Swatinem/rust-cache@v2
60+
uses: taiki-e/install-action@v2
6661
with:
67-
shared-key: "cargo-fuzz-cache-key"
68-
cache-directories: "fuzz/target"
62+
tool: cargo-fuzz
63+
- name: Emulate a nightly toolchain
64+
run: |
65+
echo "RUSTC_BOOTSTRAP=1" >> "${GITHUB_ENV}"
6966
- name: Run `cargo-fuzz build`
70-
run: cargo fuzz build
67+
# Force the correct target
68+
# https://github.com/rust-fuzz/cargo-fuzz/issues/398
69+
run: cargo fuzz build --target $(rustc --print host-tuple)
7170

7271
fuzz-run:
7372
needs: fuzz-build
@@ -76,6 +75,7 @@ jobs:
7675
timeout-minutes: 5
7776
env:
7877
RUN_FOR: 60
78+
CARGO_INCREMENTAL: 0
7979
strategy:
8080
matrix:
8181
test-target:
@@ -104,27 +104,22 @@ jobs:
104104
with:
105105
persist-credentials: false
106106
- name: Install `cargo-fuzz`
107-
run: |
108-
echo "RUSTC_BOOTSTRAP=1" >> "${GITHUB_ENV}" # Use nightly
109-
cargo install cargo-fuzz --locked
110-
- uses: Swatinem/rust-cache@v2
107+
uses: taiki-e/install-action@v2
111108
with:
112-
shared-key: "cargo-fuzz-cache-key"
113-
cache-directories: "fuzz/target"
114-
- name: Restore Cached Corpus
115-
uses: actions/cache/restore@v5
116-
with:
117-
key: corpus-cache-${{ matrix.test-target.name }}
118-
path: |
119-
fuzz/corpus/${{ matrix.test-target.name }}
109+
tool: cargo-fuzz
110+
- name: Emulate a nightly toolchain
111+
run: |
112+
echo "RUSTC_BOOTSTRAP=1" >> "${GITHUB_ENV}"
120113
- name: Run ${{ matrix.test-target.name }} for XX seconds
121114
id: run_fuzzer
122115
shell: bash
123116
continue-on-error: ${{ !matrix.test-target.should_pass }}
124117
run: |
125118
mkdir -p fuzz/stats
126119
STATS_FILE="fuzz/stats/${{ matrix.test-target.name }}.txt"
127-
cargo fuzz run ${{ matrix.test-target.name }} -- -max_total_time=${{ env.RUN_FOR }} -timeout=${{ env.RUN_FOR }} -detect_leaks=0 -print_final_stats=1 2>&1 | tee "$STATS_FILE"
120+
# Force the correct target
121+
# https://github.com/rust-fuzz/cargo-fuzz/issues/398
122+
cargo fuzz run --target $(rustc --print host-tuple) ${{ matrix.test-target.name }} -- -max_total_time=${{ env.RUN_FOR }} -timeout=${{ env.RUN_FOR }} -detect_leaks=0 -print_final_stats=1 2>&1 | tee "$STATS_FILE"
128123
129124
# Extract key stats from the output
130125
if grep -q "stat::number_of_executed_units" "$STATS_FILE"; then
@@ -193,12 +188,6 @@ jobs:
193188
fi
194189
195190
echo "" >> $GITHUB_STEP_SUMMARY
196-
- name: Save Corpus Cache
197-
uses: actions/cache/save@v5
198-
with:
199-
key: corpus-cache-${{ matrix.test-target.name }}
200-
path: |
201-
fuzz/corpus/${{ matrix.test-target.name }}
202191
- name: Upload Stats
203192
uses: actions/upload-artifact@v6
204193
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ lib*.a
2121

2222
### direnv ###
2323
/.direnv/
24+
25+
*.code-workspace

.markdownlint.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ MD013: false
33
# Disable 'Fenced code blocks should have a language specified'
44
# Doesn't provide much in src/ to enforce it
55
MD040: false
6-

0 commit comments

Comments
 (0)