avahi icon indicating copy to clipboard operation
avahi copied to clipboard

avahi and FreeBSD

Open evverx opened this issue 2 months ago • 6 comments

Currently it isn't tested on FreeBSD at all, there are patches in https://github.com/freebsd/freebsd-ports/tree/main/net/avahi-app that should be integrated upstream and so on.

The first step would be to setup the CI but the latest attempt to run the CI introduced in https://github.com/avahi/avahi/pull/676 wasn't particularly successfull:

libtool: link: clang -I.. "-DDEBUG_TRAP=__asm__(\"int \$3\")" -DAVAHI_DAEMON_RUNTIME_DIR=\"/run/avahi-daemon/\" -DAVAHI_SOCKET=\"/run/avahi-daemon/socket\" -DAVAHI_SERVICE_DIR=\"/etc/avahi/services\" -DAVAHI_CONFIG_FILE=\"/etc/avahi/avahi-daemon.conf\" -DAVAHI_HOSTS_FILE=\"/etc/avahi/hosts\" -DAVAHI_DBUS_INTROSPECTION_DIR=\"/usr/local/share/dbus-1/interfaces\" -DAVAHI_CONFIG_DIR=\"/etc/avahi\" -D_REENTRANT -I/usr/local/include -DUSE_EXPAT_H -I/usr/local/libdata/pkgconfig/../../include/dbus-1.0 -I/usr/local/libdata/pkgconfig/../../lib/dbus-1.0/include -DDBUS_VERSION_MAJOR=1 -DDBUS_VERSION_MINOR=16 -DDBUS_VERSION_MICRO=2 -DDBUS_API_SUBJECT_TO_CHANGE -DDBUS_SYSTEM_BUS_DEFAULT_ADDRESS=\"unix:path=/var/run/dbus/system_bus_socket\" -I/usr/local/include -g -O0 -fstack-protector -std=c99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels
ld: error: undefined symbol: inotify_init
>>> referenced by main.c:1231
>>>               avahi_daemon-main.o:(run_server)
ld: error: undefined symbol: inotify_add_watch
>>> referenced by main.c:948
>>>               avahi_daemon-main.o:(add_inotify_watches)
>>> referenced by main.c:953
>>>               avahi_daemon-main.o:(add_inotify_watches)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [Makefile:822: avahi-daemon] Error 1
gmake[2]: Leaving directory '/home/runner/work/avahi/avahi/avahi-daemon'
gmake[1]: Leaving directory '/home/runner/work/avahi/avahi'
gmake[1]: *** [Makefile:841: all-recursive] Error 1
gmake: *** [Makefile:751: all] Error 2

evverx avatar Oct 27 '25 08:10 evverx

Why close #676 then? I'd happily continue to work in that, it was Avahi side did not provide any feedback on our attempts to improve the situation.

arrowd avatar Oct 27 '25 09:10 arrowd

it was Avahi side did not provide any feedback on our attempts to improve the situation

The CI was red there because that PR broke the script building the fuzz targets and there were shellcheck warnings. It wasn't addressed so I assumed it just stalled.

Why close https://github.com/avahi/avahi/pull/676 then?

I can reopen it but I think the CI should be introduced in a separate PR.

evverx avatar Oct 27 '25 09:10 evverx

Ok, I'll make new separate PRs in near days.

arrowd avatar Oct 27 '25 09:10 arrowd

The make distcheck procedure fails on FreeBSD because it calls the configure script again, but this time without environment settings coming from bootstrap.sh.

Since this environment is related to the building host, I'd argue that setting these vars should be done in the CI code.

The whole bootstrap.sh script doesn't make much sense to me, because the traditional entry point to an autotools project is autogen.sh and it is user's responsibility to supply it with correct flags/env. I doubt any downstream actually uses this script, because it hardcodes too much stuff.

If removing bootstrap.sh altogether is too much, then maybe we can pop environment settings to the CI script at least?

arrowd avatar Oct 29 '25 08:10 arrowd

I think it should be fine to replace bootstrap.sh with autogen.sh in https://github.com/avahi/avahi/blob/d8f34478830282e8f69ffeebf210c07d3d9fe755/.github/workflows/build.sh#L81-L90

Currently it doesn't affect the CI in any way apart from adding -g -O0 to CFLAGS.

evverx avatar Oct 29 '25 09:10 evverx

It just so happened that I built nss-mdns on FreeBSD and to judge from https://github.com/avahi/nss-mdns/issues/99 it needs some looking into on FreeBSD as well along with the CI.

evverx avatar Nov 19 '25 07:11 evverx