Remove the correct file in uninstall-hook to fix make distcheck - #111
Conversation
| nss_mdns_la_SOURCES=$(libnss_mdns_la_SOURCES) src/bsdnss.c | ||
| nss_mdns_la_CFLAGS=$(AM_CFLAGS) | ||
| nss_mdns_la_LDFLAGS=$(AM_LDFLAGS) -shrext .so.1 | ||
| nss_mdns_la_LDFLAGS=$(AM_LDFLAGS) -shrext .so.2 |
There was a problem hiding this comment.
I'll point the avahi CI at this PR shortly to make sure it works. In the meantime can you expand on why it's needed in the commit message?
I'm somewhat surprised that it should make it pass without changing install-exec-hook and uninstall-hook. I was looking at 6cc5bc5 (where the hooks were adjusted) and 5146566 (where they weren't changed) and thought that it was all because of that. Either way even if distcheck passes I think the hooks should be updated too (unless I'm missing something)
There was a problem hiding this comment.
The uninstall hook already uses .2 everywhere.
There was a problem hiding this comment.
In the meantime can you expand on why it's needed in the commit message?
You mean, why changing to .2 fixes the issue?
There was a problem hiding this comment.
The uninstall hook already uses .2 everywhere.
It does but it doesn't remove all the nss* modules. Similarly the install hook doesn't remove all the .la stuff. Some nss* modules are missing compared to the Linux libnss* stuff:
Lines 107 to 125 in 5a04c7a
You mean, why changing to .2 fixes the issue?
I think the commit message should say something like that (and why it doesn't break anything or something like that). It shouldn't be long but it should be possible to figure out what it does by just reading it without visiting any links or going to GitHub. In the avahi repository there are a lot of links to the old bug tracker and they are all dead now so I have no idea why some things were made the way they were made.
There was a problem hiding this comment.
Here's what I see on FreeBSD after make install for example
$ ls YO/usr/local/lib/*.la
YO/usr/local/lib/nss_mdns4.la YO/usr/local/lib/nss_mdns6.la
YO/usr/local/lib/nss_mdns4_minimal.la YO/usr/local/lib/nss_mdns6_minimal.laOn Linux that stuff is removed:
ls -l YO/usr/lib64/*.la
ls: cannot access 'YO/usr/lib64/*.la': No such file or directoryThere was a problem hiding this comment.
That's a good question. In the context of this makefile FreeBSD should probably be consistent with Linux and remove them all (instead of removing 2 files and leaving everything else).
Either way the CI failed in https://github.com/evverx/avahi/actions/runs/19771072046/job/56655112826?pr=3 so it does look like it should be .1 instead of .2. Looking at the output of truss it seems it looks for the *.1 modules:
open("/lib/nss_mdns.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory'
open("/usr/lib/nss_mdns.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory'
open("/usr/lib/compat/nss_mdns.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory'
open("/usr/local/lib/nss_mdns.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory'I'm guessing in 6cc5bc5 *.2 was a copy-paste error that came from the Linux part.
There was a problem hiding this comment.
You're correct, it has to be .1: https://github.com/freebsd/freebsd-src/blob/9978553d0199e7ec0bdd1c44fc7f6c7b0c11e43b/lib/libc/net/nsdispatch.c#L512-L515
There was a problem hiding this comment.
The CI passed on FreeBSD in https://github.com/evverx/avahi/actions/runs/19772051696/job/56657965951?pr=3 so it seems it works. The hooks still looks wrong and inconsistent though and looking at 5146566 I'm still not sure why they weren't updated.
There was a problem hiding this comment.
It also works with
diff --git a/Makefile.am b/Makefile.am
index 4f8c182..46b3292 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -111,8 +111,6 @@ install-exec-hook:
rm -f $(DESTDIR)$(libdir)/libnss_mdns4_minimal.la
rm -f $(DESTDIR)$(libdir)/libnss_mdns6.la
rm -f $(DESTDIR)$(libdir)/libnss_mdns6_minimal.la
- rm -f $(DESTDIR)$(libdir)/nss_mdns.la
- rm -f $(DESTDIR)$(libdir)/nss_mdns_minimal.la
uninstall-hook:
rm -f $(DESTDIR)$(libdir)/libnss_mdns.so.2
@@ -121,8 +119,6 @@ uninstall-hook:
rm -f $(DESTDIR)$(libdir)/libnss_mdns4_minimal.so.2
rm -f $(DESTDIR)$(libdir)/libnss_mdns6.so.2
rm -f $(DESTDIR)$(libdir)/libnss_mdns6_minimal.so.2
- rm -f $(DESTDIR)$(libdir)/nss_mdns.so.1
- rm -f $(DESTDIR)$(libdir)/nss_mdns_minimal.so.1
I'd go with that for now (or add all the nss modules to the hooks to make it consistent with Linux). Generally the hooks need looking into but it can be done separately when I can figure out where they came from. c7d37e9 says "Try non-recursive automake" and I'm not sure what it means at this point).
36bff6b to
8783ef7
Compare
a2a57f4 to
f6994b0
Compare
|
Okay, I'm now completely confused. Building the project I do see But it does not end up in the installation dir somehow. This is why |
|
Oh, nevermind this is because I'm building from Ports, and its machinery does exactly this: https://github.com/freebsd/freebsd-ports/blob/4c0331816abb96c636e27e99f225b6afcc2c19c7/Mk/Uses/libtool.mk#L5-L7 All right, this comment basically says that normally |
The nss module is suffixed with .1 on FreeBSD while the hook tries to remove .2 Also remove .la files to match with the Linux build. Fixes avahi#103
f6994b0 to
2773e3e
Compare
|
I'll merge it once https://github.com/evverx/avahi/actions/runs/19780836722 is green and then remove the kludge from the avahi CI to start running |
Fixes #103