make diod work on alpine linux/musl libc#161
Merged
mergify[bot] merged 8 commits intochaos:masterfrom Nov 7, 2025
Merged
Conversation
Problem: on alpine linux, diodcli won't compile because basename(3) is undefined. Add missing include directive.
Problem: diod refuses to accept AF_UNIX connections on alpine linux. The musl libc getnameinfo(3) fails with EAI_FAMILY when presented with an AF_UNIX socket, unlike glibc which looks up the name as "localhost" (NI_NUMERICHOST) or the local hostname. Just set the client ID to one of the above when accepting an AF_UNIX socket.
Problem: when test clients need to run as root, they use $SUDO -E to ensure DIOD_ environment variables pass through, which is not only tedious but makes it hard to redefine SUDO to an alternative like doas(8). Redefine $SUDO to "sudo -E". Updates tests to drop explicit -E flag.
Problem: on some systems like alpine linux and the BSDs, doas(8) is preferred over sudo(8). As long as doas(8) is configured for "keepenv" and "nopass", allow it to be used.
Problem: on alpine linux, test_flock_single won't compile because open(2) is undefined. Add missing include directives.
Problem: the test suite uses umount --lazy, which fails on alpine linux. Use umount -l instead.
Problem: stat -f on alpine/busybox cannot decode the 9p file system type and reports UNKNOWN causing a test to fail there. Use %t instead of %T to check the undecoded value instead.
Problem: a test that calls "mkdir -m 755 dir" as root on an
allsquash mount fails on alpine linux.
stracing "mkdir -m 755" shows that alpine calls
mkdirat(AT_FDCWD, "/tmp/yyy", 0777) = 0
fchmodat(AT_FDCWD, "/tmp/yyy", 0755) = 0
while glibc calls:
mkdir("/tmp/zzz", 0755) = 0
Presumably the fchmodat is failing because, because root no longer
owns the file after the mkdirat due to the squashing.
In that test, perform the chmod separately as the squash user.
Member
Author
|
Thanks! |
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.
This addresses a number of portability issues for diod on alpine linux.
make checkruns clean on alpine 3.22.2 (aarch64) after these changes.Fixes #160