Add FreeBSD CI to replace Cirrus - #1663
Open
neilpang wants to merge 2 commits into
Open
Conversation
Cirrus CI shut down on 2026-06-01, which removed the FreeBSD unit test coverage. Run the same test command in a FreeBSD VM booted under QEMU/KVM on a regular ubuntu-latest runner, keeping the skips .cirrus.yml carried. The suite runs as an unprivileged user: src/su/context.rs notes that invalid_shell is allowed to fail under root, and the VM logs in as root.
get_process_start_time compared a ProcessCreateTime against a value built by destructuring SystemTime, which bypasses the newtype that keeps the two clock bases apart. That is a no-op on Linux and fails deterministically on FreeBSD, where kinfo_proc.ki_start is absolute wall clock while CLOCK_BOOTTIME is an alias for the uptime clock. Restore the cfg-aware ProcessCreateTime::now() helper removed in 62d1d30 and document why it cannot be folded into SystemTime::now(), which must keep reading the monotonic clock (see trifectatechfoundation#1022).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1543
Cirrus CI shut down on 2026-06-01, which removed the FreeBSD unit test
coverage. This runs the same test command in a FreeBSD VM booted under
QEMU/KVM on a regular
ubuntu-latestrunner, keeping the skips.cirrus.ymlcarried. The suite runs as an unprivileged user, sincesrc/su/context.rsnotesinvalid_shellis allowed to fail under rootwhile the VM logs in as root.
Second commit: a test-only fix the job is blocked on
Enabling the job surfaced one failing test,
system::time::tests::get_process_start_time. It is a test-only regression,not a defect in
Process::starting_time:kinfo_proc.ki_startis absolute wall clock -- the kernel addsboottimeinfill_kinfo_proc_only()before exporting it.SystemTime::now()readsCLOCK_BOOTTIME, which on FreeBSD is an aliasfor the uptime clock (clock_gettime(2): "unrelated to the
kern.boottimesysctl").
So the test compared an epoch-scale value against the VM's uptime and failed
deterministically on every FreeBSD run; the first assertion passed only
because its right-hand side was negative.
064de34 had handled exactly this with a
#[cfg(test)]ProcessCreateTime::now()that selectsCLOCK_REALTIMEon FreeBSD. The DRYcleanup in 62d1d30 removed it and rebuilt the comparand by destructuring
SystemTime's fields intoProcessCreateTime, bypassing the newtypeseparation 064de34 introduced -- a no-op on Linux, a guaranteed failure on
FreeBSD.
This restores that helper and documents why it cannot be folded into
SystemTime::now(), which must keep reading the monotonic clock per #1022.Production code is untouched.
Verification
Before the test fix:
https://github.com/neilpang/sudo-rs/actions/runs/30707863594
After:
https://github.com/neilpang/sudo-rs/actions/runs/30730157525