]> Sergey Matveev's repositories - bfs.git/log
bfs.git
6 months agoSkip mtab main
Sergey Matveev [Thu, 10 Feb 2022 12:43:56 +0000 (15:43 +0300)]
Skip mtab

It is used only for -fstype and can stuck when NFS mountpoint is dead.

6 months agoMake static executable
Sergey Matveev [Thu, 10 Feb 2022 12:42:53 +0000 (15:42 +0300)]
Make static executable

6 months agobftw: Improve ioq balancing logic
Tavian Barnes [Wed, 1 Nov 2023 15:18:39 +0000 (11:18 -0400)]
bftw: Improve ioq balancing logic

6 months agobfstd: New xwaitpid() wrapper
Tavian Barnes [Tue, 31 Oct 2023 17:25:04 +0000 (13:25 -0400)]
bfstd: New xwaitpid() wrapper

6 months agobftw: Leave work for the main thread if profitable
Tavian Barnes [Tue, 31 Oct 2023 16:30:07 +0000 (12:30 -0400)]
bftw: Leave work for the main thread if profitable

6 months agothread: Move thread wrapper functions out of line
Tavian Barnes [Fri, 27 Oct 2023 16:45:10 +0000 (12:45 -0400)]
thread: Move thread wrapper functions out of line

6 months agotypo: Shrink the key_coords table
Tavian Barnes [Fri, 27 Oct 2023 16:17:10 +0000 (12:17 -0400)]
typo: Shrink the key_coords table

6 months agoUse {0} to initialize mbstate_t rather than memset()
Tavian Barnes [Fri, 27 Oct 2023 15:21:38 +0000 (11:21 -0400)]
Use {0} to initialize mbstate_t rather than memset()

6 months agoeval: TTY-escape paths in the status bar
Tavian Barnes [Fri, 27 Oct 2023 15:10:26 +0000 (11:10 -0400)]
eval: TTY-escape paths in the status bar

6 months agobfstd: Expose xmbrtowc() and use it in eval_status()
Tavian Barnes [Fri, 27 Oct 2023 14:58:47 +0000 (10:58 -0400)]
bfstd: Expose xmbrtowc() and use it in eval_status()

6 months agobfstd: Only free the locale if we dup'd it successfully
Tavian Barnes [Thu, 26 Oct 2023 14:57:25 +0000 (10:57 -0400)]
bfstd: Only free the locale if we dup'd it successfully

6 months agoci: Run tests in parallel on macOS and FreeBSD
Tavian Barnes [Mon, 23 Oct 2023 19:00:31 +0000 (15:00 -0400)]
ci: Run tests in parallel on macOS and FreeBSD

6 months agotests/bfs/help: Fix exit status
Tavian Barnes [Mon, 23 Oct 2023 17:46:52 +0000 (13:46 -0400)]
tests/bfs/help: Fix exit status

6 months agotests/bfs/help: Use ... && fail instead of ! ...
Tavian Barnes [Mon, 23 Oct 2023 17:34:33 +0000 (13:34 -0400)]
tests/bfs/help: Use ... && fail instead of ! ...

! false doesn't trigger an error with set -e.

6 months agotests/bfs/printf_color: Fix race condition
Tavian Barnes [Mon, 23 Oct 2023 17:06:44 +0000 (13:06 -0400)]
tests/bfs/printf_color: Fix race condition

Invoking bfs in the top directory can lead it to explore other tests'
scratch directories, so explicitly exclude them.

6 months agotests: Document -j
Tavian Barnes [Mon, 23 Oct 2023 17:05:15 +0000 (13:05 -0400)]
tests: Document -j

6 months agotests: Clean up verbose logging a bit
Tavian Barnes [Mon, 23 Oct 2023 17:00:51 +0000 (13:00 -0400)]
tests: Clean up verbose logging a bit

6 months agotests: Fix Bash 3 compatibility
Tavian Barnes [Mon, 23 Oct 2023 15:42:33 +0000 (11:42 -0400)]
tests: Fix Bash 3 compatibility

