Skip to content

split: quote a zero SIZE in the invalid-number diagnostic #42312

split: quote a zero SIZE in the invalid-number diagnostic

split: quote a zero SIZE in the invalid-number diagnostic #42312

Workflow file for this run

name: FreeBSD
# spell-checker:ignore sshfs usesh vmactions taiki esac fdescfs fdesc nextest copyback logind
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.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
style:
name: Style and Lint
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
targets: x86_64-unknown-freebsd
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
id: sccache-setup
uses: mozilla-actions/sccache-action@v0.0.11
continue-on-error: true
- name: Export sccache
if: steps.sccache-setup.outcome == 'success'
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
- uses: mlugg/setup-zig@v2.2.1
- uses: taiki-e/install-action@v2
with:
tool: cargo-zigbuild
- name: cargo clippy
env:
CARGO_INCREMENTAL: "0"
run: |
UTILS=$(cargo tree --depth 1 --features feat_os_unix --format '{lib}' --prefix none | sed -n 's/^uu_/-p uu_/p')
cargo-zigbuild clippy --target x86_64-unknown-freebsd --features feat_os_unix -p coreutils ${UTILS} --all-targets --tests --benches -- -D warnings
test:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 45
env:
mem: 4096
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Avoid no space left on device (Ubuntu runner)
shell: bash
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android &
- name: Prepare, build and test
uses: vmactions/freebsd-vm@v1.6.0
with:
usesh: true
sync: rsync
copyback: false
prepare: pkg install -y gmake nextest rust sudo
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
#
# We need a file-descriptor file system to test test_ls::test_ls_io_errors
mount -t fdescfs fdesc /dev/fd
#
TEST_USER=tester
REPO_NAME=${GITHUB_WORKSPACE##*/}
WORKSPACE_PARENT="/home/runner/work/${REPO_NAME}"
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}"/
whoami
#
# Further work needs to be done in a sudo as we are changing users
sudo -i -u ${TEST_USER} sh << EOF
set -e
whoami
## 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
cargo nextest --version
rustc -V
#
# To ensure that files are cleaned up, we don't want to exit on error
set +e
cd "${WORKSPACE}"
unset FAULT
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-C strip=symbols" # for disk space
# vendored OpenSSL takes many times to build. Use system one (LibreSSL is supported).
export OPENSSL_NO_VENDOR=1 OPENSSL_DIR=/usr
cargo build || FAULT=1
export PATH=~/.cargo/bin:${PATH}
export RUST_BACKTRACE=1
export CARGO_TERM_COLOR=always
if (test -z "\$FAULT"); then cargo nextest run --hide-progress-bar --profile ci --features feat_os_unix || FAULT=1 ; fi
if (test -z "\$FAULT"); then cargo nextest run --hide-progress-bar --profile ci --all-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