Eric Wong [Wed, 4 Oct 2023 03:49:20 +0000 (03:49 +0000)]
lei: get rid of l2m_progress PktOp callback
We already have an ->incr callback we can enhance to support
multiple counters with a single request. Furthermore, we can
just flatten the object graph by storing counters directly in
the $lei object itself to reduce hash lookups.
Eric Wong [Wed, 4 Oct 2023 03:49:16 +0000 (03:49 +0000)]
move all non-test @post_loop_do into named subs
Compared to Danga::Socket, our @post_loop_do API is designed to
make it easier to avoid anonymous subs (and their potential for
leaks in buggy old versions of Perl).
Eric Wong [Tue, 3 Oct 2023 16:18:17 +0000 (16:18 +0000)]
t/lei-q-save: quiet `no email in From: ...' warnings
PublicInbox::Import will warn if it can't extract a valid
address from an email. We need to ensure our tests capture
them to $lei_err instead of spewing them to the terminal.
While we're at it, use autodie and xsys_e to simplify some.
Eric Wong [Tue, 3 Oct 2023 09:26:01 +0000 (09:26 +0000)]
daemon: enable SO_ACCEPTFILTER on NetBSD
NetBSD 5.0+ has accept filter support from FreeBSD; and I
I think we can assume all NetBSD is 5.0+ (released in 2009)
nowadays if we're already depending on Perl 5.12 from 2010.
Eric Wong [Tue, 3 Oct 2023 06:43:49 +0000 (06:43 +0000)]
lei: workers exit after they tell lei-daemon
We don't want workers continuing after their stdout has triggered
EPIPE or some other write error.
This fixes xt/lei-onion-convert.t to ensure the quit_waiter_pipe
is fully-closed at daemon teardown during tests. Using the
`exit' perlop still ensures OnDestroy callbacks will fire.
Eric Wong [Tue, 3 Oct 2023 06:43:48 +0000 (06:43 +0000)]
net_reader: support imap.sslVerify + nntp.sslVerify
These options are useful for testing as well as users stuck on
out-of-date systems, dealing with forgetful sysadmins, broken
cronjobs, and/or are willing to risk MITM attacks.
Eric Wong [Tue, 3 Oct 2023 06:43:47 +0000 (06:43 +0000)]
config: fix key-only truthy values with urlmatch
When using --get-urlmatch, we need a way to distinguish between
between key-only or a `key=val' pair even if the `val' is empty.
In other words, git interprets `-c imap.debug' as true and
`-c imap.debug=' as false, but an untyped --get-urlmatch
invocation has no way to distinguish between them.
So we must specify we want `--bool' (we're avoiding `--type=bool'
since that only appears in git 2.18+)
IO::Socket::SSL had an unitialized variable warning from a bad
regexp for a few releases. This will also prepare us to support
imap.sslverify as git does and possibly other TLS-related
options.
Eric Wong [Tue, 3 Oct 2023 06:43:45 +0000 (06:43 +0000)]
net_reader: bail out on NNTP SOCKS connection failure
It takes some effort to get Net::NNTP and IO::Socket::Socks
to place nice together, but we don't want the setsockopt
call to fail on an undefined value. So die with an error
that tries to show various possible error sources.
$SOCKS_ERROR is a special variable, so even using `//'
(defined-or) operator isn't enough to squelch warnings
about using it in its uninitialized state.
Eric Wong [Mon, 2 Oct 2023 15:00:23 +0000 (15:00 +0000)]
lei: do label/keyword parsing in optparse
Calling vmd_mod_extract after optparse causes the implicit
stdin-as-input functionality to fail, as the implicit stdin
requires a lack of inputs remaining in argv after option
parsing (along with a regular file or pipe as stdin).
This allows commands such as `lei import -F eml +kw:seen'
to work without `--stdin', `-' or any path names when
importing a single message. This also ensures commands like
`lei import +kw:seen' without any inputs/locations will fail
reliably, as the extra +kw: arg won't be a false-positive.
Eric Wong [Mon, 2 Oct 2023 14:58:07 +0000 (14:58 +0000)]
lei up: faster non-thread, single-source incremental query
When using isearch (that is v1/v2 inbox relying on extindex
for search), there's actually no guarantee that IMAP UIDs
are in the correct order with regard to Xapian docids.
Thus we must iterate through every UID(num) to see if it's
suitable to display in a saved search. The old grep filter
(before commit a6fe84489127) was not effective since it
didn't account for the mset->items correspondence.
Fortunately, this bug merely manifests in reduced performance
as of a6fe84489127. Prior to that, it could cause incorrect
keywords and labels to be applied.
Unfortunately, this behavior is hard-to-test so no test case
is included.
Eric Wong [Sun, 1 Oct 2023 09:54:29 +0000 (09:54 +0000)]
lei: deal with clients with blocked stderr
lei/store can get stuck if lei-daemon is blocked, and lei-daemon
can get stuck when a clients stderr is redirected to a pager
that isn't consumed.
So start relying on Time::HiRes::alarm to generate SIGALRM to
break out of the `print' perlop. Unfortunately, this isn't easy
since Perl auto-restarts all writes, so we dup(2) the
destination FD and close the copy in the SIGALRM handler to
force `print' to return.
Most programs (MUAs, editors, etc.) aren't equipped to deal with
non-blocking STDERR, so we can't make the stderr file description
non-blocking.
Another way to solve this problem would be to have script/lei
send a non-blocking pipe to lei-daemon in the {2} slot and
make script/lei splice messages from the pipe to stderr.
Unfortunately, that requires more work and forces more
complexity into script/lei and slow down normal cases where
stderr doesn't get blocked.
Eric Wong [Sun, 1 Oct 2023 09:54:27 +0000 (09:54 +0000)]
treewide: enable warnings in all exec-ed processes
While forked processes inherit from the parent, exec-ed
processes need the `-w' flag passed to them. To determine
whether or not we should pass them, we must check the `$^W'
global perlvar, first.
We'll also favor `perl -e' over `perl -E' in places where
we don't rely on the latest features, since `-E' incurs
slightly more startup time overhead from loading feature.pm
(while `perl -Mv5.12' does not).
Eric Wong [Sun, 1 Oct 2023 09:54:26 +0000 (09:54 +0000)]
overidx: fix version comparison
We can't use $DBD::SQLite::sqlite_version_number with older versions of
DBD::SQLite. Thus we need to treat the $DBD::SQLite::sqlite_version
string (e.g. "3.8.3", not v-string) and convert it to a v-string with
eval for version comparisons to determine if we can fork multiple
children when using SQLite.
Fixes: fa04201baae9 ("lei: force --jobs=1,1 for SQLite < 3.8.3")
Eric Wong [Sun, 1 Oct 2023 09:54:25 +0000 (09:54 +0000)]
lei_store: unlink stderr buffer early
While we're at it, ensure we clear the Perl internal EOF
marker before attempting to read the appended-to file
handle since newer Perl may leave the internal EOF marker set.
Eric Wong [Sun, 1 Oct 2023 09:54:24 +0000 (09:54 +0000)]
lei mail-diff: don't remove temporary subdirectory
->{curdir} is localized inside MailDiff->dump_eml anyways, so it
was attempting to remove `undef' :x. Since most messages don't
have too many attachments, save some opcodes on our end and just
let File::Temp::Dir->DESTROY handle all the cleanup.
Eric Wong [Sun, 1 Oct 2023 09:54:23 +0000 (09:54 +0000)]
lei: correct exit signal
The first argument passed to Perl signal handlers is a
signal name (e.g. "TERM") and not an integer that can
be passed to the `exit' perlop. Thus we must look up the
integer value from the POSIX module.
Eric Wong [Sun, 1 Oct 2023 09:54:22 +0000 (09:54 +0000)]
lei rediff: `git diff -O<order-file>' support
We can't use the `-O' switch since it conflicts with
--only|-O= to specify externals. Thus we'll introduce
a more verbose `--order-file=FILE' option when running
`git diff'.
Eric Wong [Sun, 1 Oct 2023 09:54:21 +0000 (09:54 +0000)]
git: packed_bytes: deal with glob+stat TOCTTOU
There's not much we can do about this aside from just ignoring
errors and considering un-stat-able files as zero-sized.
There's no syscalls which expose FUSE3 `readdirplus' type
functionality to userspace to avoid this problem.
Eric Wong [Sun, 1 Oct 2023 09:54:20 +0000 (09:54 +0000)]
git: improve error reporting
We can use autodie for socketpair to handle errors for us,
but we need Time::HiRes::stat so we must write the error message
ourselves if stat-ing the git executable fails.
Eric Wong [Sun, 1 Oct 2023 09:54:19 +0000 (09:54 +0000)]
process_pipe: don't run `close' unless requested
If a user is relying on reference counts to invalidate FDs
(as we do in many places), rely on them instead of explicit
`close'. This forces us to do a better job of managing refs
and avoiding redundant fields which make our code more fragile.
Eric Wong [Sun, 1 Oct 2023 09:54:17 +0000 (09:54 +0000)]
gcf2: take non-ref scalar request arg
Asking callers to pass a scalar reference is awkward and
doesn't benefit modern Perl with CoW support. Unlike
some constant error messages, it can't save any allocations
at all since there's no constant strings being passed to
libgit2.
Eric Wong [Sat, 30 Sep 2023 15:20:40 +0000 (15:20 +0000)]
git+gcf2client: switch to level-triggered wakeups
Instead of using ->requeue to emulate level-triggered wakeups in
userspace, just use level-triggered wakeups in the kernel to
save some user time at the expense of system (kernel) time. Of
course, the ready list implementation in the kernel via C is
faster than a Perl one on our end.
We must still use requeue if we've got buffered data, however.
Followup-to: 1181a7e6a853 (listener: switch to level-triggered epoll)
Eric Wong [Sat, 30 Sep 2023 15:20:39 +0000 (15:20 +0000)]
git: use Unix stream sockets for `cat-file --batch-*'
The benefit of 1MB potential pipe buffer size (on Linux) doesn't
seem noticeable when reading from git (unlike when writing to v2
shards), so Unix stream sockets seem fine, here.
This allows us to simplify our process management by using the
same socket FD for reads and writes and enables us to use our
ProcessPipe class for reaping (as we can do with Gcf2Client).
Gcf2Client no longer relies on PublicInbox::DS for write
buffering, and instead just waits for requests to complete
once the number of inflight requests hits the MAX_INFLIGHT
threshold as we do with PublicInbox::Git.
We reuse the existing MAX_INFLIGHT limit (18) that was
determined by the minimum allowed PIPE_BUF (512). (AFAIK) Unix
stream sockets have no analogy to PIPE_BUF, but all *BSDs and
Linux I've checked have default SO_RCVBUF and SO_SNDBUF values
larger than the previously-required PIPE_BUF size of 512 bytes.
Eric Wong [Sat, 30 Sep 2023 15:20:38 +0000 (15:20 +0000)]
git: decouple cat_async_retry from POSIX pipe semantics
While pipes guarantee writes of <= 512 bytes to be atomic,
Unix stream sockets (or TCP sockets) have no such guarantees.
Removing the pipe assumption will make it possible for us to
switch to bidirectional Unix stream sockets and save FDs with
`git cat-file' processes as we have with Gcf2Client. The
performance benefit of larger pipe buffers over stream sockets
isn't irrelevant when interacting with git as it is with
SearchIdx shards.
Eric Wong [Sat, 30 Sep 2023 00:36:16 +0000 (00:36 +0000)]
lei convert: support reading from v1, v2, and extindex
We should be able to dump all public-inbox and extindex directories
to Maildir/mbox* or IMAP folders. Even unindexed inboxes can be
dumped as long as inbox.lock (or ssoma.lock) exists.
This change likely works for `lei tag' and other lei_input-using
things, as well, but that's untested at the moment. I mainly
want to be able to use `lei convert' to benchmark some upcoming
changes...
Eric Wong [Sat, 30 Sep 2023 00:36:15 +0000 (00:36 +0000)]
lei_input: always prefix `maildir:' internally
This allows us to reduce stats for `new' and `cur' subdirs
of the Maildir and will also make it easier for us to support
MH, v2, v1, and extindex directories as inputs.
Eric Wong [Fri, 29 Sep 2023 10:41:05 +0000 (10:41 +0000)]
git: fix unused code path for cat-file stderr reset
We haven't used _bidi_pipe idempotently in a while, so
the stderr was never getting reset on reads.
This isn't fully useful when using async eeeae20893a25956
(imap: use git-cat-file asynchronously, 2020-06-10)
So instead of truncating it on reads, we'll truncate
immediately after reading and rely on O_APPEND to keep
new writes at the end.
Fortunately, this stderrr error checking isn't used
outside of solver (which is synchronous).
Eric Wong [Fri, 29 Sep 2023 02:44:06 +0000 (02:44 +0000)]
git: calculate MAX_INFLIGHT properly in Perl
Unlike C, Perl automatically converts quotients to double-precision
floating point even with UV/IV numerators and denominators. So
force the intermediate quotient to be an integer before
multiplying it by the size of each inflight array element.
This bug was inconsequential for all platforms since d4ba8828ab23f278
(git: fix asynchronous batching for deep pipelines, 2023-01-04)
and inconsequential on most (or all?) Linux even before that due
to the larger 4096-byte PIPE_BUF on Linux.
Eric Wong [Wed, 27 Sep 2023 06:02:49 +0000 (06:02 +0000)]
lei: don't gzip --rsyncable by default for mbox*
Using and memoizing the usability of `--rsyncable' is unsafe
since pigz (or GNU gzip) can be uninstalled and leave a user
with a non-rsync-aware gzip implementation in the long-running
daemon. So we stop passing --rsyncable by default to pigz/gzip
and no longer attempt to check for it (since it was a TOCTTOU
error, anyways).
Specifying --rsyncable explicitly didn't work, either, and
ended up passing `1' to the gzip/pigz argv :x
Finally, we now test --rsyncable on the CLI by adding support
for it in `lei convert' and testing it in t/lei-convert.t
Eric Wong [Wed, 27 Sep 2023 06:02:48 +0000 (06:02 +0000)]
spawn: add popen_wr support
This makes interesting parts of our code easier to read IMHO.
We can take advantage of `local' while avoiding `fileno' calls
since it's called in spawn() anyways to reduce LoC even further.
Eric Wong [Tue, 26 Sep 2023 07:44:39 +0000 (07:44 +0000)]
spamcheck/spamc: rely on ProcessPipe instead of waitpid
We lose error information on CORE::close call, but the
underlying close(2) syscall won't EIO nor ENOSPC on a read-only
side of a pipe. Perl is already shielding us from EINTR and
EBADF would be a bug in Perl itself.
Eric Wong [Tue, 26 Sep 2023 07:44:38 +0000 (07:44 +0000)]
fetch: fix missing chdir arg for error reporting
We need to run `git config -l' in the epoch directory which
failed to get the proper config listing. This went unnoticed
because it doesn't affect any known users and was only found
during code inspection for waitpid usage cleanups.
Eric Wong [Tue, 26 Sep 2023 07:44:36 +0000 (07:44 +0000)]
auto_reap: waitpid never returns undef
Reading the Perl source, it seems impossible to for waitpid
to return undef. perlipc(1) man page also documents waitpid
(and `wait') as functions which always restart on EINTR.
Eric Wong [Mon, 25 Sep 2023 23:29:56 +0000 (23:29 +0000)]
xt/mem-nntpd-tls: drop :epoll import tag use
The export tag for :epoll no longer exists and it seems like
it hasn't been needed in a while, anyways. We can also drop a
useless EPOLLIN import, as well.
Fixes: 3005c1bc5d05 (ds: use object-oriented API for epoll)
Eric Wong [Mon, 25 Sep 2023 10:17:14 +0000 (10:17 +0000)]
tests: add quit_waiter_pipe and wait_for_eof
These generalize the idiom from t/httpd-unix.t and allows them
to be used for all the lei daemon shutdown in tests. This
speeds up the serialized run of `prove -lvw t/lei.t t/lei-daemon.t'
by roughly 8-9% or so since we're no longer sleeping and killing
the daemon in a loop.
Parallelized `make check' and `make check-run' don't show much
difference, yet.
Note that we do eliminate some kill(2) checks since those still
require retries an delays. We assume the kernel auto-closing
FDs on process exit is a strong-enough guarantee that the
process will soon be reaped by PID:1.
These will be useful for the FUSE daemons, as well.
We'll also start introducing more uses of autodie to simplify
our code.
Eric Wong [Mon, 25 Sep 2023 10:17:13 +0000 (10:17 +0000)]
ds: force event_loop wakeup on final child death
Reaping children needs to keep the event_loop spinning another
round when the @post_loop_do callback may be used to check
on process exit during shutdown.
This allows us to get rid of the hacky SetLoopTimeout calls in
lei-daemon and XapHelper.pm during process shutdown if we're
trying to wait for all PIDs to exit before leaving the event
loop.
Eric Wong [Sun, 24 Sep 2023 21:08:22 +0000 (21:08 +0000)]
xap_helper.h: add missing headers and avoid reallocarray
These changes are necessary with glibc 2.17 and g++ 4.8.5
on CentOS 7.x. We don't have to worry about overflow with
realloc(3) here since WORKER_MAX is only USHRT_MAX and
sizeof(pid_t) is 4 bytes on every platform I've encountered.
Eric Wong [Sun, 24 Sep 2023 20:19:22 +0000 (20:19 +0000)]
syscall: fix valgrind error in pure Perl send_cmd4
We need to allocate CMSG_SPACE for the `struct cmsghdr', not the
smaller CMSG_LEN. AFAIK this isn't a real world problem since
the Linux kernel doesn't care about the uninitialized space as
long as memory region belongs to the user, but valgrind complains.
Eric Wong [Sun, 24 Sep 2023 20:19:21 +0000 (20:19 +0000)]
syscall: have `vec' operate on bytes directly
Instead of converting to bytes to bits and asking `vec' to
operate on single bits, we can just have `vec' work on 8 bits
at-a-time.
This also fixes an overallocation in pure Perl Linux recv_cmd4.
Adding an extra byte ourselves for "\0" isn't necessary: Perl
already does it internally everywhere when creating/resizing
scalars.
Eric Wong [Sun, 24 Sep 2023 20:19:19 +0000 (20:19 +0000)]
lei_self_socket: drop unused deps and code
We don't need to repeat the assignment done in DS::new,
nor do we need to disable the `once' warnings after
commit cfd20b04dfe4 (ipc: retry sendmsg + recvmsg calls on EINTR)
removed the need for that pragma.
Eric Wong [Sun, 24 Sep 2023 05:42:14 +0000 (05:42 +0000)]
config: drop scalar ref support from internal API
It's a needless branch to maintain exclusively for our tests.
The `git config -l' output isn't pleasant to write in tests,
anyways. So just use heredocs to write git configs in their
native format rather than emulate the output of `git config -l'.
This does make the test suite do more work with temporary files
and process invocations, but it doesn't seem very measurable
when testing on tmpfs (TMPDIR=/dev/shm).
We'll make a minor improvement to TestCommon::tmpdir by allowing
it to return a single value (which I suspect we can rely on in
more places since File::Temp::Dir overloads stringification).
Eric Wong [Sun, 24 Sep 2023 05:42:13 +0000 (05:42 +0000)]
lei: fix `-c NAME=VALUE' config support
We can pass `-c NAME=VALUE' args directly to git-config without
needing a temporary directory nor file. Furthermore, this opens
the door to us being able to correctly handle `-c NAME=VALUE'
after `delete $lei->{cfg}' if we need to reload the config
during a command.
This tightens up error-checking for `lei config' and ensures we
can make config settings changes while using `-c NAME=VALUE'
instead of editing the temporary file.
The non-obvious part was avoiding the use of the -f/--file arg for
`git config' for read-only operations and include relying on
`-c include.path=$ABS_PATH'. This is done by parsing the
switches to be passed to `git config' to determine if it's a
read-only operation or not.
Eric Wong [Sun, 24 Sep 2023 05:42:12 +0000 (05:42 +0000)]
lei config: send `git config' errors to pager
Our previous use of lei->cfg_dump was wrong as the extra arg was
never supported. Instead, we need to capture the output of
`git config' and send it to the pager if ->cfg_dump fails. We'll
also add a note to the user to quit the pager to continue.
Eric Wong [Sun, 24 Sep 2023 05:42:11 +0000 (05:42 +0000)]
config: handle key-only entries as booleans
It's how git-config works, so our `git config --list' parser
must be able to handle it. Fortunately this doesn't seem to
incur a measurable overhead when parsing a config with 50k
inboxes.
Eric Wong [Fri, 22 Sep 2023 21:13:16 +0000 (21:13 +0000)]
lei: use File::Temp for listing saved searches
I have no idea how badly my brain malfunctioned here when I
wrote the code to create a temporary file without O_EXCL :x
I'm still not sure if users have enough saved searches for
justifying a cache, here.
Eric Wong [Fri, 22 Sep 2023 21:13:15 +0000 (21:13 +0000)]
lei_to_mail: drop awkward duplication of $lei object
Our awaitpid API now exists and ProcessPipe uses it, so it's
immune to cyclic references. Thus there's no need to create
a duplicate of the lei object to prevent leaks.
Eric Wong [Fri, 22 Sep 2023 21:13:14 +0000 (21:13 +0000)]
lei: improve ->fail internal API
Allow the exit code to be the first argument intead of the last
to match our ->child_error, as well as the BSD err(3) API.
We'll also avoid shifting user-passed exit codes so $? can be
passed as-is without losing signal information.
Eric Wong [Fri, 22 Sep 2023 18:37:16 +0000 (18:37 +0000)]
t/lei-mirror: avoid make(1) jobserver warning
We can't control `make test' nor user-defined targets in
config.mak. There's no need for a jobserver to run `make help',
anyways, so just let things be.
This also fixes the use of `gmake check' et al. on *BSDs where
various make flags confuse BSD make(1)
While we're at it, allow the test to run in the odd case make(1)
isn't available at all...
Eric Wong [Fri, 22 Sep 2023 02:18:17 +0000 (02:18 +0000)]
pop3: support initial_limit parameter in mailbox name
`initial_limit' only affects the fetch for new users while
`limit' affects all users. `initial_limit' is intended to be
better than the existing, absolute `limit' for 24/7 servers
(e.g. scheduled POP3 imports via webmail). The existing `limit'
parameter remains and is best suited for systems with sporadic
Internet access.
This also fixes an offset calculation bug with limit when used
on the newest (non-full) slice. The number of messages in the
newest slice is now taken into account.
Eric Wong [Mon, 18 Sep 2023 10:15:16 +0000 (10:15 +0000)]
makefile: avoid non-POSIX which(1)
which(1) isn't in POSIX so it's perhaps less likely to be
available (although I don't think I've noticed a system
without it in decades). So replace it with the POSIX
`command -v', even though everyone seems to use which...
Add a note about `lexgrog', too, since I'm not sure if it's
packaged for various *BSDs.
Eric Wong [Mon, 18 Sep 2023 10:15:15 +0000 (10:15 +0000)]
install/deps: more fixes
We need to mark *-dev packages as optional, and ignore
dependency-only packages in the `optional' field.
Furthermore, make the output less confusing when there's neither
packages to install nor remove; and avoid invoking `apt-get install'
with an empty package list.
This also fixes an OpenBSD-specific regression from commit 82990fb72dac
which made package removal a no-op.
Fixes: 82990fb72dac (install/deps: flesh out libgit2, SQLite, and Xapian packages)
Eric Wong [Mon, 18 Sep 2023 10:15:13 +0000 (10:15 +0000)]
makefile: avoid needless use of double-colon rules
This non-portable construct isn't needed for our own rules.
I'm understanding them correctly, they have different
semantics between *BSDs and GNU make.
Eric Wong [Mon, 18 Sep 2023 10:15:10 +0000 (10:15 +0000)]
drop GNU nproc(1) support in favor of getconf(1)
`getconf NPROCESSORS_ONLN' will succeed on GNU/Linux systems
anyways; and the non-underscore-prefixed invocation works fine
on all BSD flavors tested.
Thus the `nproc' and `gnproc' attempts will never be reached.
The only downside is we lose the ability to account for CPU
affinity, but that's probably not an issue since CPU affinity
(AFAIK) isn't a commonly-used feature.
Eric Wong [Sat, 16 Sep 2023 21:33:14 +0000 (21:33 +0000)]
devel/sysdefs-list: cleanup and make partially eval-able
It's stdout can now be placed into a Perl hash, now.
The MAYBE pseudo-macro can now emit hex as well as decimal
output to make some constants look nicer and eliminate some
special cases.
Constants for _SC_AVPHYS_PAGES and _SC_PAGE*SIZE have also been
added in case we dynamically generate BATCH_SIZE for search
indexing
I'm not sure how far I want to go down this route, but it could
open the door to us supporting more things on platforms with
unstable syscall numbers with only a C compiler, but without
relying on needing Inline::C (nor XS and difficult-to-audit
binaries). This is because a C compiler is readily installed on
more systems than Inline::C (even if packaged) requires an
additional installation step.
Eric Wong [Sat, 16 Sep 2023 13:10:52 +0000 (13:10 +0000)]
xap_helper: test cleanup + throw support in C++
We need to ensure whatever C++ compiler gets used supports this
GNU extension as we expect it to. clang 13 and 14 and g++ 10
all work as we expect it to.
Eric Wong [Sat, 16 Sep 2023 12:09:24 +0000 (12:09 +0000)]
install/deps: flesh out libgit2, SQLite, and Xapian packages
This seems to work reasonably well across multiple BSDs and
Debian and smooth out differences in packaging granularity.
Declaring the $always_deps relationship between `Xapian'(.pm) and
libxapian means we can get rid of the OpenBSD-specific hack to
remove `xapian-bindings-perl' before other packages.
Eric Wong [Sat, 16 Sep 2023 03:21:21 +0000 (03:21 +0000)]
Makefile: add `check-debris' target
This non-parallelized target is useful for noticing core dumps
and preventing them from being clobbered as we run the test
suite. It will also notice leftover temporary files and
directories.
This make target was used on OpenBSD 7.3 to develop at least two
recent fixes:
e281363ba937 (lei: ensure we run DESTROY|END at daemon exit w/ kqueue) 759885e60e59 (lei: ensure --stdin sets %ENV and $current_lei)
I considered using a per-test TMPDIR for this to enable
parallelization, but on-filesystem UNIX sockets won't work
with excessively long path names.
Eric Wong [Tue, 12 Sep 2023 22:40:34 +0000 (22:40 +0000)]
pop3: support `?limit=$NUM' parameter in mailbox name
I'm not sure if `?' or `=' are allowed characters in POP3
mailbox names. In fact, I can't find any information on
valid characters allowed in RFC 1081 nor RFC 1939.
In any case, it works fine with mpop, Claws-Mail, and
Thunderbird.
Tested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Eric Wong [Fri, 15 Sep 2023 10:11:57 +0000 (10:11 +0000)]
lei: ensure we run DESTROY|END at daemon exit w/ kqueue
The fundamental difference which I originally missed when
implementing kqueue EVFILT_SIGNAL support is that it does not
consume signals like signalfd(2) does. In other words, with
EVFILT_SIGNAL, it's possible for a single signal to be delivered
twice if we unblock signals upon leaving the event loop as we do
in lei.
Note: Our DS->event_loop and Sigfd APIs can/should probably be
changed to better accomodate EVFILT_SIGNAL differences from
signalfd without sacrificing usability of either.
This fixes the problem of leftover lei-ovv.dst*, lei_cfg-* and
skv.* files in $TMPDIR at the end of test suite runs on *BSD
when IO::KQueue is installed.