Merge branch 'main' into fix-doc-hashs

This commit is contained in:
Sylvestre Ledru
2025-12-07 18:12:22 +01:00
committed by GitHub
170 changed files with 7250 additions and 3953 deletions
-1
View File
@@ -12,7 +12,6 @@ RUN apt-get update \
gcc \
gdb \
gperf \
jq \
libacl1-dev \
libattr1-dev \
libcap-dev \
+36 -84
View File
@@ -4,7 +4,7 @@ name: CICD
# spell-checker:ignore (env/flags) Awarnings Ccodegen Coverflow Cpanic Dwarnings RUSTDOCFLAGS RUSTFLAGS Zpanic CARGOFLAGS
# spell-checker:ignore (jargon) SHAs deps dequote softprops subshell toolchain fuzzers dedupe devel profdata
# spell-checker:ignore (people) Peltoche rivy dtolnay Anson dawidd
# spell-checker:ignore (shell/tools) binutils choco clippy dmake dpkg 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
# 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
# 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
env:
@@ -36,7 +36,7 @@ jobs:
name: Style/cargo-deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: EmbarkStudios/cargo-deny-action@v2
@@ -55,7 +55,7 @@ jobs:
- { os: macos-latest , features: "feat_Tier1,feat_require_unix,feat_require_unix_utmpx" }
- { os: windows-latest , features: feat_os_windows }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
@@ -109,7 +109,7 @@ jobs:
# - { os: macos-latest , features: feat_os_macos }
# - { os: windows-latest , features: feat_os_windows }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
@@ -149,7 +149,7 @@ jobs:
shell: bash
run: |
RUSTDOCFLAGS="-Dwarnings" cargo doc ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} --no-deps --workspace --document-private-items
- uses: DavidAnson/markdownlint-cli2-action@v20
- uses: DavidAnson/markdownlint-cli2-action@v21
with:
fix: "true"
globs: |
@@ -168,7 +168,7 @@ jobs:
job:
- { os: ubuntu-latest , features: feat_os_unix }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
@@ -238,7 +238,7 @@ jobs:
job:
- { os: ubuntu-latest , features: feat_os_unix }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -265,7 +265,7 @@ jobs:
job:
- { os: ubuntu-latest , features: feat_os_unix }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -273,10 +273,7 @@ jobs:
target: aarch64-unknown-linux-gnu
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
- name: Install/setup prerequisites
shell: bash
run: |
sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev
# Test build on the system missing libselinux (don't install libselinux1-dev at here)
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9
- name: "`make build`"
@@ -300,14 +297,17 @@ jobs:
mv -t target/ target.cache/release 2>/dev/null || true
- name: "`make nextest`"
shell: bash
run: make nextest CARGOFLAGS="--profile ci --hide-progress-bar"
run: make nextest PROFILE=ci CARGOFLAGS="--hide-progress-bar"
env:
RUST_BACKTRACE: "1"
- name: "`make install COMPLETIONS=n MANPAGES=n LOCALES=n`"
- name: "`make install PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n`"
shell: bash
run: |
set -x
DESTDIR=/tmp/ make PROFILE=release COMPLETIONS=n MANPAGES=n LOCALES=n install
DESTDIR=/tmp/ make PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n install
# Check that utils are built with given profile
./target/release-fast/true
# Check that the utils are present
test -f /tmp/usr/local/bin/tty
# Check that the manpage is not present
@@ -398,7 +398,7 @@ jobs:
- { os: macos-latest , features: feat_os_macos }
- { os: windows-latest , features: feat_os_windows }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -427,7 +427,7 @@ jobs:
- { os: macos-latest , features: feat_os_macos }
- { os: windows-latest , features: feat_os_windows }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
@@ -453,7 +453,7 @@ jobs:
job:
- { os: ubuntu-latest , features: feat_os_unix }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -465,7 +465,7 @@ jobs:
run: |
## Install dependencies
sudo apt-get update
sudo apt-get install jq libselinux1-dev libsystemd-dev
sudo apt-get install libselinux1-dev libsystemd-dev
- name: "`make install`"
shell: bash
run: |
@@ -579,22 +579,21 @@ jobs:
# - { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: feat_selinux , use-cross: use-cross }
- { os: ubuntu-latest , target: i686-unknown-linux-gnu , features: "feat_os_unix,test_risky_names", use-cross: use-cross }
- { os: ubuntu-latest , target: i686-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross }
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: "feat_os_unix,test_risky_names", use-cross: use-cross }
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: "feat_os_unix,test_risky_names", use-cross: use-cross, skip-publish: true }
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: "feat_os_unix,uudoc" , use-cross: no, workspace-tests: true }
- { os: ubuntu-latest , target: x86_64-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross }
# broken by network error
# - { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true }
- { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true }
- { os: ubuntu-latest , target: wasm32-unknown-unknown , default-features: false, features: uucore/format, skip-tests: true, skip-package: true, skip-publish: true }
- { os: macos-latest , target: aarch64-apple-darwin , features: feat_os_macos, workspace-tests: true } # M1 CPU
# PR #7964: Mac should still build even if the feature is not enabled
- { os: macos-latest , target: aarch64-apple-darwin , workspace-tests: true } # M1 CPU
# PR #7964: Mac should still build even if the feature is not enabled. Do not publish this.
- { os: macos-latest , target: aarch64-apple-darwin , workspace-tests: true, skip-publish: true } # M1 CPU
- { os: macos-latest , target: x86_64-apple-darwin , features: feat_os_macos, workspace-tests: true }
- { os: windows-latest , target: i686-pc-windows-msvc , features: feat_os_windows }
- { os: windows-latest , target: x86_64-pc-windows-gnu , features: feat_os_windows }
- { os: windows-latest , target: x86_64-pc-windows-msvc , features: feat_os_windows }
- { os: windows-latest , target: aarch64-pc-windows-msvc , features: feat_os_windows, use-cross: use-cross , skip-tests: true }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
@@ -638,7 +637,6 @@ jobs:
case '${{ matrix.job.target }}' in
aarch64-*) TARGET_ARCH=arm64 ;;
arm-*-*hf) TARGET_ARCH=armhf ;;
i586-*) TARGET_ARCH=i586 ;;
i686-*) TARGET_ARCH=i686 ;;
x86_64-*) TARGET_ARCH=x86_64 ;;
esac;
@@ -658,25 +656,6 @@ jobs:
# deployable tag? (ie, leading "vM" or "M"; M == version number)
unset DEPLOY ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DEPLOY='true' ; fi
outputs DEPLOY
# DPKG architecture?
unset DPKG_ARCH
case ${{ matrix.job.target }} in
x86_64-*-linux-*) DPKG_ARCH=amd64 ;;
*-linux-*) DPKG_ARCH=${TARGET_ARCH} ;;
esac
outputs DPKG_ARCH
# DPKG version?
unset DPKG_VERSION ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DPKG_VERSION=${REF_TAG/#[vV]/} ; fi
outputs DPKG_VERSION
# DPKG base name/conflicts?
DPKG_BASENAME=${PROJECT_NAME}
DPKG_CONFLICTS=${PROJECT_NAME}-musl
case ${{ matrix.job.target }} in *-musl) DPKG_BASENAME=${PROJECT_NAME}-musl ; DPKG_CONFLICTS=${PROJECT_NAME} ;; esac;
outputs DPKG_BASENAME DPKG_CONFLICTS
# DPKG name
unset DPKG_NAME;
if [[ -n $DPKG_ARCH && -n $DPKG_VERSION ]]; then DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb" ; fi
outputs DPKG_NAME
# target-specific options
# * CARGO_FEATURES_OPTION
CARGO_FEATURES_OPTION='' ;
@@ -733,9 +712,7 @@ jobs:
shell: bash
run: |
## Create build/work space
mkdir -p '${{ steps.vars.outputs.STAGING }}'
mkdir -p '${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}'
mkdir -p '${{ steps.vars.outputs.STAGING }}/dpkg'
- name: Install/setup prerequisites
shell: bash
run: |
@@ -783,7 +760,7 @@ jobs:
- uses: taiki-e/install-action@v2
if: steps.vars.outputs.CARGO_CMD == 'redoxer'
with:
tool: redoxer@0.2.37
tool: redoxer@0.2.56
- name: Initialize toolchain-dependent workflow variables
id: dep_vars
shell: bash
@@ -867,21 +844,6 @@ jobs:
*) tar czf '${{ steps.vars.outputs.PKG_NAME }}' '${{ steps.vars.outputs.PKG_BASENAME }}'/* ;;
esac
popd >/dev/null
# dpkg
if [ -n "${{ steps.vars.outputs.DPKG_NAME }}" ]; then
DPKG_DIR="${{ steps.vars.outputs.STAGING }}/dpkg"
# binary
install -Dm755 'target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' "${DPKG_DIR}/usr/bin/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}"
if [ -n "${{ steps.vars.outputs.STRIP }}" ]; then "${{ steps.vars.outputs.STRIP }}" "${DPKG_DIR}/usr/bin/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}" ; fi
# README and LICENSE
(shopt -s nullglob; for f in [R]"EADME"{,.*}; do install -Dm644 "$f" "${DPKG_DIR}/usr/share/doc/${{ env.PROJECT_NAME }}/$f" ; done)
(shopt -s nullglob; for f in [L]"ICENSE"{-*,}{,.*}; do install -Dm644 "$f" "${DPKG_DIR}/usr/share/doc/${{ env.PROJECT_NAME }}/$f" ; done)
# control file
mkdir -p "${DPKG_DIR}/DEBIAN"
printf "Package: ${{ steps.vars.outputs.DPKG_BASENAME }}\nVersion: ${{ steps.vars.outputs.DPKG_VERSION }}\nSection: utils\nPriority: optional\nMaintainer: ${{ env.PROJECT_AUTH }}\nArchitecture: ${{ steps.vars.outputs.DPKG_ARCH }}\nProvides: ${{ env.PROJECT_NAME }}\nConflicts: ${{ steps.vars.outputs.DPKG_CONFLICTS }}\nDescription: ${{ env.PROJECT_DESC }}\n" > "${DPKG_DIR}/DEBIAN/control"
# build dpkg
fakeroot dpkg-deb --build "${DPKG_DIR}" "${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }}"
fi
- name: Publish
uses: softprops/action-gh-release@v2
if: steps.vars.outputs.DEPLOY && matrix.job.skip-publish != true
@@ -889,7 +851,6 @@ jobs:
draft: true
files: |
${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }}
${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -912,7 +873,7 @@ jobs:
run: |
## VARs setup
echo "TEST_SUMMARY_FILE=busybox-result.json" >> $GITHUB_OUTPUT
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: Swatinem/rust-cache@v2
@@ -995,7 +956,7 @@ jobs:
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
TEST_SUMMARY_FILE="toybox-result.json"
outputs TEST_SUMMARY_FILE
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
@@ -1084,7 +1045,7 @@ jobs:
# FIXME: Re-enable Code Coverage on windows, which currently fails due to "profiler_builtins". See #6686.
# - { os: windows-latest , features: windows, toolchain: nightly-x86_64-pc-windows-gnu }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.job.toolchain }}
@@ -1158,11 +1119,6 @@ jobs:
;;
esac
case '${{ matrix.job.os }}' in
# Update binutils if MinGW due to https://github.com/rust-lang/rust/issues/112368
windows-latest) C:/msys64/usr/bin/pacman.exe -Sy --needed mingw-w64-x86_64-gcc --noconfirm ; echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH ;;
esac
## Install the llvm-tools component to get access to `llvm-profdata`
rustup component add llvm-tools
@@ -1201,7 +1157,7 @@ jobs:
- { os: macos-latest , features: feat_os_macos }
- { os: windows-latest , features: feat_os_windows }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -1228,7 +1184,7 @@ jobs:
- { os: macos-latest , features: feat_os_macos }
# - { os: windows-latest , features: feat_os_windows } https://github.com/uutils/coreutils/issues/7044
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -1236,6 +1192,7 @@ jobs:
- name: build and test all features individually
shell: bash
run: |
command -v sudo && sudo rm -rf /usr/share/dotnet # avoid no space left
CARGO_FEATURES_OPTION='--features=${{ matrix.job.features }}' ;
for f in $(util/show-utils.sh ${CARGO_FEATURES_OPTION})
do
@@ -1248,7 +1205,7 @@ jobs:
needs: [ min_version, deps ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -1290,7 +1247,7 @@ jobs:
- { os: windows-latest , features: feat_os_windows }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -1300,13 +1257,8 @@ jobs:
- name: Verify stub binaries exist
shell: bash
run: |
if [ "${{ runner.os }}" = "Windows" ]; then
test -f target/debug/chcon.exe
test -f target/debug/runcon.exe
else
test -f target/debug/chcon
test -f target/debug/runcon
fi
test -f target/debug/chcon || test -f target/debug/chcon.exe
test -f target/debug/runcon || test -f target/debug/runcon.exe
- name: Verify workspace builds with stubs
run: cargo build --features ${{ matrix.job.features }}
@@ -1316,7 +1268,7 @@ jobs:
needs: [ min_version, deps ]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
+2 -2
View File
@@ -29,7 +29,7 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Run ShellCheck
@@ -47,7 +47,7 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup shfmt
+1 -1
View File
@@ -26,7 +26,7 @@ jobs:
job:
- { os: ubuntu-latest , features: feat_os_unix }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Initialize job variables
+33 -10
View File
@@ -29,7 +29,6 @@ env:
TEST_ROOT_FULL_SUMMARY_FILE: 'gnu-root-full-result.json'
TEST_SELINUX_FULL_SUMMARY_FILE: 'selinux-gnu-full-result.json'
TEST_SELINUX_ROOT_FULL_SUMMARY_FILE: 'selinux-root-gnu-full-result.json'
REPO_GNU_REF: "v9.8"
jobs:
native:
@@ -38,10 +37,20 @@ jobs:
steps:
#### Get the code, setup cache
- name: Checkout code (uutils)
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
path: 'uutils'
persist-credentials: false
- name: Extract GNU version from build-gnu.sh
id: gnu-version
run: |
GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
if [ -z "$GNU_VERSION" ]; then
echo "Error: Failed to extract GNU version from build-gnu.sh"
exit 1
fi
echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
echo "Extracted GNU version: ${GNU_VERSION}"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
@@ -50,7 +59,7 @@ jobs:
with:
workspaces: "./uutils -> target"
- name: Checkout code (GNU coreutils)
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
repository: 'coreutils/coreutils'
path: 'gnu'
@@ -71,7 +80,8 @@ jobs:
run: |
## Install dependencies
sudo apt-get update
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
## Check that build-gnu.sh works on the non SELinux system by installing libselinux only on lima
sudo apt-get install -y autopoint gperf gdb python3-pyinotify valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev attr quilt
- name: Add various locales
shell: bash
run: |
@@ -89,6 +99,9 @@ jobs:
sudo locale-gen --keep-existing en_US
sudo locale-gen --keep-existing en_US.UTF-8
sudo locale-gen --keep-existing ru_RU.KOI8-R
sudo locale-gen --keep-existing fa_IR.UTF-8 # Iran
sudo locale-gen --keep-existing am_ET.UTF-8 # Ethiopia
sudo locale-gen --keep-existing th_TH.UTF-8 # Thailand
sudo update-locale
echo "After:"
@@ -100,7 +113,7 @@ jobs:
run: |
## Build binaries
cd 'uutils'
bash util/build-gnu.sh --release-build
env PROFILE=release-small bash util/build-gnu.sh
### Run tests as user
- name: Run GNU tests
@@ -160,10 +173,20 @@ jobs:
steps:
#### Get the code, setup cache
- name: Checkout code (uutils)
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
path: 'uutils'
persist-credentials: false
- name: Extract GNU version from build-gnu.sh
id: gnu-version-selinux
run: |
GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
if [ -z "$GNU_VERSION" ]; then
echo "Error: Failed to extract GNU version from build-gnu.sh"
exit 1
fi
echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
echo "Extracted GNU version: ${GNU_VERSION}"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
@@ -172,7 +195,7 @@ jobs:
with:
workspaces: "./uutils -> target"
- name: Checkout code (GNU coreutils)
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
repository: 'coreutils/coreutils'
path: 'gnu'
@@ -216,7 +239,7 @@ jobs:
- name: Install dependencies in VM
run: |
lima sudo dnf -y update
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
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
lima rustup-init -y --default-toolchain stable
- name: Copy the sources to VM
run: |
@@ -225,7 +248,7 @@ jobs:
### Build
- name: Build binaries
run: |
lima bash -c "cd ~/work/uutils/ && bash util/build-gnu.sh --release-build"
lima bash -c "cd ~/work/uutils/ && SELINUX_ENABLED=1 PROFILE=release-small bash util/build-gnu.sh"
### Run tests as user
- name: Generate SELinux tests list
@@ -309,7 +332,7 @@ jobs:
outputs TEST_SUMMARY_FILE AGGREGATED_SUMMARY_FILE
- name: Checkout code (uutils)
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
path: 'uutils'
persist-credentials: false
+3 -8
View File
@@ -22,7 +22,7 @@ concurrency:
env:
TERMUX: v0.118.0
KEY_POSTFIX: nextest+rustc-hash+adb+sshd+upgrade+XGB+inc18
COMMON_EMULATOR_OPTIONS: -no-window -noaudio -no-boot-anim -camera-back none -gpu swiftshader_indirect -metrics-collection
COMMON_EMULATOR_OPTIONS: -no-window -noaudio -no-boot-anim -camera-back none -gpu off
EMULATOR_DISK_SIZE: 12GB
EMULATOR_HEAP_SIZE: 2048M
EMULATOR_BOOT_TIMEOUT: 1200 # 20min
@@ -36,15 +36,10 @@ jobs:
matrix:
os: [ubuntu-latest] # , macos-latest
cores: [4] # , 6
ram: [4096, 8192]
ram: [4096]
api-level: [28]
target: [google_apis_playstore]
arch: [x86, x86_64] # , arm64-v8a
exclude:
- ram: 8192
arch: x86
- ram: 4096
arch: x86_64
runs-on: ${{ matrix.os }}
env:
EMULATOR_RAM_SIZE: ${{ matrix.ram }}
@@ -80,7 +75,7 @@ jobs:
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Collect information about runner
+2 -1
View File
@@ -37,6 +37,7 @@ jobs:
- { package: uu_numfmt }
- { package: uu_rm }
- { package: uu_seq }
- { package: uu_shuf }
- { package: uu_sort }
- { package: uu_split }
- { package: uu_tsort }
@@ -45,7 +46,7 @@ jobs:
- { package: uu_wc }
- { package: uu_factor }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
+7 -7
View File
@@ -32,7 +32,7 @@ jobs:
job:
- { os: ubuntu-latest , features: feat_os_unix }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
@@ -82,7 +82,7 @@ jobs:
- { os: macos-latest , features: feat_os_macos }
- { os: windows-latest , features: feat_os_windows }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
@@ -156,7 +156,7 @@ jobs:
job:
- { os: ubuntu-latest , features: feat_os_unix }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Initialize workflow variables
@@ -174,7 +174,7 @@ jobs:
- name: Install/setup prerequisites
shell: bash
run: |
sudo apt-get -y update ; sudo apt-get -y install npm ; sudo npm install cspell -g ;
sudo npm install cspell -g ;
- name: Run `cspell`
shell: bash
run: |
@@ -194,7 +194,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
persist-credentials: false
@@ -206,7 +206,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
persist-credentials: false
@@ -230,7 +230,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
persist-credentials: false
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Run test in devcontainer
+1 -1
View File
@@ -24,7 +24,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Install/setup prerequisites
shell: bash
+5 -6
View File
@@ -34,7 +34,7 @@ jobs:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: Swatinem/rust-cache@v2
@@ -43,7 +43,7 @@ jobs:
with:
disable_annotations: true
- name: Prepare, build and test
uses: vmactions/freebsd-vm@v1.2.6
uses: vmactions/freebsd-vm@v1.2.9
with:
usesh: true
sync: rsync
@@ -130,7 +130,7 @@ jobs:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: Swatinem/rust-cache@v2
@@ -139,7 +139,7 @@ jobs:
with:
disable_annotations: true
- name: Prepare, build and test
uses: vmactions/freebsd-vm@v1.2.6
uses: vmactions/freebsd-vm@v1.2.9
with:
usesh: true
sync: rsync
@@ -160,7 +160,6 @@ jobs:
WORKSPACE="${WORKSPACE_PARENT}/${REPO_NAME}"
#
pw adduser -n ${TEST_USER} -d /root/ -g wheel -c "Coreutils user to build" -w random
# chown -R ${TEST_USER}:wheel /root/ "${WORKSPACE_PARENT}"/
chown -R ${TEST_USER}:wheel /root/ "${WORKSPACE_PARENT}"/
whoami
#
@@ -204,7 +203,7 @@ jobs:
cargo nextest run --hide-progress-bar --profile ci --features "\$UUCORE_FEATURES" -p uucore || FAULT=1
fi
# Test building with make
if (test -z "\$FAULT"); then make PROFILE=ci || FAULT=1 ; fi
if (test -z "\$FAULT"); then make || FAULT=1 ; fi
# Clean to avoid to rsync back the files
cargo clean
if (test -n "\$FAULT"); then exit 1 ; fi
+4 -4
View File
@@ -21,7 +21,7 @@ jobs:
name: Build and test uufuzz examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -55,7 +55,7 @@ jobs:
name: Build the fuzzers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
@@ -99,7 +99,7 @@ jobs:
- { name: fuzz_non_utf8_paths, should_pass: true }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
@@ -211,7 +211,7 @@ jobs:
runs-on: ubuntu-latest
if: always()
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Download all stats
+169 -41
View File
@@ -36,7 +36,7 @@ jobs:
- { os: macos-latest , features: "feat_os_macos" }
- { os: windows-latest , features: "feat_os_windows" }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -76,7 +76,7 @@ jobs:
name: L10n/Fluent Syntax Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Python
@@ -131,7 +131,7 @@ jobs:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -141,7 +141,7 @@ jobs:
- name: Install/setup prerequisites
shell: bash
run: |
sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev locales
sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev
sudo locale-gen --keep-existing fr_FR.UTF-8
locale -a | grep -i fr || exit 1
- name: Build coreutils with clap localization support
@@ -301,7 +301,7 @@ jobs:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -312,7 +312,7 @@ jobs:
shell: bash
run: |
## Install/setup prerequisites
sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev locales
sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev
- name: Generate French locale
shell: bash
run: |
@@ -416,7 +416,7 @@ jobs:
- { os: ubuntu-latest , features: "feat_os_unix" }
- { os: macos-latest , features: "feat_os_macos" }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -429,10 +429,10 @@ jobs:
## Install/setup prerequisites
case '${{ matrix.job.os }}' in
ubuntu-*)
sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev build-essential
sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev
;;
macos-*)
brew install coreutils make
brew install coreutils
;;
esac
- name: Install via make and test multi-call binary
@@ -453,22 +453,22 @@ jobs:
# First check if binary exists after build
echo "Checking if coreutils was built..."
ls -la target/release/coreutils || echo "No coreutils binary in target/release/"
ls -la target/release-small/coreutils || echo "No coreutils binary in target/release-small/"
make FEATURES="${{ matrix.job.features }}" PROFILE=release MULTICALL=y
make FEATURES="${{ matrix.job.features }}" PROFILE=release-small MULTICALL=y
echo "After build, checking target/release/:"
ls -la target/release/ | grep -E "(coreutils|^total)" || echo "Build may have failed"
echo "After build, checking target/release-small/:"
ls -la target/release-small/ | grep -E "(coreutils|^total)" || echo "Build may have failed"
echo "Running make install..."
echo "Before install - checking what we have:"
ls -la target/release/coreutils 2>/dev/null || echo "No coreutils in target/release"
ls -la target/release-small/coreutils 2>/dev/null || echo "No coreutils in target/release-small"
# Run make install with verbose output to see what happens
echo "About to run: make install DESTDIR=\"$INSTALL_DIR\" PREFIX=/usr PROFILE=release MULTICALL=y"
echo "About to run: make install DESTDIR=\"$INSTALL_DIR\" PREFIX=/usr PROFILE=release-small MULTICALL=y"
echo "Expected install path: $INSTALL_DIR/usr/bin/coreutils"
make install DESTDIR="$INSTALL_DIR" PREFIX=/usr PROFILE=release MULTICALL=y || {
make install DESTDIR="$INSTALL_DIR" PREFIX=/usr PROFILE=release-small MULTICALL=y || {
echo "Make install failed! Exit code: $?"
echo "Let's see what happened:"
ls -la "$INSTALL_DIR" 2>/dev/null || echo "Install directory doesn't exist"
@@ -482,13 +482,13 @@ jobs:
echo "Current directory: $(pwd)"
echo "INSTALL_DIR: $INSTALL_DIR"
echo "Checking if build succeeded..."
if [ -f "target/release/coreutils" ]; then
echo "✓ Build succeeded - coreutils binary exists in target/release/"
ls -la target/release/coreutils
if [ -f "target/release-small/coreutils" ]; then
echo "✓ Build succeeded - coreutils binary exists in target/release-small/"
ls -la target/release-small/coreutils
else
echo "✗ Build failed - no coreutils binary in target/release/"
echo "Contents of target/release/:"
ls -la target/release/ | head -20
echo "✗ Build failed - no coreutils binary in target/release-small/"
echo "Contents of target/release-small/:"
ls -la target/release-small/ | head -20
exit 1
fi
@@ -567,7 +567,7 @@ jobs:
- { os: ubuntu-latest , features: "feat_os_unix" }
- { os: macos-latest , features: "feat_os_macos" }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -580,13 +580,13 @@ jobs:
## Install/setup prerequisites
case '${{ matrix.job.os }}' in
ubuntu-*)
sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev build-essential locales
sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev
# Generate French locale for testing
sudo locale-gen --keep-existing fr_FR.UTF-8
locale -a | grep -i fr || echo "French locale generation may have failed"
;;
macos-*)
brew install coreutils make
brew install coreutils
;;
esac
- name: Test Make installation
@@ -600,8 +600,8 @@ jobs:
mkdir -p "$MAKE_INSTALL_DIR"
# Build and install using make with DESTDIR
make FEATURES="${{ matrix.job.features }}" PROFILE=release MULTICALL=y
make install DESTDIR="$MAKE_INSTALL_DIR" PREFIX=/usr PROFILE=release MULTICALL=y
make FEATURES="${{ matrix.job.features }}" PROFILE=release-small MULTICALL=y
make install DESTDIR="$MAKE_INSTALL_DIR" PREFIX=/usr PROFILE=release-small MULTICALL=y
# Verify installation
echo "Testing make-installed binaries..."
@@ -900,7 +900,7 @@ jobs:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -912,7 +912,7 @@ jobs:
run: |
## Install/setup prerequisites including locale support
sudo apt-get -y update
sudo apt-get -y install libselinux1-dev locales build-essential
sudo apt-get -y install libselinux1-dev
# Generate multiple locales for testing
sudo locale-gen --keep-existing en_US.UTF-8 fr_FR.UTF-8 de_DE.UTF-8 es_ES.UTF-8
@@ -928,8 +928,8 @@ jobs:
mkdir -p "$INSTALL_DIR"
# Build and install using make with DESTDIR
make FEATURES="feat_os_unix" PROFILE=release MULTICALL=y
make install DESTDIR="$INSTALL_DIR" PREFIX=/usr PROFILE=release MULTICALL=y
make FEATURES="feat_os_unix" PROFILE=release-small MULTICALL=y
make install DESTDIR="$INSTALL_DIR" PREFIX=/usr PROFILE=release-small MULTICALL=y
# Debug: Show what was installed
echo "Contents of installation directory:"
@@ -1109,8 +1109,8 @@ jobs:
# Clean and build standard version
make clean
make FEATURES="feat_os_unix" PROFILE=release MULTICALL=y
make install DESTDIR="$STANDARD_BUILD_INSTALL_DIR" PREFIX=/usr PROFILE=release MULTICALL=y
make FEATURES="feat_os_unix" PROFILE=release-small MULTICALL=y
make install DESTDIR="$STANDARD_BUILD_INSTALL_DIR" PREFIX=/usr PROFILE=release-small MULTICALL=y
# Verify standard build binary works
if "$STANDARD_BUILD_INSTALL_DIR/usr/bin/coreutils" --version >/dev/null 2>&1; then
@@ -1131,7 +1131,7 @@ jobs:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -1151,7 +1151,7 @@ jobs:
name: L10n/Locale Embedding - Cat Utility
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -1160,7 +1160,7 @@ jobs:
# Use different cache key for each build to avoid conflicts
key: cat-locale-embedding
- name: Install prerequisites
run: sudo apt-get -y update && sudo apt-get -y install libselinux1-dev build-essential
run: sudo apt-get -y update && sudo apt-get -y install libselinux1-dev
- name: Build cat with targeted locale embedding
run: UUCORE_TARGET_UTIL=cat cargo build -p uu_cat --release
- name: Verify cat locale count
@@ -1183,7 +1183,7 @@ jobs:
name: L10n/Locale Embedding - Ls Utility
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -1192,7 +1192,7 @@ jobs:
# Use different cache key for each build to avoid conflicts
key: ls-locale-embedding
- name: Install prerequisites
run: sudo apt-get -y update && sudo apt-get -y install libselinux1-dev build-essential
run: sudo apt-get -y update && sudo apt-get -y install libselinux1-dev
- name: Build ls with targeted locale embedding
run: UUCORE_TARGET_UTIL=ls cargo build -p uu_ls --release
- name: Verify ls locale count
@@ -1215,7 +1215,7 @@ jobs:
name: L10n/Locale Embedding - Multicall Binary
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
@@ -1224,7 +1224,7 @@ jobs:
# Use different cache key for each build to avoid conflicts
key: multicall-locale-embedding
- name: Install prerequisites
run: sudo apt-get -y update && sudo apt-get -y install libselinux1-dev build-essential
run: sudo apt-get -y update && sudo apt-get -y install libselinux1-dev
- name: Build multicall binary with all locales
run: cargo build --release
- name: Verify multicall locale count
@@ -1245,10 +1245,138 @@ jobs:
exit 1
fi
l10n_locale_embedding_cargo_install:
name: L10n/Locale Embedding - Cargo Install
runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: cargo-install-locale-embedding
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Install prerequisites
run: |
sudo apt-get -y update
sudo apt-get -y install libselinux1-dev
# Generate French locale for testing
sudo locale-gen --keep-existing fr_FR.UTF-8
locale -a | grep -i fr || exit 1
- name: Test English locale embedding (default)
run: |
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
echo "Building uu_yes with LANG=$LANG"
cargo build --package uu_yes --release
# Find the generated embedded_locales.rs
locale_file=$(find target/release/build -path "*/uu_yes-*/out/embedded_locales.rs" -o -path "*/uucore-*/out/embedded_locales.rs" | head -1)
if [ -z "$locale_file" ]; then
echo "ERROR: Could not find embedded_locales.rs"
exit 1
fi
echo "Found embedded_locales.rs at: $locale_file"
echo "Checking embedded locales..."
# Should contain en-US
if grep -q 'yes/en-US\.ftl' "$locale_file" || grep -q 'uucore/en-US\.ftl' "$locale_file"; then
echo "✓ Found en-US locale (fallback)"
else
echo "✗ ERROR: en-US locale not found"
exit 1
fi
# Should NOT contain fr-FR when building with en_US.UTF-8
if grep -q 'yes/fr-FR\.ftl' "$locale_file" || grep -q 'uucore/fr-FR\.ftl' "$locale_file"; then
echo "✗ ERROR: Unexpectedly found fr-FR locale when LANG=en_US.UTF-8"
exit 1
else
echo "✓ Correctly omitted fr-FR locale"
fi
echo "✓ SUCCESS: English locale embedding working correctly"
- name: Test French locale embedding (system locale)
run: |
export LANG=fr_FR.UTF-8
export LC_ALL=fr_FR.UTF-8
# Clean previous build to ensure fresh compile
cargo clean -p uu_yes
cargo clean -p uucore
echo "Building uu_yes with LANG=$LANG"
cargo build --package uu_yes --release
# Find the generated embedded_locales.rs
locale_file=$(find target/release/build -path "*/uu_yes-*/out/embedded_locales.rs" -o -path "*/uucore-*/out/embedded_locales.rs" | head -1)
if [ -z "$locale_file" ]; then
echo "ERROR: Could not find embedded_locales.rs"
exit 1
fi
echo "Found embedded_locales.rs at: $locale_file"
echo "Checking embedded locales..."
# Should contain en-US (fallback)
if grep -q 'yes/en-US\.ftl' "$locale_file" || grep -q 'uucore/en-US\.ftl' "$locale_file"; then
echo "✓ Found en-US locale (fallback)"
else
echo "✗ ERROR: en-US locale not found"
exit 1
fi
# Should contain fr-FR when building with fr_FR.UTF-8
if grep -q 'yes/fr-FR\.ftl' "$locale_file" || grep -q 'uucore/fr-FR\.ftl' "$locale_file"; then
echo "✓ Found fr-FR locale (system locale from LANG)"
else
echo "Note: fr-FR locale not found - this is expected if French translation doesn't exist yet"
echo "::notice::French locale for 'yes' utility may not be available"
fi
echo "✓ SUCCESS: System locale detection working correctly"
- name: Test locale count is reasonable
run: |
export LANG=fr_FR.UTF-8
cargo clean -p uu_yes
cargo build --package uu_yes --release
locale_file=$(find target/release/build -path "*/uucore-*/out/embedded_locales.rs" | head -1)
if [ -z "$locale_file" ]; then
echo "ERROR: Could not find uucore embedded_locales.rs"
exit 1
fi
# Count embedded locales (should be en-US + system locale, not all locales)
locale_count=$(grep -c '/en-US\.ftl\|/fr-FR\.ftl' "$locale_file" || echo "0")
echo "uu_yes has $locale_count embedded locale entries for yes utility"
# For a single utility build, should have minimal locales (en-US + optionally system locale)
# Not the full multicall set
total_match_count=$(grep -c '=> Some(r###' "$locale_file" || echo "0")
echo "Total embedded entries: $total_match_count"
if [ "$total_match_count" -le 10 ]; then
echo "✓ SUCCESS: Locale embedding is targeted ($total_match_count entries)"
else
echo "::warning::More locales than expected ($total_match_count entries)"
echo "This might be expected for utility + uucore locales"
fi
l10n_locale_embedding_regression_test:
name: L10n/Locale Embedding Regression Test
runs-on: ubuntu-latest
needs: [l10n_locale_embedding_cat, l10n_locale_embedding_ls, l10n_locale_embedding_multicall]
needs: [l10n_locale_embedding_cat, l10n_locale_embedding_ls, l10n_locale_embedding_multicall, l10n_locale_embedding_cargo_install]
steps:
- name: All locale embedding tests passed
run: echo "✓ All locale embedding tests passed successfully"
+199
View File
@@ -0,0 +1,199 @@
name: OpenBSD
# spell-checker:ignore sshfs usesh vmactions taiki Swatinem esac fdescfs fdesc sccache nextest copyback logind bindgen libclang
env:
# * style job configuration
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
on:
pull_request:
push:
branches:
- '*'
permissions:
contents: read # to fetch code (actions/checkout)
# End the current execution if there is a new changeset in the PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
style:
name: Style and Lint
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
job:
- { features: unix }
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Prepare, build and test
uses: vmactions/openbsd-vm@v1
with:
usesh: true
sync: rsync
copyback: false
mem: 4096
# We need jq and GNU coreutils to run show-utils.sh and bash to use inline shell string replacement
# Use sudo-- to get the default sudo package without ambiguity
# Install rust and cargo from OpenBSD packages
prepare: pkg_add curl sudo-- jq coreutils bash rust rust-clippy rust-rustfmt llvm--
run: |
## Prepare, build, and test
# implementation modelled after ref: <https://github.com/rust-lang/rustup/pull/2783>
# * NOTE: All steps need to be run in this block, otherwise, we are operating back on the mac host
set -e
#
TEST_USER=tester
REPO_NAME=${GITHUB_WORKSPACE##*/}
WORKSPACE_PARENT="/home/runner/work/${REPO_NAME}"
WORKSPACE="${WORKSPACE_PARENT}/${REPO_NAME}"
#
useradd -m -G wheel ${TEST_USER}
chown -R ${TEST_USER}:wheel /root/ "${WORKSPACE_PARENT}"/
whoami
#
# Further work needs to be done in a sudo as we are changing users
sudo -i -u ${TEST_USER} bash << EOF
set -e
whoami
# Rust is installed from packages, no need for rustup
# Set up PATH for cargo
export PATH="/usr/local/bin:$PATH"
## VARs setup
cd "${WORKSPACE}"
unset FAIL_ON_FAULT ; case '${{ env.STYLE_FAIL_ON_FAULT }}' in
''|0|f|false|n|no|off) FAULT_TYPE=warning ;;
*) FAIL_ON_FAULT=true ; FAULT_TYPE=error ;;
esac;
FAULT_PREFIX=\$(echo "\${FAULT_TYPE}" | tr '[:lower:]' '[:upper:]')
# * determine sub-crate utility list
UTILITY_LIST="\$(./util/show-utils.sh --features ${{ matrix.job.features }})"
CARGO_UTILITY_LIST_OPTIONS="\$(for u in \${UTILITY_LIST}; do echo -n "-puu_\${u} "; done;)"
## Info
# environment
echo "## environment"
echo "CI='${CI}'"
echo "REPO_NAME='${REPO_NAME}'"
echo "TEST_USER='${TEST_USER}'"
echo "WORKSPACE_PARENT='${WORKSPACE_PARENT}'"
echo "WORKSPACE='${WORKSPACE}'"
echo "FAULT_PREFIX='\${FAULT_PREFIX}'"
echo "UTILITY_LIST='\${UTILITY_LIST}'"
env | sort
# tooling info
echo "## tooling info"
cargo -V
rustc -V
#
# To ensure that files are cleaned up, we don't want to exit on error
set +e
unset FAULT
## cargo fmt testing
echo "## cargo fmt testing"
# * 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>
S=\$(cargo fmt -- --check) && printf "%s\n" "\$S" || { printf "%s\n" "\$S" ; printf "%s\n" "\$S" | sed -E -n -e "s/^Diff[[:space:]]+in[[:space:]]+\${PWD//\//\\\\/}\/(.*)[[:space:]]+at[[:space:]]+[^0-9]+([0-9]+).*\$/::\${FAULT_TYPE} file=\1,line=\2::\${FAULT_PREFIX}: \\\`cargo fmt\\\`: style violation (file:'\1', line:\2; use \\\`cargo fmt -- \"\1\"\\\`)/p" ; FAULT=true ; }
## cargo clippy lint testing
if [ -z "\${FAULT}" ]; then
echo "## cargo clippy lint testing"
# * convert any warnings to GHA UI annotations; ref: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message>
S=\$(cargo clippy --all-targets \${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 ; }
fi
# Clean to avoid to rsync back the files
cargo clean
if [ -n "\${FAIL_ON_FAULT}" ] && [ -n "\${FAULT}" ]; then exit 1 ; fi
EOF
test:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
job:
- { features: unix }
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Prepare, build and test
uses: vmactions/openbsd-vm@v1
with:
usesh: true
sync: rsync
copyback: false
mem: 4096
# Install rust and build dependencies from OpenBSD packages (llvm provides libclang for bindgen)
prepare: pkg_add curl gmake sudo-- jq rust llvm--
run: |
## Prepare, build, and test
# implementation modelled after ref: <https://github.com/rust-lang/rustup/pull/2783>
# * NOTE: All steps need to be run in this block, otherwise, we are operating back on the mac host
set -e
#
TEST_USER=tester
REPO_NAME=${GITHUB_WORKSPACE##*/}
WORKSPACE_PARENT="/home/runner/work/${REPO_NAME}"
WORKSPACE="${WORKSPACE_PARENT}/${REPO_NAME}"
#
useradd -m -G wheel ${TEST_USER}
chown -R ${TEST_USER}:wheel /root/ "${WORKSPACE_PARENT}"/
whoami
# Add fake host for reverse DNS lookup (needed for hostname test)
printf "10.0.2.15\topenbsd.my.domain openbsd\n" >> /etc/hosts
#
# Further work needs to be done in a sudo as we are changing users
sudo -i -u ${TEST_USER} sh << EOF
set -e
whoami
# Increase max open files (512 by default)
ulimit -n 1024
# Rust is installed from packages, no need for rustup
# Set up PATH for cargo
export PATH="/usr/local/bin:$PATH"
# Install nextest
mkdir -p ~/.cargo/bin
# Note: nextest might not have OpenBSD builds, so we'll use regular cargo test
## Info
# environment
echo "## environment"
echo "CI='${CI}'"
echo "REPO_NAME='${REPO_NAME}'"
echo "TEST_USER='${TEST_USER}'"
echo "WORKSPACE_PARENT='${WORKSPACE_PARENT}'"
echo "WORKSPACE='${WORKSPACE}'"
env | sort
# tooling info
echo "## tooling info"
cargo -V
rustc -V
#
# To ensure that files are cleaned up, we don't want to exit on error
set +e
cd "${WORKSPACE}"
unset FAULT
cargo build || FAULT=1
export PATH=~/.cargo/bin:${PATH}
export RUST_BACKTRACE=1
export CARGO_TERM_COLOR=always
# Use cargo test since nextest might not support OpenBSD
if (test -z "\$FAULT"); then cargo test --features '${{ matrix.job.features }}' || FAULT=1 ; fi
# There is no systemd-logind on OpenBSD, so test all features except feat_systemd_logind
if (test -z "\$FAULT"); then
UUCORE_FEATURES=\$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "uucore") | .features | keys | .[]' | grep -v "feat_systemd_logind" | paste -s -d "," -)
cargo test --features "\$UUCORE_FEATURES" -p uucore || FAULT=1
fi
# Test building with make
if (test -z "\$FAULT"); then make || FAULT=1 ; fi
# Clean to avoid to rsync back the files
cargo clean
if (test -n "\$FAULT"); then exit 1 ; fi
EOF
+1 -1
View File
@@ -27,7 +27,7 @@ jobs:
job:
- { os: windows-latest, distribution: Ubuntu-24.04, features: feat_os_unix}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install WSL2
+15
View File
@@ -41,6 +41,7 @@ duplicative
dsync
endianness
enqueue
ERANGE
errored
executable
executables
@@ -120,6 +121,7 @@ pseudoprimes
quantiles
readonly
reparse
rposition
seedable
semver
semiprime
@@ -187,3 +189,16 @@ nofield
# * clippy
uninlined
nonminimal
# * CPU/hardware features
ASIMD
asimd
hwcaps
PCLMUL
pclmul
PCLMULQDQ
pclmulqdq
TUNABLES
tunables
VMULL
vmull
Generated
+209 -355
View File
File diff suppressed because it is too large Load Diff
+113 -117
View File
@@ -280,7 +280,6 @@ members = [
"src/uu/stdbuf/src/libstdbuf",
"src/uucore",
"src/uucore_procs",
"tests/benches/factor",
"tests/uutests",
# "fuzz", # TODO
]
@@ -293,7 +292,7 @@ homepage = "https://github.com/uutils/coreutils"
keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"]
license = "MIT"
readme = "README.package.md"
version = "0.4.0"
version = "0.5.0"
[workspace.dependencies]
ansi-width = "0.1.0"
@@ -350,7 +349,6 @@ notify = { version = "=8.2.0", features = ["macos_kqueue"] }
num-bigint = "0.4.4"
num-prime = "0.4.4"
num-traits = "0.2.19"
number_prefix = "0.4"
onig = { version = "~6.5.1", default-features = false }
parse_datetime = "0.13.0"
phf = "0.13.1"
@@ -374,6 +372,7 @@ textwrap = { version = "0.16.1", features = ["terminal_size"] }
thiserror = "2.0.3"
time = { version = "0.3.36" }
unicode-width = "0.2.0"
unit-prefix = "0.5"
utmp-classic = "0.1.6"
uutils_term_grid = "0.7"
walkdir = "2.5"
@@ -399,11 +398,11 @@ fluent-bundle = "0.16.0"
unic-langid = "0.9.6"
fluent-syntax = "0.12.0"
uucore = { version = "0.4.0", package = "uucore", path = "src/uucore" }
uucore_procs = { version = "0.4.0", package = "uucore_procs", path = "src/uucore_procs" }
uu_ls = { version = "0.4.0", path = "src/uu/ls" }
uu_base32 = { version = "0.4.0", path = "src/uu/base32" }
uutests = { version = "0.4.0", package = "uutests", path = "tests/uutests" }
uucore = { version = "0.5.0", package = "uucore", path = "src/uucore" }
uucore_procs = { version = "0.5.0", package = "uucore_procs", path = "src/uucore_procs" }
uu_ls = { version = "0.5.0", path = "src/uu/ls" }
uu_base32 = { version = "0.5.0", path = "src/uu/base32" }
uutests = { version = "0.5.0", package = "uutests", path = "tests/uutests" }
[dependencies]
clap.workspace = true
@@ -418,109 +417,109 @@ zip = { workspace = true, optional = true }
# * uutils
uu_test = { optional = true, version = "0.4.0", package = "uu_test", path = "src/uu/test" }
uu_test = { optional = true, version = "0.5.0", package = "uu_test", path = "src/uu/test" }
#
arch = { optional = true, version = "0.4.0", package = "uu_arch", path = "src/uu/arch" }
base32 = { optional = true, version = "0.4.0", package = "uu_base32", path = "src/uu/base32" }
base64 = { optional = true, version = "0.4.0", package = "uu_base64", path = "src/uu/base64" }
basename = { optional = true, version = "0.4.0", package = "uu_basename", path = "src/uu/basename" }
basenc = { optional = true, version = "0.4.0", package = "uu_basenc", path = "src/uu/basenc" }
cat = { optional = true, version = "0.4.0", package = "uu_cat", path = "src/uu/cat" }
chcon = { optional = true, version = "0.4.0", package = "uu_chcon", path = "src/uu/chcon" }
chgrp = { optional = true, version = "0.4.0", package = "uu_chgrp", path = "src/uu/chgrp" }
chmod = { optional = true, version = "0.4.0", package = "uu_chmod", path = "src/uu/chmod" }
chown = { optional = true, version = "0.4.0", package = "uu_chown", path = "src/uu/chown" }
chroot = { optional = true, version = "0.4.0", package = "uu_chroot", path = "src/uu/chroot" }
cksum = { optional = true, version = "0.4.0", package = "uu_cksum", path = "src/uu/cksum" }
comm = { optional = true, version = "0.4.0", package = "uu_comm", path = "src/uu/comm" }
cp = { optional = true, version = "0.4.0", package = "uu_cp", path = "src/uu/cp" }
csplit = { optional = true, version = "0.4.0", package = "uu_csplit", path = "src/uu/csplit" }
cut = { optional = true, version = "0.4.0", package = "uu_cut", path = "src/uu/cut" }
date = { optional = true, version = "0.4.0", package = "uu_date", path = "src/uu/date" }
dd = { optional = true, version = "0.4.0", package = "uu_dd", path = "src/uu/dd" }
df = { optional = true, version = "0.4.0", package = "uu_df", path = "src/uu/df" }
dir = { optional = true, version = "0.4.0", package = "uu_dir", path = "src/uu/dir" }
dircolors = { optional = true, version = "0.4.0", package = "uu_dircolors", path = "src/uu/dircolors" }
dirname = { optional = true, version = "0.4.0", package = "uu_dirname", path = "src/uu/dirname" }
du = { optional = true, version = "0.4.0", package = "uu_du", path = "src/uu/du" }
echo = { optional = true, version = "0.4.0", package = "uu_echo", path = "src/uu/echo" }
env = { optional = true, version = "0.4.0", package = "uu_env", path = "src/uu/env" }
expand = { optional = true, version = "0.4.0", package = "uu_expand", path = "src/uu/expand" }
expr = { optional = true, version = "0.4.0", package = "uu_expr", path = "src/uu/expr" }
factor = { optional = true, version = "0.4.0", package = "uu_factor", path = "src/uu/factor" }
false = { optional = true, version = "0.4.0", package = "uu_false", path = "src/uu/false" }
fmt = { optional = true, version = "0.4.0", package = "uu_fmt", path = "src/uu/fmt" }
fold = { optional = true, version = "0.4.0", package = "uu_fold", path = "src/uu/fold" }
groups = { optional = true, version = "0.4.0", package = "uu_groups", path = "src/uu/groups" }
hashsum = { optional = true, version = "0.4.0", package = "uu_hashsum", path = "src/uu/hashsum" }
head = { optional = true, version = "0.4.0", package = "uu_head", path = "src/uu/head" }
hostid = { optional = true, version = "0.4.0", package = "uu_hostid", path = "src/uu/hostid" }
hostname = { optional = true, version = "0.4.0", package = "uu_hostname", path = "src/uu/hostname" }
id = { optional = true, version = "0.4.0", package = "uu_id", path = "src/uu/id" }
install = { optional = true, version = "0.4.0", package = "uu_install", path = "src/uu/install" }
join = { optional = true, version = "0.4.0", package = "uu_join", path = "src/uu/join" }
kill = { optional = true, version = "0.4.0", package = "uu_kill", path = "src/uu/kill" }
link = { optional = true, version = "0.4.0", package = "uu_link", path = "src/uu/link" }
ln = { optional = true, version = "0.4.0", package = "uu_ln", path = "src/uu/ln" }
ls = { optional = true, version = "0.4.0", package = "uu_ls", path = "src/uu/ls" }
logname = { optional = true, version = "0.4.0", package = "uu_logname", path = "src/uu/logname" }
mkdir = { optional = true, version = "0.4.0", package = "uu_mkdir", path = "src/uu/mkdir" }
mkfifo = { optional = true, version = "0.4.0", package = "uu_mkfifo", path = "src/uu/mkfifo" }
mknod = { optional = true, version = "0.4.0", package = "uu_mknod", path = "src/uu/mknod" }
mktemp = { optional = true, version = "0.4.0", package = "uu_mktemp", path = "src/uu/mktemp" }
more = { optional = true, version = "0.4.0", package = "uu_more", path = "src/uu/more" }
mv = { optional = true, version = "0.4.0", package = "uu_mv", path = "src/uu/mv" }
nice = { optional = true, version = "0.4.0", package = "uu_nice", path = "src/uu/nice" }
nl = { optional = true, version = "0.4.0", package = "uu_nl", path = "src/uu/nl" }
nohup = { optional = true, version = "0.4.0", package = "uu_nohup", path = "src/uu/nohup" }
nproc = { optional = true, version = "0.4.0", package = "uu_nproc", path = "src/uu/nproc" }
numfmt = { optional = true, version = "0.4.0", package = "uu_numfmt", path = "src/uu/numfmt" }
od = { optional = true, version = "0.4.0", package = "uu_od", path = "src/uu/od" }
paste = { optional = true, version = "0.4.0", package = "uu_paste", path = "src/uu/paste" }
pathchk = { optional = true, version = "0.4.0", package = "uu_pathchk", path = "src/uu/pathchk" }
pinky = { optional = true, version = "0.4.0", package = "uu_pinky", path = "src/uu/pinky" }
pr = { optional = true, version = "0.4.0", package = "uu_pr", path = "src/uu/pr" }
printenv = { optional = true, version = "0.4.0", package = "uu_printenv", path = "src/uu/printenv" }
printf = { optional = true, version = "0.4.0", package = "uu_printf", path = "src/uu/printf" }
ptx = { optional = true, version = "0.4.0", package = "uu_ptx", path = "src/uu/ptx" }
pwd = { optional = true, version = "0.4.0", package = "uu_pwd", path = "src/uu/pwd" }
readlink = { optional = true, version = "0.4.0", package = "uu_readlink", path = "src/uu/readlink" }
realpath = { optional = true, version = "0.4.0", package = "uu_realpath", path = "src/uu/realpath" }
rm = { optional = true, version = "0.4.0", package = "uu_rm", path = "src/uu/rm" }
rmdir = { optional = true, version = "0.4.0", package = "uu_rmdir", path = "src/uu/rmdir" }
runcon = { optional = true, version = "0.4.0", package = "uu_runcon", path = "src/uu/runcon" }
seq = { optional = true, version = "0.4.0", package = "uu_seq", path = "src/uu/seq" }
shred = { optional = true, version = "0.4.0", package = "uu_shred", path = "src/uu/shred" }
shuf = { optional = true, version = "0.4.0", package = "uu_shuf", path = "src/uu/shuf" }
sleep = { optional = true, version = "0.4.0", package = "uu_sleep", path = "src/uu/sleep" }
sort = { optional = true, version = "0.4.0", package = "uu_sort", path = "src/uu/sort" }
split = { optional = true, version = "0.4.0", package = "uu_split", path = "src/uu/split" }
stat = { optional = true, version = "0.4.0", package = "uu_stat", path = "src/uu/stat" }
stdbuf = { optional = true, version = "0.4.0", package = "uu_stdbuf", path = "src/uu/stdbuf" }
stty = { optional = true, version = "0.4.0", package = "uu_stty", path = "src/uu/stty" }
sum = { optional = true, version = "0.4.0", package = "uu_sum", path = "src/uu/sum" }
sync = { optional = true, version = "0.4.0", package = "uu_sync", path = "src/uu/sync" }
tac = { optional = true, version = "0.4.0", package = "uu_tac", path = "src/uu/tac" }
tail = { optional = true, version = "0.4.0", package = "uu_tail", path = "src/uu/tail" }
tee = { optional = true, version = "0.4.0", package = "uu_tee", path = "src/uu/tee" }
timeout = { optional = true, version = "0.4.0", package = "uu_timeout", path = "src/uu/timeout" }
touch = { optional = true, version = "0.4.0", package = "uu_touch", path = "src/uu/touch" }
tr = { optional = true, version = "0.4.0", package = "uu_tr", path = "src/uu/tr" }
true = { optional = true, version = "0.4.0", package = "uu_true", path = "src/uu/true" }
truncate = { optional = true, version = "0.4.0", package = "uu_truncate", path = "src/uu/truncate" }
tsort = { optional = true, version = "0.4.0", package = "uu_tsort", path = "src/uu/tsort" }
tty = { optional = true, version = "0.4.0", package = "uu_tty", path = "src/uu/tty" }
uname = { optional = true, version = "0.4.0", package = "uu_uname", path = "src/uu/uname" }
unexpand = { optional = true, version = "0.4.0", package = "uu_unexpand", path = "src/uu/unexpand" }
uniq = { optional = true, version = "0.4.0", package = "uu_uniq", path = "src/uu/uniq" }
unlink = { optional = true, version = "0.4.0", package = "uu_unlink", path = "src/uu/unlink" }
uptime = { optional = true, version = "0.4.0", package = "uu_uptime", path = "src/uu/uptime" }
users = { optional = true, version = "0.4.0", package = "uu_users", path = "src/uu/users" }
vdir = { optional = true, version = "0.4.0", package = "uu_vdir", path = "src/uu/vdir" }
wc = { optional = true, version = "0.4.0", package = "uu_wc", path = "src/uu/wc" }
who = { optional = true, version = "0.4.0", package = "uu_who", path = "src/uu/who" }
whoami = { optional = true, version = "0.4.0", package = "uu_whoami", path = "src/uu/whoami" }
yes = { optional = true, version = "0.4.0", package = "uu_yes", path = "src/uu/yes" }
arch = { optional = true, version = "0.5.0", package = "uu_arch", path = "src/uu/arch" }
base32 = { optional = true, version = "0.5.0", package = "uu_base32", path = "src/uu/base32" }
base64 = { optional = true, version = "0.5.0", package = "uu_base64", path = "src/uu/base64" }
basename = { optional = true, version = "0.5.0", package = "uu_basename", path = "src/uu/basename" }
basenc = { optional = true, version = "0.5.0", package = "uu_basenc", path = "src/uu/basenc" }
cat = { optional = true, version = "0.5.0", package = "uu_cat", path = "src/uu/cat" }
chcon = { optional = true, version = "0.5.0", package = "uu_chcon", path = "src/uu/chcon" }
chgrp = { optional = true, version = "0.5.0", package = "uu_chgrp", path = "src/uu/chgrp" }
chmod = { optional = true, version = "0.5.0", package = "uu_chmod", path = "src/uu/chmod" }
chown = { optional = true, version = "0.5.0", package = "uu_chown", path = "src/uu/chown" }
chroot = { optional = true, version = "0.5.0", package = "uu_chroot", path = "src/uu/chroot" }
cksum = { optional = true, version = "0.5.0", package = "uu_cksum", path = "src/uu/cksum" }
comm = { optional = true, version = "0.5.0", package = "uu_comm", path = "src/uu/comm" }
cp = { optional = true, version = "0.5.0", package = "uu_cp", path = "src/uu/cp" }
csplit = { optional = true, version = "0.5.0", package = "uu_csplit", path = "src/uu/csplit" }
cut = { optional = true, version = "0.5.0", package = "uu_cut", path = "src/uu/cut" }
date = { optional = true, version = "0.5.0", package = "uu_date", path = "src/uu/date" }
dd = { optional = true, version = "0.5.0", package = "uu_dd", path = "src/uu/dd" }
df = { optional = true, version = "0.5.0", package = "uu_df", path = "src/uu/df" }
dir = { optional = true, version = "0.5.0", package = "uu_dir", path = "src/uu/dir" }
dircolors = { optional = true, version = "0.5.0", package = "uu_dircolors", path = "src/uu/dircolors" }
dirname = { optional = true, version = "0.5.0", package = "uu_dirname", path = "src/uu/dirname" }
du = { optional = true, version = "0.5.0", package = "uu_du", path = "src/uu/du" }
echo = { optional = true, version = "0.5.0", package = "uu_echo", path = "src/uu/echo" }
env = { optional = true, version = "0.5.0", package = "uu_env", path = "src/uu/env" }
expand = { optional = true, version = "0.5.0", package = "uu_expand", path = "src/uu/expand" }
expr = { optional = true, version = "0.5.0", package = "uu_expr", path = "src/uu/expr" }
factor = { optional = true, version = "0.5.0", package = "uu_factor", path = "src/uu/factor" }
false = { optional = true, version = "0.5.0", package = "uu_false", path = "src/uu/false" }
fmt = { optional = true, version = "0.5.0", package = "uu_fmt", path = "src/uu/fmt" }
fold = { optional = true, version = "0.5.0", package = "uu_fold", path = "src/uu/fold" }
groups = { optional = true, version = "0.5.0", package = "uu_groups", path = "src/uu/groups" }
hashsum = { optional = true, version = "0.5.0", package = "uu_hashsum", path = "src/uu/hashsum" }
head = { optional = true, version = "0.5.0", package = "uu_head", path = "src/uu/head" }
hostid = { optional = true, version = "0.5.0", package = "uu_hostid", path = "src/uu/hostid" }
hostname = { optional = true, version = "0.5.0", package = "uu_hostname", path = "src/uu/hostname" }
id = { optional = true, version = "0.5.0", package = "uu_id", path = "src/uu/id" }
install = { optional = true, version = "0.5.0", package = "uu_install", path = "src/uu/install" }
join = { optional = true, version = "0.5.0", package = "uu_join", path = "src/uu/join" }
kill = { optional = true, version = "0.5.0", package = "uu_kill", path = "src/uu/kill" }
link = { optional = true, version = "0.5.0", package = "uu_link", path = "src/uu/link" }
ln = { optional = true, version = "0.5.0", package = "uu_ln", path = "src/uu/ln" }
ls = { optional = true, version = "0.5.0", package = "uu_ls", path = "src/uu/ls" }
logname = { optional = true, version = "0.5.0", package = "uu_logname", path = "src/uu/logname" }
mkdir = { optional = true, version = "0.5.0", package = "uu_mkdir", path = "src/uu/mkdir" }
mkfifo = { optional = true, version = "0.5.0", package = "uu_mkfifo", path = "src/uu/mkfifo" }
mknod = { optional = true, version = "0.5.0", package = "uu_mknod", path = "src/uu/mknod" }
mktemp = { optional = true, version = "0.5.0", package = "uu_mktemp", path = "src/uu/mktemp" }
more = { optional = true, version = "0.5.0", package = "uu_more", path = "src/uu/more" }
mv = { optional = true, version = "0.5.0", package = "uu_mv", path = "src/uu/mv" }
nice = { optional = true, version = "0.5.0", package = "uu_nice", path = "src/uu/nice" }
nl = { optional = true, version = "0.5.0", package = "uu_nl", path = "src/uu/nl" }
nohup = { optional = true, version = "0.5.0", package = "uu_nohup", path = "src/uu/nohup" }
nproc = { optional = true, version = "0.5.0", package = "uu_nproc", path = "src/uu/nproc" }
numfmt = { optional = true, version = "0.5.0", package = "uu_numfmt", path = "src/uu/numfmt" }
od = { optional = true, version = "0.5.0", package = "uu_od", path = "src/uu/od" }
paste = { optional = true, version = "0.5.0", package = "uu_paste", path = "src/uu/paste" }
pathchk = { optional = true, version = "0.5.0", package = "uu_pathchk", path = "src/uu/pathchk" }
pinky = { optional = true, version = "0.5.0", package = "uu_pinky", path = "src/uu/pinky" }
pr = { optional = true, version = "0.5.0", package = "uu_pr", path = "src/uu/pr" }
printenv = { optional = true, version = "0.5.0", package = "uu_printenv", path = "src/uu/printenv" }
printf = { optional = true, version = "0.5.0", package = "uu_printf", path = "src/uu/printf" }
ptx = { optional = true, version = "0.5.0", package = "uu_ptx", path = "src/uu/ptx" }
pwd = { optional = true, version = "0.5.0", package = "uu_pwd", path = "src/uu/pwd" }
readlink = { optional = true, version = "0.5.0", package = "uu_readlink", path = "src/uu/readlink" }
realpath = { optional = true, version = "0.5.0", package = "uu_realpath", path = "src/uu/realpath" }
rm = { optional = true, version = "0.5.0", package = "uu_rm", path = "src/uu/rm" }
rmdir = { optional = true, version = "0.5.0", package = "uu_rmdir", path = "src/uu/rmdir" }
runcon = { optional = true, version = "0.5.0", package = "uu_runcon", path = "src/uu/runcon" }
seq = { optional = true, version = "0.5.0", package = "uu_seq", path = "src/uu/seq" }
shred = { optional = true, version = "0.5.0", package = "uu_shred", path = "src/uu/shred" }
shuf = { optional = true, version = "0.5.0", package = "uu_shuf", path = "src/uu/shuf" }
sleep = { optional = true, version = "0.5.0", package = "uu_sleep", path = "src/uu/sleep" }
sort = { optional = true, version = "0.5.0", package = "uu_sort", path = "src/uu/sort" }
split = { optional = true, version = "0.5.0", package = "uu_split", path = "src/uu/split" }
stat = { optional = true, version = "0.5.0", package = "uu_stat", path = "src/uu/stat" }
stdbuf = { optional = true, version = "0.5.0", package = "uu_stdbuf", path = "src/uu/stdbuf" }
stty = { optional = true, version = "0.5.0", package = "uu_stty", path = "src/uu/stty" }
sum = { optional = true, version = "0.5.0", package = "uu_sum", path = "src/uu/sum" }
sync = { optional = true, version = "0.5.0", package = "uu_sync", path = "src/uu/sync" }
tac = { optional = true, version = "0.5.0", package = "uu_tac", path = "src/uu/tac" }
tail = { optional = true, version = "0.5.0", package = "uu_tail", path = "src/uu/tail" }
tee = { optional = true, version = "0.5.0", package = "uu_tee", path = "src/uu/tee" }
timeout = { optional = true, version = "0.5.0", package = "uu_timeout", path = "src/uu/timeout" }
touch = { optional = true, version = "0.5.0", package = "uu_touch", path = "src/uu/touch" }
tr = { optional = true, version = "0.5.0", package = "uu_tr", path = "src/uu/tr" }
true = { optional = true, version = "0.5.0", package = "uu_true", path = "src/uu/true" }
truncate = { optional = true, version = "0.5.0", package = "uu_truncate", path = "src/uu/truncate" }
tsort = { optional = true, version = "0.5.0", package = "uu_tsort", path = "src/uu/tsort" }
tty = { optional = true, version = "0.5.0", package = "uu_tty", path = "src/uu/tty" }
uname = { optional = true, version = "0.5.0", package = "uu_uname", path = "src/uu/uname" }
unexpand = { optional = true, version = "0.5.0", package = "uu_unexpand", path = "src/uu/unexpand" }
uniq = { optional = true, version = "0.5.0", package = "uu_uniq", path = "src/uu/uniq" }
unlink = { optional = true, version = "0.5.0", package = "uu_unlink", path = "src/uu/unlink" }
uptime = { optional = true, version = "0.5.0", package = "uu_uptime", path = "src/uu/uptime" }
users = { optional = true, version = "0.5.0", package = "uu_users", path = "src/uu/users" }
vdir = { optional = true, version = "0.5.0", package = "uu_vdir", path = "src/uu/vdir" }
wc = { optional = true, version = "0.5.0", package = "uu_wc", path = "src/uu/wc" }
who = { optional = true, version = "0.5.0", package = "uu_who", path = "src/uu/who" }
whoami = { optional = true, version = "0.5.0", package = "uu_whoami", path = "src/uu/whoami" }
yes = { optional = true, version = "0.5.0", package = "uu_yes", path = "src/uu/yes" }
# this breaks clippy linting with: "tests/by-util/test_factor_benches.rs: No such file or directory (os error 2)"
# factor_benches = { optional = true, version = "0.0.0", package = "uu_factor_benches", path = "tests/benches/factor" }
@@ -587,17 +586,13 @@ name = "uudoc"
path = "src/bin/uudoc.rs"
required-features = ["uudoc"]
# The default release profile. It contains all optimizations.
# With this profile (like in the standard release profile),
# the stack traces will still be available.
# The default release profile with some optimizations.
[profile.release]
lto = true
panic = "abort"
# A release-like profile that is tuned to be fast, even when being fast
# compromises on binary size. This includes aborting on panic.
[profile.release-fast]
inherits = "release"
panic = "abort"
codegen-units = 1
# A release-like profile that is as small as possible.
@@ -606,10 +601,11 @@ inherits = "release-fast"
opt-level = "z"
strip = true
# A release-like profile with debug info, useful for profiling.
# A release-like profile with debug info for profiling.
# See https://github.com/mstange/samply .
[profile.profiling]
inherits = "release"
panic = "unwind"
debug = true
[lints]
+3 -2
View File
@@ -230,7 +230,9 @@ To run uutils against the GNU test suite locally, run the following commands:
```shell
bash util/build-gnu.sh
# Build uutils with release optimizations
bash util/build-gnu.sh --release-build
env PROFILE=release bash util/build-gnu.sh
# Build uutils with SELinux
env SELINUX_ENABLED=1 bash util/build-gnu.sh
bash util/run-gnu-test.sh
# To run a single test:
bash util/run-gnu-test.sh tests/touch/not-owner.sh # for example
@@ -289,7 +291,6 @@ brew install \
coreutils \
autoconf \
gettext \
wget \
texinfo \
xz \
automake \
+17 -36
View File
@@ -1,15 +1,15 @@
# spell-checker:ignore (misc) testsuite runtest findstring (targets) busytest toybox distclean pkgs nextest ; (vars/env) BINDIR BUILDDIR CARGOFLAGS DESTDIR DOCSDIR INSTALLDIR INSTALLEES MULTICALL DATAROOTDIR TESTDIR manpages
# Config options
ifneq (,$(filter install, $(MAKECMDGOALS)))
PROFILE?=release
endif
PROFILE ?= debug
MULTICALL ?= n
COMPLETIONS ?= y
MANPAGES ?= y
LOCALES ?= y
INSTALL ?= install
ifneq (,$(filter install, $(MAKECMDGOALS)))
override PROFILE:=release
endif
# Needed for the foreach loops to split each loop into a separate command
define newline
@@ -17,9 +17,9 @@ define newline
endef
PROFILE_CMD :=
ifeq ($(PROFILE),release)
PROFILE_CMD = --release
PROFILE_CMD := --profile=${PROFILE}
ifeq ($(PROFILE),debug)
PROFILE_CMD =
endif
# Binaries
@@ -75,19 +75,6 @@ ifeq ($(OS),Windows_NT)
endif
LN ?= ln -sf
ifdef SELINUX_ENABLED
override SELINUX_ENABLED := 0
# Now check if we should enable it (only on non-Windows)
ifneq ($(OS),Windows_NT)
ifeq ($(shell if [ -x /sbin/selinuxenabled ] && /sbin/selinuxenabled 2>/dev/null; then echo 0; else echo 1; fi),0)
override SELINUX_ENABLED := 1
$(info /sbin/selinuxenabled successful)
else
$(info SELINUX_ENABLED=1 but /sbin/selinuxenabled failed)
endif
endif
endif
# Possible programs
PROGS := \
arch \
@@ -208,15 +195,11 @@ HASHSUM_PROGS := \
$(info Detected OS = $(OS))
# Don't build the SELinux programs on macOS (Darwin) and FreeBSD
ifeq ($(filter $(OS),Darwin FreeBSD),$(OS))
SELINUX_PROGS :=
endif
ifneq ($(OS),Windows_NT)
PROGS := $(PROGS) $(UNIX_PROGS)
# Build the selinux command even if not on the system
PROGS := $(PROGS) $(SELINUX_PROGS)
PROGS += $(UNIX_PROGS)
endif
ifeq ($(SELINUX_ENABLED),1)
PROGS += $(SELINUX_PROGS)
endif
UTILS ?= $(filter-out $(SKIP_UTILS),$(PROGS))
@@ -330,8 +313,6 @@ endif
all: build
use_default := 1
build-pkgs:
ifneq (${MULTICALL}, y)
ifdef BUILD_SPEC_FEATURE
@@ -349,10 +330,10 @@ build: build-coreutils build-pkgs locales
$(foreach test,$(UTILS),$(eval $(call TEST_BUSYBOX,$(test))))
test:
${CARGO} test ${CARGOFLAGS} --features "$(TESTS) $(TEST_SPEC_FEATURE)" --no-default-features $(TEST_NO_FAIL_FAST)
${CARGO} test ${CARGOFLAGS} --features "$(TESTS) $(TEST_SPEC_FEATURE)" $(PROFILE_CMD) --no-default-features $(TEST_NO_FAIL_FAST)
nextest:
${CARGO} nextest run ${CARGOFLAGS} --features "$(TESTS) $(TEST_SPEC_FEATURE)" --no-default-features $(TEST_NO_FAIL_FAST)
${CARGO} nextest run ${CARGOFLAGS} --features "$(TESTS) $(TEST_SPEC_FEATURE)" $(PROFILE_CMD) --no-default-features $(TEST_NO_FAIL_FAST)
test_toybox:
-(cd $(TOYBOX_SRC)/ && make tests)
@@ -360,7 +341,7 @@ test_toybox:
toybox-src:
if [ ! -e "$(TOYBOX_SRC)" ] ; then \
mkdir -p "$(TOYBOX_ROOT)" ; \
wget "https://github.com/landley/toybox/archive/refs/tags/$(TOYBOX_VER).tar.gz" -P "$(TOYBOX_ROOT)" ; \
curl -Ls "https://github.com/landley/toybox/archive/refs/tags/$(TOYBOX_VER).tar.gz" -o "$(TOYBOX_ROOT)/$(TOYBOX_VER).tar.gz" ; \
tar -C "$(TOYBOX_ROOT)" -xf "$(TOYBOX_ROOT)/$(TOYBOX_VER).tar.gz" ; \
sed -i -e "s|TESTDIR=\".*\"|TESTDIR=\"$(BUILDDIR)\"|g" $(TOYBOX_SRC)/scripts/test.sh; \
sed -i -e "s/ || exit 1//g" $(TOYBOX_SRC)/scripts/test.sh; \
@@ -369,8 +350,8 @@ toybox-src:
busybox-src:
if [ ! -e "$(BUSYBOX_SRC)" ] ; then \
mkdir -p "$(BUSYBOX_ROOT)" ; \
wget "https://busybox.net/downloads/busybox-$(BUSYBOX_VER).tar.bz2" -P "$(BUSYBOX_ROOT)" ; \
tar -C "$(BUSYBOX_ROOT)" -xf "$(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER).tar.bz2" ; \
curl -Ls "https://github.com/mirror/busybox/archive/refs/tags/$(subst .,_,$(BUSYBOX_VER)).tar.gz" -o "$(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER).tar.gz" ; \
tar -C "$(BUSYBOX_ROOT)" -xf "$(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER).tar.gz" ; \
fi ;
# This is a busybox-specific config file their test suite wants to parse.
@@ -469,7 +450,7 @@ install: build install-manpages install-completions install-locales
mkdir -p $(INSTALLDIR_BIN)
ifneq (,$(and $(findstring stdbuf,$(UTILS)),$(findstring feat_external_libstdbuf,$(CARGOFLAGS))))
mkdir -p $(DESTDIR)$(LIBSTDBUF_DIR)
$(INSTALL) -m 755 $(BUILDDIR)/deps/libstdbuf* $(DESTDIR)$(LIBSTDBUF_DIR)/
$(INSTALL) -m 755 $(BUILDDIR)/deps/libstdbuf.* $(DESTDIR)$(LIBSTDBUF_DIR)/
endif
ifeq (${MULTICALL}, y)
$(INSTALL) -m 755 $(BUILDDIR)/coreutils $(INSTALLDIR_BIN)/$(PROG_PREFIX)coreutils
@@ -492,7 +473,7 @@ endif
uninstall:
ifneq ($(OS),Windows_NT)
rm -f $(DESTDIR)$(LIBSTDBUF_DIR)/libstdbuf*
rm -f $(DESTDIR)$(LIBSTDBUF_DIR)/libstdbuf.*
-rm -d $(DESTDIR)$(LIBSTDBUF_DIR) 2>/dev/null || true
endif
ifeq (${MULTICALL}, y)

Some files were not shown because too many files have changed in this diff Show More