Re: devel/libev: error: 'sys/statfs.h' file not found on recent main

From: Nuno Teixeira <eduardo_at_freebsd.org>
Date: Wed, 09 Jul 2025 19:20:43 UTC
Hello,

It seems that inotify addition to src recently is triggering libev:
#if EV_USE_INOTIFY
# include <sys/statfs.h>
that leads to error.

Mark Johnston sugested that I try:

---- ev.c.orig  2015-12-20 21:12:53 UTC
+--- ev.c.orig  2020-03-18 12:27:32 UTC
 +++ ev.c
-@@ -2736,7 +2736,7 @@ ev_recommended_backends (void) EV_THROW
+@@ -507,7 +507,7 @@
+ #endif
+
+ #if EV_USE_INOTIFY
+-# include <sys/statfs.h>
++# include <sys/mount.h>
+ # include <sys/inotify.h>
+ /* some very old inotify.h headers don't have IN_DONT_FOLLOW */
+ # ifndef IN_DONT_FOLLOW
+@@ -3149,7 +3149,7 @@ ev_recommended_backends (void) EV_NOEXCEPT
  {
    unsigned int flags = ev_supported_backends ();

I will test this tonite.

Cheers,

Mark Millard <marklmi@yahoo.com> escreveu (quarta, 9/07/2025 à(s) 14:09):

> On Jul 9, 2025, at 04:10, Nuno Teixeira <eduardo@freebsd.org> wrote:
>
> > (...)
> >
> > BTW, man statfs says:
> >
> > NAME
> >      statfs – get file system statistics
> >
> > LIBRARY
> >      Standard C Library (libc, -lc)
> >
> > SYNOPSIS
> >      #include <sys/param.h>
> >      #include <sys/mount.h>
> >
> > This way I cannot understand how port did not failed before since the
> absence of statfs.h.
> >
> > Nuno Teixeira <eduardo@freebsd.org> escreveu (quarta, 9/07/2025 à(s)
> 11:51):
> >> Hello all,
> >>
> >> Can anyone do a testport on devel/libev on recent aarch64 main?
> >>
> >> libtool: compile:  cc -DHAVE_CONFIG_H -I. -O2 -pipe
> -fstack-protector-strong -fno-strict-aliasing -MT event.lo -MD -MP -MF
> .deps/event.Tpo -c event.c  -fPIC -DPIC -o .libs/event.o
> >> --- ev.lo ---
> >> ev.c:510:11: fatal error: 'sys/statfs.h' file not found
> >>   510 | # include <sys/statfs.h>
> >>       |           ^~~~~~~~~~~~~~
> >>
> >> strange that I have this pkg builded (poudriere) on main 2025-06-23.
> (1500048)
> >
>
> From what I read, sys/statfs.h is linux specific ( and also
> can be called sys/vfs.h ). So it seems that part of the
> build is picking to use linux specific code in your context.
>
> Unfortunately, the most recent official main-arm64
> port-packages build started back on 14 Jun 2025 02:48:40 UTC.
> The most recent main-armv7 (still in process) started on
> 30 Jun 2025 09:07:59 GMT. Both built devel/libev just fine.
> There is probably still something like 100 hrs to go for
> main-armv7 to finish before ampere2 starts building
> main-arm64 again.
>
> It should finally start using pkg 2.2.1 instead of 2.1.4
> but it seems the elapsed build times will likely be
> multiplied by 0.9 or closer to 1 for these main-* types of
> builds, just a small improvement for main-* builds.
>
> ===
> Mark Millard
> marklmi at yahoo.com
>
>

-- 
Nuno Teixeira
FreeBSD UNIX:  <eduardo@FreeBSD.org>   Web:  https://FreeBSD.org