Skip to content

Remove the correct file in uninstall-hook to fix make distcheck - #111

Merged
evverx merged 1 commit into
avahi:masterfrom
arrowd:distcheck-fix
Nov 29, 2025
Merged

Remove the correct file in uninstall-hook to fix make distcheck#111
evverx merged 1 commit into
avahi:masterfrom
arrowd:distcheck-fix

Conversation

@arrowd

@arrowd arrowd commented Nov 28, 2025

Copy link
Copy Markdown
Contributor

Fixes #103

Comment thread Makefile.am Outdated
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The uninstall hook already uses .2 everywhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the meantime can you expand on why it's needed in the commit message?

You mean, why changing to .2 fixes the issue?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

nss-mdns/Makefile.am

Lines 107 to 125 in 5a04c7a

install-exec-hook:
rm -f $(DESTDIR)$(libdir)/libnss_mdns.la
rm -f $(DESTDIR)$(libdir)/libnss_mdns_minimal.la
rm -f $(DESTDIR)$(libdir)/libnss_mdns4.la
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
rm -f $(DESTDIR)$(libdir)/libnss_mdns_minimal.so.2
rm -f $(DESTDIR)$(libdir)/libnss_mdns4.so.2
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.2
rm -f $(DESTDIR)$(libdir)/nss_mdns_minimal.so.2

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.la

On Linux that stuff is removed:

ls -l YO/usr/lib64/*.la
ls: cannot access 'YO/usr/lib64/*.la': No such file or directory

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking 0397aad the idea was to "remove la files from installation" and then it was followed by 87fcc29 to "fix make distcheck". It would probably make sense to do the same on FreeBSD to be consistent for now. Can you add all the modules to the hooks?

@arrowd
arrowd force-pushed the distcheck-fix branch 2 times, most recently from a2a57f4 to f6994b0 Compare November 28, 2025 18:56
@arrowd arrowd changed the title Set correct .so version suffix for nss_mdns_la to unbreak distcheck Remove the correct file in uninstall-hook to fix make distcheck Nov 28, 2025
@evverx evverx removed the ci-fails label Nov 28, 2025
@arrowd

arrowd commented Nov 29, 2025

Copy link
Copy Markdown
Contributor Author

Okay, I'm now completely confused. Building the project I do see

libtool: install: /usr/bin/install -c .libs/nss_mdns4.so.1 /wrkdirs/usr/ports/dns/nss_mdns/work/stage/usr/local/lib/nss_mdns4.so.1
libtool: install: strip --strip-unneeded /wrkdirs/usr/ports/dns/nss_mdns/work/stage/usr/local/lib/nss_mdns4.so.1
libtool: install: /usr/bin/install -c .libs/nss_mdns4.lai /wrkdirs/usr/ports/dns/nss_mdns/work/stage/usr/local/lib/nss_mdns4.la

But it does not end up in the installation dir somehow. This is why make distcheck passes even if we don't have correct commands in hooks. I'm obscured where these .la files go.

@arrowd

arrowd commented Nov 29, 2025

Copy link
Copy Markdown
Contributor Author

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 .la files should not be installed and hooks are trying to do the right thing.

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
@evverx

evverx commented Nov 29, 2025

Copy link
Copy Markdown
Collaborator

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 make distcheck on FreeBSD.

@evverx
evverx merged commit 585fc94 into avahi:master Nov 29, 2025
22 checks passed
@arrowd
arrowd deleted the distcheck-fix branch November 29, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make distcheck fails on FreeBSD

2 participants