6 months agotests: Run test cases in parallel
Tavian Barnes [Mon, 23 Oct 2023 14:12:25 +0000 (10:12 -0400)]
tests: Run test cases in parallel

6 months agotests: Use test-specific scratch directories
Tavian Barnes [Sun, 22 Oct 2023 20:41:41 +0000 (16:41 -0400)]
tests: Use test-specific scratch directories

7 months agotests: Fix column detection with redirected stderr
Tavian Barnes [Fri, 20 Oct 2023 19:56:55 +0000 (15:56 -0400)]
tests: Fix column detection with redirected stderr

7 months agotests/color: Remove some useless cats
Tavian Barnes [Fri, 20 Oct 2023 19:52:45 +0000 (15:52 -0400)]
tests/color: Remove some useless cats

7 months agotests: Use xtouch to create the whole deep tree at once
Tavian Barnes [Fri, 20 Oct 2023 15:18:25 +0000 (11:18 -0400)]
tests: Use xtouch to create the whole deep tree at once

7 months agotests/xtouch: Recover from ENAMETOOLONG
Tavian Barnes [Fri, 20 Oct 2023 15:18:15 +0000 (11:18 -0400)]
tests/xtouch: Recover from ENAMETOOLONG

7 months agotests: Don't unset array[-1]
Tavian Barnes [Thu, 19 Oct 2023 21:05:36 +0000 (17:05 -0400)]
tests: Don't unset array[-1]

This was only added in Bash 4.3 which is too new for macOS.

7 months agotests: Refactor implementation into separate files
Tavian Barnes [Thu, 19 Oct 2023 20:37:47 +0000 (16:37 -0400)]
tests: Refactor implementation into separate files

7 months agotests: Update bash coding style
Tavian Barnes [Thu, 19 Oct 2023 15:39:04 +0000 (11:39 -0400)]
tests: Update bash coding style

7 months agotests: Clean up colorization
Tavian Barnes [Thu, 19 Oct 2023 15:31:31 +0000 (11:31 -0400)]
tests: Clean up colorization

7 months agotests: Use the ERR trap to print the failing command
Tavian Barnes [Thu, 19 Oct 2023 14:19:45 +0000 (10:19 -0400)]
tests: Use the ERR trap to print the failing command

7 months agotests: Fix uses of $? with set -e
Tavian Barnes [Thu, 19 Oct 2023 13:34:58 +0000 (09:34 -0400)]
tests: Fix uses of $? with set -e

7 months agotests: New defer function
Tavian Barnes [Thu, 19 Oct 2023 13:31:33 +0000 (09:31 -0400)]
tests: New defer function

7 months agotests: Rename --noclean -> --no-clean
Tavian Barnes [Thu, 19 Oct 2023 12:04:30 +0000 (08:04 -0400)]
tests: Rename --noclean -> --no-clean

7 months agobench: Account for tailfin's at-exit -> defer rename
Tavian Barnes [Thu, 19 Oct 2023 12:03:04 +0000 (08:03 -0400)]
bench: Account for tailfin's at-exit -> defer rename

7 months agowordesc: Don't allow braces in bare words
Tavian Barnes [Wed, 18 Oct 2023 15:34:21 +0000 (11:34 -0400)]
wordesc: Don't allow braces in bare words

Things like {a,b} should be quoted to avoid brace expansion.

7 months agoparse: Set BFTW_WHITEOUTS when parsing -type w
Tavian Barnes [Tue, 17 Oct 2023 15:55:31 +0000 (11:55 -0400)]
parse: Set BFTW_WHITEOUTS when parsing -type w

7 months agobftw: New flag to control whiteout visibility
Tavian Barnes [Tue, 17 Oct 2023 15:55:19 +0000 (11:55 -0400)]
bftw: New flag to control whiteout visibility

