Skip to content

Commit d5cf925

Browse files
authored
Merge branch 'main' into chmod_FD_fix
2 parents 45a3778 + 425b232 commit d5cf925

File tree

100 files changed

+2885
-1279
lines changed

Some content is hidden

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

100 files changed

+2885
-1279
lines changed

.github/workflows/CICD.yml

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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
7-
# 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
7+
# 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
88
# 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
99

1010
env:
@@ -196,7 +196,7 @@ jobs:
196196
## Confirm MinSRV compatible '*/Cargo.lock'
197197
# * '*/Cargo.lock' is required to be in a format that `cargo` of MinSRV can interpret (eg, v1-format for MinSRV < v1.38)
198198
for dir in "." "fuzz"; do
199-
( cd "$dir" && cargo fetch --locked --quiet ) || { echo "::error file=$dir/Cargo.lock::Incompatible (or out-of-date) '$dir/Cargo.lock' file; update using \`cd '$dir' && cargo +${{ env.RUST_MIN_SRV }} update\`" ; exit 1 ; }
199+
( cd "$dir" && cargo fetch --locked --quiet --target $(rustc --print host-tuple)) || { echo "::error file=$dir/Cargo.lock::Incompatible (or out-of-date) '$dir/Cargo.lock' file; update using \`cd '$dir' && cargo +${{ env.RUST_MIN_SRV }} update\`" ; exit 1 ; }
200200
done
201201
- name: Install/setup prerequisites
202202
shell: bash
@@ -221,7 +221,7 @@ jobs:
221221
# dependencies
222222
echo "## dependency list"
223223
## * using the 'stable' toolchain is necessary to avoid "unexpected '--filter-platform'" errors
224-
RUSTUP_TOOLCHAIN=stable cargo fetch --locked --quiet
224+
RUSTUP_TOOLCHAIN=stable cargo fetch --locked --quiet --target $(rustc --print host-tuple)
225225
RUSTUP_TOOLCHAIN=stable cargo tree --no-dedupe --locked -e=no-dev --prefix=none ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} | grep -vE "$PWD" | sort --unique
226226
- name: Test
227227
run: cargo nextest run --hide-progress-bar --profile ci ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -p uucore -p coreutils
@@ -259,7 +259,7 @@ jobs:
259259
## `cargo update` testing
260260
# * convert any errors/warnings to GHA UI annotations; ref: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message>
261261
for dir in "." "fuzz"; do
262-
( cd "$dir" && cargo fetch --locked --quiet ) || { echo "::error file=$dir/Cargo.lock::'$dir/Cargo.lock' file requires update (use \`cd '$dir' && cargo +${{ env.RUST_MIN_SRV }} update\`)" ; exit 1 ; }
262+
( cd "$dir" && cargo fetch --locked --quiet --target $(rustc --print host-tuple)) || { echo "::error file=$dir/Cargo.lock::'$dir/Cargo.lock' file requires update (use \`cd '$dir' && cargo +${{ env.RUST_MIN_SRV }} update\`)" ; exit 1 ; }
263263
done
264264
265265
build_makefile:
@@ -297,7 +297,6 @@ jobs:
297297
mv -T target target.cache
298298
fi
299299
# Check that we don't cross-build uudoc
300-
# also do not try to generate manpages for part of hashsum
301300
env CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu make install-manpages PREFIX=/tmp/usr UTILS=true
302301
# build (host)
303302
make build
@@ -371,25 +370,19 @@ jobs:
371370
run: |
372371
set -x
373372
DESTDIR=/tmp/ make PROFILE=release MULTICALL=n install
374-
# Check that the utils are present
375-
test -f /tmp/usr/local/bin/hashsum
376-
# Check that hashsum symlinks are present
377-
test -h /tmp/usr/local/bin/b2sum
378-
test -h /tmp/usr/local/bin/md5sum
379-
test -h /tmp/usr/local/bin/sha1sum
380-
test -h /tmp/usr/local/bin/sha224sum
381-
test -h /tmp/usr/local/bin/sha256sum
382-
test -h /tmp/usr/local/bin/sha384sum
383-
test -h /tmp/usr/local/bin/sha512sum
373+
# Check that *sum are present
374+
for s in {md5,b2,sha1,sha224,sha256,sha384,sha512}sum
375+
do test -e /tmp/usr/local/bin/${s}
376+
done
384377
- name: "`make install MULTICALL=y LN=ln -svf`"
385378
shell: bash
386379
run: |
387380
set -x
388381
DESTDIR=/tmp/ make PROFILE=release MULTICALL=y LN="ln -svf" install
389-
# Check that relative symlinks of hashsum are present
390-
[ $(readlink /tmp/usr/local/bin/b2sum) = coreutils ]
391-
[ $(readlink /tmp/usr/local/bin/md5sum) = coreutils ]
392-
[ $(readlink /tmp/usr/local/bin/sha512sum) = coreutils ]
382+
# Check that symlinks of *sum are present
383+
for s in {md5,b2,sha1,sha224,sha256,sha384,sha512}sum
384+
do test $(readlink /tmp/usr/local/bin/${s}) = coreutils
385+
done
393386
- name: "`make UTILS=XXX`"
394387
shell: bash
395388
run: |
@@ -484,6 +477,8 @@ jobs:
484477
name: Binary sizes
485478
needs: [ min_version, deps ]
486479
runs-on: ${{ matrix.job.os }}
480+
permissions:
481+
contents: write
487482
env:
488483
SCCACHE_GHA_ENABLED: "true"
489484
RUSTC_WRAPPER: "sccache"
@@ -500,20 +495,25 @@ jobs:
500495
- uses: Swatinem/rust-cache@v2
501496
- name: Run sccache-cache
502497
uses: mozilla-actions/sccache-action@v0.0.9
503-
- name: Install dependencies
498+
- name: "`make install PROFILE=release-fast`"
504499
shell: bash
505500
run: |
506-
## Install dependencies
507-
sudo apt-get update
508-
sudo apt-get install libselinux1-dev libsystemd-dev
509-
- name: "`make install`"
510-
shell: bash
511-
run: |
512-
## `make install`
501+
export CARGO_TARGET_DIR=cargo-target RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" PROFILE=release-fast MANPAGES=n COMPLETIONS=n LOCALES=n
502+
mkdir -p "${CARGO_TARGET_DIR}" && sudo mount -t tmpfs -o noatime,size=16G tmpfs "${CARGO_TARGET_DIR}"
513503
make install DESTDIR=target/size-release/
514-
make install MULTICALL=y LN="ln -vf" DESTDIR=target/size-multi-release/
515-
# strip the results
516-
strip target/size*/usr/local/bin/*
504+
make install COMPLETIONS=n MULTICALL=y LN="ln -vf" DESTDIR=target/size-multi-release/
505+
ZSTD_CLEVEL=19 tar --zstd -caf individual-x86_64-unknown-linux-gnu.tar.zst -C target/size-release/usr/local bin
506+
- name: Publish
507+
uses: softprops/action-gh-release@v2
508+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
509+
with:
510+
tag_name: latest-commit
511+
draft: false
512+
prerelease: true
513+
files: |
514+
individual-x86_64-unknown-linux-gnu.tar.zst
515+
env:
516+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
517517
- name: Test for hardlinks
518518
shell: bash
519519
run: |
@@ -637,6 +637,8 @@ jobs:
637637
- uses: actions/checkout@v6
638638
with:
639639
persist-credentials: false
640+
- name: Avoid no space left on device
641+
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android &
640642
- uses: dtolnay/rust-toolchain@master
641643
with:
642644
toolchain: ${{ env.RUST_MIN_SRV }}
@@ -692,7 +694,7 @@ jobs:
692694
outputs TARGET_ARCH TARGET_OS
693695
# package name
694696
PKG_suffix=".tar.gz" ; case '${{ matrix.job.target }}' in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
695-
PKG_BASENAME=${PROJECT_NAME}-${REF_TAG:-$REF_SHAS}-${{ matrix.job.target }}
697+
PKG_BASENAME=${PROJECT_NAME}-${{ matrix.job.target }}
696698
PKG_NAME=${PKG_BASENAME}${PKG_suffix}
697699
outputs PKG_suffix PKG_BASENAME PKG_NAME
698700
# deployable tag? (ie, leading "vM" or "M"; M == version number)
@@ -737,16 +739,6 @@ jobs:
737739
CARGO_TEST_OPTIONS='--workspace'
738740
;;
739741
esac
740-
outputs CARGO_TEST_OPTIONS
741-
# * executable for `strip`?
742-
STRIP="strip"
743-
case ${{ matrix.job.target }} in
744-
aarch64-*-linux-*) STRIP="aarch64-linux-gnu-strip" ;;
745-
riscv64gc-*-linux-*) STRIP="riscv64-linux-gnu-strip" ;;
746-
arm-*-linux-gnueabihf) STRIP="arm-linux-gnueabihf-strip" ;;
747-
*-pc-windows-msvc) STRIP="" ;;
748-
esac;
749-
outputs STRIP
750742
- uses: taiki-e/install-action@v2
751743
if: steps.vars.outputs.CARGO_CMD == 'cross'
752744
with:
@@ -840,13 +832,13 @@ jobs:
840832
cargo tree -V
841833
# dependencies
842834
echo "## dependency list"
843-
cargo fetch --locked --quiet
835+
cargo fetch --locked --quiet --target $(rustc --print host-tuple)
844836
cargo tree --locked --target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }} --no-dedupe -e=no-dev --prefix=none | grep -vE "$PWD" | sort --unique
845837
- name: Build
846838
shell: bash
847839
run: |
848840
## Build
849-
${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} build --release \
841+
${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} build --release --config=profile.release.strip=true \
850842
--target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }}
851843
- name: Test
852844
if: matrix.job.skip-tests != true
@@ -861,8 +853,6 @@ jobs:
861853
if: matrix.job.skip-tests != true
862854
shell: bash
863855
run: |
864-
command -v sudo && sudo rm -rf /usr/local/lib/android /usr/share/dotnet # avoid no space left
865-
df -h ||:
866856
## Test individual utilities
867857
${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} test --target=${{ matrix.job.target }} \
868858
${{ matrix.job.cargo-options }} ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
@@ -881,11 +871,6 @@ jobs:
881871
# binaries
882872
cp 'target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/'
883873
cp 'target/${{ matrix.job.target }}/release/uudoc${{ steps.vars.outputs.EXE_suffix }}' '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/' || :
884-
# `strip` binary (if needed)
885-
if [ -n "${{ steps.vars.outputs.STRIP }}" ]; then
886-
"${{ steps.vars.outputs.STRIP }}" '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}'
887-
"${{ steps.vars.outputs.STRIP }}" '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/uudoc' || :
888-
fi
889874
# README and LICENSE
890875
# * spell-checker:ignore EADME ICENSE
891876
(shopt -s nullglob; for f in [R]"EADME"{,.*}; do cp $f '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/' ; done)
@@ -897,25 +882,40 @@ jobs:
897882
*) tar czf '${{ steps.vars.outputs.PKG_NAME }}' '${{ steps.vars.outputs.PKG_BASENAME }}'/* ;;
898883
esac
899884
popd >/dev/null
885+
- name: Package manpages and completions
886+
if: matrix.job.target == 'x86_64-unknown-linux-gnu' && matrix.job.features == 'feat_os_unix,uudoc'
887+
run: |
888+
mkdir -p share/{man/man1,bash-completion/completions,fish/vendor_completions.d,zsh/site-functions,elvish/lib}
889+
_uudoc=target/${{ matrix.job.target }}/release/uudoc
890+
for bin in $('target/${{ matrix.job.target }}/release/coreutils' --list) coreutils;do
891+
${_uudoc} manpage ${bin} > share/man/man1/${bin}.1
892+
${_uudoc} completion ${bin} bash > share/bash-completion/completions/${bin}.bash
893+
${_uudoc} completion ${bin} fish > share/fish/vendor_completions.d/${bin}.fish
894+
${_uudoc} completion ${bin} zsh > share/zsh/site-functions/_${bin}
895+
${_uudoc} completion ${bin} elvish > share/elvish/lib/${bin}.elv
896+
done
897+
rm share/zsh/site-functions/_[ # not supported
898+
tar --zstd -cf docs.tar.zst share
900899
- name: Publish
901900
uses: softprops/action-gh-release@v2
902901
if: steps.vars.outputs.DEPLOY && matrix.job.skip-publish != true
903902
with:
904903
draft: true
905904
files: |
906905
${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }}
906+
docs.tar.zst
907907
env:
908908
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
909909
- name: Publish latest commit
910910
uses: softprops/action-gh-release@v2
911-
if: steps.vars.outputs.DEPLOY && matrix.job.skip-publish != true
911+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.job.skip-publish != true
912912
with:
913913
tag_name: latest-commit
914-
force_update: true
915914
draft: false
916915
prerelease: true
917916
files: |
918917
${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }}
918+
docs.tar.zst
919919
env:
920920
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
921921

@@ -1264,13 +1264,13 @@ jobs:
12641264
- uses: actions/checkout@v6
12651265
with:
12661266
persist-credentials: false
1267+
- name: Avoid no space left on device
1268+
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android &
12671269
- uses: dtolnay/rust-toolchain@stable
12681270
- uses: Swatinem/rust-cache@v2
12691271
- name: build and test all features individually
12701272
shell: bash
12711273
run: |
1272-
command -v sudo && sudo rm -rf /usr/local/lib/android /usr/share/dotnet # avoid no space left
1273-
df -h ||:
12741274
CARGO_FEATURES_OPTION='--features=${{ matrix.job.features }}' ;
12751275
for f in $(util/show-utils.sh ${CARGO_FEATURES_OPTION})
12761276
do

.github/workflows/GnuTests.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,6 @@ jobs:
233233
lima ls -laZ /etc/selinux
234234
lima sudo sestatus
235235
236-
# Ensure we're running in enforcing mode
237-
lima sudo setenforce 1
238-
lima getenforce
239-
240-
# Create test files with SELinux contexts for testing
241-
lima sudo mkdir -p /var/test_selinux
242-
lima sudo touch /var/test_selinux/test_file
243-
lima sudo chcon -t etc_t /var/test_selinux/test_file
244-
lima ls -Z /var/test_selinux/test_file # Verify context
245236
- name: Install dependencies in VM
246237
run: |
247238
lima sudo dnf -y update
@@ -267,8 +258,16 @@ jobs:
267258
lima bash -c "cd ~/work/uutils/ && echo 'Found SELinux tests:'; wc -l selinux-tests.txt"
268259
- name: Run GNU SELinux tests
269260
run: |
261+
# Ensure we're running in enforcing mode
270262
lima sudo setenforce 1
271263
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+
272271
lima cat /proc/filesystems
273272
lima bash -c "cd ~/work/uutils/ && bash util/run-gnu-test.sh \$(cat selinux-tests.txt)"
274273
- name: Extract testing info from individual logs into JSON

.github/workflows/freebsd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
with:
135135
persist-credentials: false
136136
- name: Avoid no space left on device (Ubuntu runner)
137-
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android
137+
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android &
138138
- uses: Swatinem/rust-cache@v2
139139
- name: Run sccache-cache
140140
uses: mozilla-actions/sccache-action@v0.0.9

.github/workflows/fuzzing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
- { name: fuzz_parse_glob, should_pass: true }
9595
- { name: fuzz_parse_size, should_pass: true }
9696
- { name: fuzz_parse_time, should_pass: true }
97-
- { name: fuzz_seq_parse_number, should_pass: true }
97+
- { name: fuzz_seq_parse_number, should_pass: false }
9898
- { name: fuzz_non_utf8_paths, should_pass: true }
9999

100100
steps:

.github/workflows/ignore-intermittent.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ tests/tty/tty-eof
88
tests/misc/stdbuf
99
tests/misc/usage_vs_getopt
1010
tests/misc/tee
11+
tests/tail/follow-name

.vscode/cspell.dictionaries/jargon.wordlist.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ semiprimes
136136
setcap
137137
setfacl
138138
setfattr
139+
SETFL
139140
setlocale
140141
shortcode
141142
shortcodes
@@ -184,6 +185,7 @@ inacc
184185
maint
185186
proc
186187
procs
188+
TOCTOU
187189

188190
# * constants
189191
xffff
@@ -202,6 +204,7 @@ nofield
202204
# * clippy
203205
uninlined
204206
nonminimal
207+
rposition
205208

206209
# * CPU/hardware features
207210
ASIMD
@@ -217,5 +220,7 @@ TUNABLES
217220
tunables
218221
VMULL
219222
vmull
223+
ENOTSUP
224+
enotsup
220225
SETFL
221226
tmpfs

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ issues and writing documentation are just as important as writing code.
7878
We can't fix bugs we don't know about, so good issues are super helpful! Here
7979
are some tips for writing good issues:
8080

81-
- If you find a bug, make sure it's still a problem on the `main` branch.
81+
- If you find a bug, make sure it's still a problem on the [`main` branch](https://github.com/uutils/coreutils/releases/tag/latest-commit).
8282
- Search through the existing issues to see whether it has already been
8383
reported.
8484
- Make sure to include all relevant information, such as:
85-
- Which version of uutils did you check?
85+
- Which version or commit hash of uutils did you check?
8686
- Which version of GNU coreutils are you comparing with?
8787
- What platform are you on?
8888
- Provide a way to reliably reproduce the issue.
@@ -250,8 +250,8 @@ gitignore: add temporary files
250250
- It's up to you whether you want to use `git merge main` or
251251
`git rebase main`.
252252
- Feel free to ask for help with merge conflicts.
253-
- You do not need to ping maintainers to request a review, but it's fine to do
254-
so if you don't get a response within a few days.
253+
- You do not need to ping maintainers to request a review immediately after submission. If you do not get a response to your patch within a few days, it is fine to request a review.
254+
- If after a week your patch has still not been reviewed, we recommend that you ping the maintainers on our Discord channel in `#coreutils-chat`.
255255

256256
## Platforms
257257

0 commit comments

Comments
 (0)