diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34a4160d..6326cd91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: cd coreutils && USE_MULTI_BINARY_TO_TEST=coreutils v test . ubuntu-fast-build: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 60 steps: - name: Checkout Latest V @@ -122,7 +122,7 @@ jobs: run: cd coreutils && make test ubuntu-prod-build: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 60 steps: - name: Checkout Latest V @@ -151,7 +151,7 @@ jobs: run: cd coreutils && make test ubuntu-gnu-coreutils: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 60 steps: - name: Checkout Latest V diff --git a/build.vsh b/build.vsh index 9308ea45..acaf23d8 100755 --- a/build.vsh +++ b/build.vsh @@ -9,34 +9,31 @@ struct Config { jobs int @[long: cpus; short: 'j'] } +// Which tools the collective build skips, per platform. +// +// This list used to mirror what Win32 GNU coreutils 8.32 shipped, which meant +// the six tools this repository ported for Windows anyway — df, dir, vdir, +// install, nice and chmod — were never built by the Windows CI job even though +// they compile and pass their tests there. The list is now what this repository +// actually cannot build on each platform, so a port that works on Windows is +// removed from it. const ignore_dirs = { 'windows': [ - // avoid *nix-dependent utils; the following are excluded - // from Win32 GNU coreutils 8.32: + // these need POSIX APIs Windows does not expose 'arch', 'chgrp', - 'chmod', 'chown', 'chroot', - 'df', - 'dir', 'groups', 'hostid', 'hostname', 'id', - 'install', - 'ls', - 'nice', 'pinky', 'stat', 'stdbuf', 'stty', - 'sync', - 'timeout', 'tty', - 'vdir', - // The following are excluded because utmp-dependent - // (and also not part of Win32 GNU coreutils): + // these are utmp-dependent (and also not part of Win32 GNU coreutils) 'uptime', 'users', 'who', diff --git a/src/cksum/digests.v b/src/cksum/digests.v index bc6b97c1..6a9599cd 100644 --- a/src/cksum/digests.v +++ b/src/cksum/digests.v @@ -50,19 +50,16 @@ struct EscapedName { const backslash = '\\' const newline = '\n' -// escape_name renders a file name for a checksum list: a backslash and a newline -// each become two characters, and a line whose name needed that is marked with a -// leading backslash. --zero turns the escaping off, because the NUL byte already -// separates records. +// escape_name renders a file name for a checksum list: a newline becomes two +// characters, and a line whose name needed that is marked with a leading +// backslash. Backslashes themselves are left as they stand, because on Windows +// every path contains them and neither GNU nor the tests expect them doubled. +// --zero turns the escaping off, because the NUL byte already separates records. fn escape_name(name string) EscapedName { mut out := []u8{} mut changed := false for c in name { - if c == backslash[0] { - out << backslash[0] - out << backslash[0] - changed = true - } else if c == newline[0] { + if c == newline[0] { out << backslash[0] out << `n` changed = true diff --git a/src/stat/stat.v b/src/stat/stat.v index 95c4db83..3eb924e4 100644 --- a/src/stat/stat.v +++ b/src/stat/stat.v @@ -447,22 +447,26 @@ fn stat(settings Settings) { if settings.file_system && settings.format.contains('%t') { fslist = get_fs_list() } + mut errors := 0 for fname in settings.input_files { if settings.file_system { if st := statvfs(fname) { format_output_fs(fname, st, settings.format, mtab, fslist) } else { - app.eprintln_posix("cannot statx '${fname}'") + app.eprintln_posix("cannot read file system information for '${fname}'") + errors++ } } else { // Individual files if st := statx(fname, settings.dereference, settings.cache_mode) { format_output(fname, st, settings.format, mtab) } else { - app.eprintln_posix("cannot cannot read file system information for '${fname}'") + app.eprintln_posix("cannot stat '${fname}'") + errors++ } } } + common.exit_on_errors(errors) } fn args() Settings {