7 months agodir: New flag to control whiteout visibility
Tavian Barnes [Tue, 17 Oct 2023 15:43:43 +0000 (11:43 -0400)]
dir: New flag to control whiteout visibility

7 months agodir: Fix FreeBSD union mounts
Tavian Barnes [Tue, 17 Oct 2023 15:35:41 +0000 (11:35 -0400)]
dir: Fix FreeBSD union mounts

7 months agodir: Add a flags parameter to bfs_opendir()
Tavian Barnes [Mon, 16 Oct 2023 20:44:46 +0000 (16:44 -0400)]
dir: Add a flags parameter to bfs_opendir()

7 months agotests: Move closed_std* tests out of the POSIX group
Tavian Barnes [Sat, 14 Oct 2023 12:55:57 +0000 (08:55 -0400)]
tests: Move closed_std* tests out of the POSIX group

POSIX actually says

> If the utility would be executed with file descriptor 0, 1, or 2
> closed, implementations may execute the utility with the file
> descriptor open to an unspecified file.

So we're not guaranteed to be able to detect the situation in the first
place.  Add a best-effort check for these platforms and skip the test.

Link: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01
7 months agodir: Fix Android build
Tavian Barnes [Sat, 14 Oct 2023 12:48:15 +0000 (08:48 -0400)]
dir: Fix Android build

Android doesn't provide a getdents() wrapper, so use the syscall.

7 months agodocs: Add a list of related utilities
Tavian Barnes [Fri, 13 Oct 2023 21:09:11 +0000 (17:09 -0400)]
docs: Add a list of related utilities

7 months agotests: Always create the scratch directory
Tavian Barnes [Fri, 13 Oct 2023 17:52:01 +0000 (13:52 -0400)]
tests: Always create the scratch directory

Otherwise, some tests that try to check for flag support like

    invoke_bfs scratch -quit -xattr || skip

can be accidentally skipped if ./scratch doesn't exist yet:

    $ ./tests/tests.sh bsd/xattr
    tests skipped: 1

After this patch, we get the expected

    $ ./tests/tests.sh bsd/xattr
    tests passed: 1

7 months agoMerge tag '3.0.4'
Tavian Barnes [Fri, 13 Oct 2023 03:52:49 +0000 (23:52 -0400)]
Merge tag '3.0.4'

7 months agoRelease 3.0.4
Tavian Barnes [Fri, 13 Oct 2023 03:50:16 +0000 (23:50 -0400)]
Release 3.0.4

7 months agotests: Don't crash if unbuffer isn't installed
Tavian Barnes [Fri, 13 Oct 2023 03:47:04 +0000 (23:47 -0400)]
tests: Don't crash if unbuffer isn't installed

7 months agobfstd: Actually use the copied locale
Tavian Barnes [Fri, 13 Oct 2023 03:45:40 +0000 (23:45 -0400)]
bfstd: Actually use the copied locale

This fixes a segfault in xstrerror() when using musl.

7 months agobuild: Re-enable liburing
Tavian Barnes [Fri, 13 Oct 2023 02:14:34 +0000 (22:14 -0400)]
build: Re-enable liburing

This reverts commit 735a2979a37251dc447274aa888ad77ded126457.

7 months agoRelease 3.0.3
Tavian Barnes [Fri, 13 Oct 2023 02:13:49 +0000 (22:13 -0400)]
Release 3.0.3

7 months agobuild: Disable liburing for now
Tavian Barnes [Fri, 13 Oct 2023 02:12:35 +0000 (22:12 -0400)]
build: Disable liburing for now

liburing will be enabled for the next feature release.

7 months agodocs: Start writing the 3.1 changelog
Tavian Barnes [Thu, 12 Oct 2023 22:28:34 +0000 (18:28 -0400)]
docs: Start writing the 3.1 changelog

7 months agobench: Look for ./bfs if ./bin/bfs doesn't exist
Tavian Barnes [Thu, 12 Oct 2023 22:27:31 +0000 (18:27 -0400)]
bench: Look for ./bfs if ./bin/bfs doesn't exist

7 months agobench: Check for bfs -j support before using it
Tavian Barnes [Thu, 12 Oct 2023 22:21:55 +0000 (18:21 -0400)]
bench: Check for bfs -j support before using it

7 months agobftw: Make sure we don't close a directory while we unwrap it
Tavian Barnes [Thu, 12 Oct 2023 19:50:59 +0000 (15:50 -0400)]
bftw: Make sure we don't close a directory while we unwrap it

bftw_cache_reserve() can lead to bftw_cache_pop(), which could close the
directory we're trying to unwrap!  If that happened, we would try
dup_cloexec(-1), which would fail with EBADF, so there was no observable
bug.  But it's better to avoid the whole situation.

7 months agobftw: Fix to_close list corruption with !BFS_USE_UNWRAPDIR
Tavian Barnes [Thu, 12 Oct 2023 19:13:02 +0000 (15:13 -0400)]
bftw: Fix to_close list corruption with !BFS_USE_UNWRAPDIR

It's possible for pincount to drop to zero, then get incremented and
drop back to zero again.  If this happens, we shouldn't add it to the
to_close list twice.

This should fix the intermittent hang on the macOS CI.

Fixes: 815798e1eea7fc8dacd5acab40202ec4d251d517
7 months agolist: Assert that we're not inserting already-attached nodes
Tavian Barnes [Thu, 12 Oct 2023 17:18:00 +0000 (13:18 -0400)]
list: Assert that we're not inserting already-attached nodes

7 months agodiag: Move enum debug_flags out of ctx.h
Tavian Barnes [Thu, 12 Oct 2023 17:09:11 +0000 (13:09 -0400)]
diag: Move enum debug_flags out of ctx.h

7 months agobftw: Don't force buffering for parallel dfs
Tavian Barnes [Thu, 12 Oct 2023 14:41:04 +0000 (10:41 -0400)]
bftw: Don't force buffering for parallel dfs

7 months agobftw: Fix unbuffered depth-first searches
Tavian Barnes [Thu, 12 Oct 2023 15:24:49 +0000 (11:24 -0400)]
bftw: Fix unbuffered depth-first searches

bftw() implements depth-first search by appending files to a batch, then
prepending the batch to the queue.  When we switched to separate file/
directory queues, this was only implemented for the file queue.
Unbuffered searches don't use the file queue, so they were all breadth-
first in practice.

This meant that iterative deepening (-S ids) was actually "iterative
deepening *breadth*-first search," a horrible strategy with no advantage
over regular breadth-first search.  Now it performs iterative deepening
*depth*-first search, which at least limits its memory consumption.

Fixes: c1b16b49988ecff17ae30978ea14798d95b80018
7 months agobftw: Let iterative deepening work depth-first when sorting
Tavian Barnes [Thu, 12 Oct 2023 13:44:27 +0000 (09:44 -0400)]
bftw: Let iterative deepening work depth-first when sorting

7 months agobench: Default to --strategies=rust
Tavian Barnes [Tue, 10 Oct 2023 15:51:34 +0000 (11:51 -0400)]
bench: Default to --strategies=rust

7 months agobench: New --jobs benchmark
Tavian Barnes [Tue, 10 Oct 2023 15:37:40 +0000 (11:37 -0400)]
bench: New --jobs benchmark

7 months agobench: Group by strategy in comparison mode
Tavian Barnes [Tue, 10 Oct 2023 15:34:26 +0000 (11:34 -0400)]
bench: Group by strategy in comparison mode

7 months agobench: Don't print paths in the --strategies benchmark
Tavian Barnes [Tue, 10 Oct 2023 15:21:38 +0000 (11:21 -0400)]
bench: Don't print paths in the --strategies benchmark

7 months agobench: Allow format specifiers in (sub)group headers
Tavian Barnes [Tue, 10 Oct 2023 15:14:18 +0000 (11:14 -0400)]
bench: Allow format specifiers in (sub)group headers

7 months agobar: Replace volatile sig_atomic_t with actual atomics
Tavian Barnes [Fri, 6 Oct 2023 23:08:33 +0000 (19:08 -0400)]
bar: Replace volatile sig_atomic_t with actual atomics

7 months agoalloc: Test allocation size overflows
Tavian Barnes [Fri, 6 Oct 2023 16:37:01 +0000 (12:37 -0400)]
alloc: Test allocation size overflows

7 months agotests/bfs/status: Try to test SIGWINCH
Tavian Barnes [Fri, 6 Oct 2023 16:00:02 +0000 (12:00 -0400)]
tests/bfs/status: Try to test SIGWINCH

7 months agotests: Check for expect_unbuffer too
Tavian Barnes [Fri, 6 Oct 2023 15:56:31 +0000 (11:56 -0400)]
tests: Check for expect_unbuffer too

That's where FreeBSD installs it.

7 months agotests: New bfs_pty wrapper for unbuffer
Tavian Barnes [Fri, 6 Oct 2023 15:42:06 +0000 (11:42 -0400)]
tests: New bfs_pty wrapper for unbuffer

7 months agoci: Install expect for unbuffer
Tavian Barnes [Thu, 5 Oct 2023 21:29:52 +0000 (17:29 -0400)]
ci: Install expect for unbuffer

7 months agotests/bfs: Add a test that runs -status
Tavian Barnes [Thu, 5 Oct 2023 21:18:40 +0000 (17:18 -0400)]
tests/bfs: Add a test that runs -status

7 months agotests/bfs: Add tests for color autodetection
Tavian Barnes [Thu, 5 Oct 2023 20:25:56 +0000 (16:25 -0400)]
tests/bfs: Add tests for color autodetection

7 months agotests: Respect $NO_COLOR
Tavian Barnes [Thu, 5 Oct 2023 20:25:21 +0000 (16:25 -0400)]
tests: Respect $NO_COLOR

7 months agoREADME: Realign badges
Tavian Barnes [Thu, 5 Oct 2023 18:44:55 +0000 (14:44 -0400)]
README: Realign badges

A recent GitHub change broke the nice alignment of the badges to the top
heading, so just put the badges underneath it for now.

7 months agobfstd: Add a thread-safe wrapper for strerror()
Tavian Barnes [Thu, 5 Oct 2023 16:56:36 +0000 (12:56 -0400)]
bfstd: Add a thread-safe wrapper for strerror()

7 months agothread: Define thread_local
Tavian Barnes [Thu, 5 Oct 2023 16:55:56 +0000 (12:55 -0400)]
thread: Define thread_local

7 months agoconfig: Fold !__FreeBSD__ into BFS_USE_SYS_CAPABILITY_H
Tavian Barnes [Thu, 5 Oct 2023 16:47:31 +0000 (12:47 -0400)]
config: Fold !__FreeBSD__ into BFS_USE_SYS_CAPABILITY_H

7 months agodstring: Limit the special dchar typedef to lint builds
Tavian Barnes [Tue, 3 Oct 2023 20:26:05 +0000 (16:26 -0400)]
dstring: Limit the special dchar typedef to lint builds

Clang still thinks that alignof(dstr[1]) == 2, so out of an abundance of
caution, don't mess with dchar alignment in normal builds.

7 months agobuild: New lint flag
Tavian Barnes [Tue, 3 Oct 2023 20:25:56 +0000 (16:25 -0400)]
build: New lint flag

7 months agothread: s/call_once/invoke_once/
Tavian Barnes [Tue, 3 Oct 2023 17:07:21 +0000 (13:07 -0400)]
thread: s/call_once/invoke_once/

call_once() is a reserved identifier from C11.

7 months agoci/freebsd: Use tailscale ssh
Tavian Barnes [Tue, 3 Oct 2023 14:17:12 +0000 (10:17 -0400)]
ci/freebsd: Use tailscale ssh

7 months agoci/macos: Don't install coreutils
Tavian Barnes [Tue, 3 Oct 2023 14:11:42 +0000 (10:11 -0400)]
ci/macos: Don't install coreutils

Since we build our own touch(1) implementation, we no longer need to
work around the macOS bug.

7 months agotests: Fix make_deep() on FreeBSD
Tavian Barnes [Mon, 2 Oct 2023 18:13:49 +0000 (14:13 -0400)]
tests: Fix make_deep() on FreeBSD

I keep forgetting that PATH_MAX is only 1024 there.

7 months agoMerge branch 'io-uring'
Tavian Barnes [Mon, 2 Oct 2023 17:09:41 +0000 (13:09 -0400)]
Merge branch 'io-uring'

7 months agoMerge branch 'benchmarks'
Tavian Barnes [Mon, 2 Oct 2023 17:09:36 +0000 (13:09 -0400)]
Merge branch 'benchmarks'

7 months agotests: Don't cd into paths longer than PATH_MAX
Tavian Barnes [Mon, 2 Oct 2023 16:57:26 +0000 (12:57 -0400)]
tests: Don't cd into paths longer than PATH_MAX

This fixes a warning on at least Alpine Linux that looks like

    cd: error retrieving current directory: getcwd: cannot access parent directories: Filename too long

7 months agoioq: Use io_uring
Tavian Barnes [Tue, 11 Jul 2023 18:04:40 +0000 (14:04 -0400)]
ioq: Use io_uring

Closes #65.

7 months agobuild: Add liburing on Linux
Tavian Barnes [Tue, 11 Jul 2023 18:30:52 +0000 (14:30 -0400)]
build: Add liburing on Linux

7 months agobench: Add a README
Tavian Barnes [Mon, 2 Oct 2023 14:49:41 +0000 (10:49 -0400)]
bench: Add a README

7 months agobench: Add benchmarking script
Tavian Barnes [Fri, 29 Sep 2023 18:13:06 +0000 (14:13 -0400)]
bench: Add benchmarking script

7 months agobench: New script to clone a git repo without file contents
Tavian Barnes [Thu, 28 Sep 2023 21:39:34 +0000 (17:39 -0400)]
bench: New script to clone a git repo without file contents

7 months agotests/xtouch: Try creating the immediate parent first
Tavian Barnes [Fri, 29 Sep 2023 19:13:41 +0000 (15:13 -0400)]
tests/xtouch: Try creating the immediate parent first

7 months agoFormatting fixes
Tavian Barnes [Wed, 27 Sep 2023 16:11:15 +0000 (12:11 -0400)]
Formatting fixes

7 months agobit: Fix UINTPTR_WIDTH typo
Tavian Barnes [Tue, 26 Sep 2023 19:42:35 +0000 (15:42 -0400)]
bit: Fix UINTPTR_WIDTH typo

7 months agobit: Use predefined __*_WIDTH__ macros if we can
Tavian Barnes [Tue, 26 Sep 2023 19:05:43 +0000 (15:05 -0400)]
bit: Use predefined __*_WIDTH__ macros if we can

7 months agodstring: New dchar typedef for dynamic strings
Tavian Barnes [Tue, 26 Sep 2023 16:48:21 +0000 (12:48 -0400)]
dstring: New dchar typedef for dynamic strings

7 months agoci/freebsd: Switch to Tailscale OAuth
Tavian Barnes [Mon, 25 Sep 2023 19:26:52 +0000 (15:26 -0400)]
ci/freebsd: Switch to Tailscale OAuth

7 months agoUse the new list macros
Tavian Barnes [Mon, 25 Sep 2023 17:58:19 +0000 (13:58 -0400)]
Use the new list macros

7 months agolist: New for_[s]list() macros
Tavian Barnes [Mon, 25 Sep 2023 17:53:15 +0000 (13:53 -0400)]
list: New for_[s]list() macros