Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Dec 2021 10:58:50 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Gary Jennejohn <gljennjohn@gmail.com>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: WITHOUT_PF breaks buildworld
Message-ID:  <CANCZdfqAdO1HMDnWMsEU1LarRj36GzA%2Bog%2BxGkBY6rziA_yLWQ@mail.gmail.com>
In-Reply-To: <20211222170151.05a4afe3@ernst.home>
References:  <20211219114723.338b235e@ernst.home> <61bf1204.1c69fb81.2c8fc.3280SMTPIN_ADDED_BROKEN@mx.google.com> <20211219122443.1c84093f@ernst.home> <CAGgez=%2B_jdDn6dfOeo%2BuBeeFNzBfD57HL4wUrw=X-BmGg7mPyg@mail.gmail.com> <74FC7625-295C-4DEC-BF35-434B5F8D7832@FreeBSD.org> <20211222165154.33ef54fd@ernst.home> <20211222170151.05a4afe3@ernst.home>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Wed, Dec 22, 2021, 10:02 AM Gary Jennejohn <gljennjohn@gmail.com> wrote:

> On Wed, 22 Dec 2021 16:51:54 +0100
> Gary Jennejohn <gljennjohn@gmail.com> wrote:
>
> On Wed, 22 Dec 2021 16:27:52 +0100
> Kristof Provost <kp@FreeBSD.org> wrote:
>
> > On 22 Dec 2021, at 8:21, Konrad Sewi??o-Jopek wrote:
> > > Hi,
> > >
> > > I think the reason is somewhere in tools/build/test-includes:
> > >
> > > --- net/if_pfsync.o ---
> > > In file included from net/if_pfsync.c:1:
> > > In file included from
> > > [...]freebsd/arm64.aarch64/tmp/usr/include/net/if_pfsync.h:56:
> > > [...]freebsd/arm64.aarch64/tmp/usr/include/net/pfvar.h:65:10: fatal
> error:
> > > 'netpfil/pf/pf.h' file not found
> > > #include <netpfil/pf/pf.h>
> > >          ^~~~~~~~~~~~~~~~~
> > > 1 error generated.
> > > *** [net/if_pfsync.o] Error code 1
> > >
> > > make[3]: stopped in [...]freebsd/tools/build/test-includes
> > > --- net/pfvar.o ---
> > > > In file included from net/pfvar.c:1:
> > > > [...]freebsd/arm64.aarch64/tmp/usr/include/net/pfvar.h:65:10: fatal
> error:
> > > > 'netpfil/pf/pf.h' file not found
> > > > #include <netpfil/pf/pf.h>
> > > >          ^~~~~~~~~~~~~~~~~
> > > > 1 error generated.
> > > > *** [net/pfvar.o] Error code 1
> > > >
> > > > make[3]: stopped in [...]freebsd/tools/build/test-includes
> > > > 2 errors
> > > >
> > > > make[3]: stopped in [...]freebsd/tools/build/test-includes
> > > > *** [test-includes] Error code 2
> > > >
> > > > make[2]: stopped in [...]freebsd
> > > > 1 error
> > > >
> > > > Best regards,
> > > > Konrad Sewi??o-Jopek
> > > >
> > > >
> > > > niedz., 19 gru 2021 o 12:26 Gary Jennejohn <gljennjohn@gmail.com>
> > > > napisa?(a):
> > > >
> > > >> On Sun, 19 Dec 2021 19:05:35 +0800
> > > >> Alastair Hogge <agh@riseup.net> wrote:
> > > >>
> > > >>> On Sunday, 19 December 2021 6:47:23 PM AWST Gary Jennejohn wrote:
>
> > > >>>> Some recent change, probably in a .mk file, breaks builworld on
> HEAD
> > > >>>> when WITHOUT_PF is enabled in src.conf.
> > > >>>
> > > >>> I have had to disable WITHOUT_PF since 2020-07-27, but probably
> earlier.
> > > >>>
> > > >>
> > > >> Hmm.  I did a successful buildworld a few days ago with WITHOUT_PF
> > > >> enabled, so it's new breakge for me at least.
> > > >>
> > > >> I don't enable pf in the kernel and don't need it in userland.
> > > >>
> > > >>>> Disabling WITHOUT_PF results in a successful buildworld.
> > > >>>>
> > > >>>> The reported error is that netpfil/pf/pf.h can't be found.
> > > >>>
> > > >>> Some ports depend on that too.
> > > >>>
> > > >>
> > This is the test-includes target, which validates that include files are
> self-contained (that is, you can '#include <$file>' without prerequisites.
> > The target fails because it looks at all headers in /usr/src/sys and
> then tries to build them, but some of those headers (like the pf headers)
> include other headers that may not be getting installed because they're
> disabled.
> >
> > I'm not quite sure how to best fix this.
> >
> > Note that it is not happening because some pf tools are still getting
> built. This is a validation target that fails.
> >
> > We could potentially add the pf headers to BADHDRS depending on the
> WITHOUT_ flag, but that would mean manually maintaining badfiles.inc.
> > Or perhaps we should keep installing the pf headers even when WITHOUT_PF
> is set, but I'm not actually sure how we convince the build system to do
> that. Or if it's a good idea.
> >
> > Warner might have better ideas on how to fix this.
> >
>
> This simple patch to /usr/src/include/Makefile fixes it for me:
>
> --- Makefile.orig       2021-12-22 13:37:02.817745000 +0100
> +++ Makefile    2021-12-22 13:37:12.177336000 +0100
> @@ -246,9 +246,7 @@
>  INCSGROUPS+=   IPFILTER
>  .endif
>
> -.if ${MK_PF} != "no"
>  INCSGROUPS+=   PF
> -.endif
>
>  .if ${MK_CDDL} != "no"
>  INCSGROUPS+=   NVPAIR
>
> Since pf.h is used so widely in the tree it's probably the simplest fix.
>

I like this. I'd unconditionally remove the test in preference to adding it
conditionally.

Warner

[-- Attachment #2 --]
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 22, 2021, 10:02 AM Gary Jennejohn &lt;<a href="mailto:gljennjohn@gmail.com" target="_blank" rel="noreferrer">gljennjohn@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, 22 Dec 2021 16:51:54 +0100<br>
Gary Jennejohn &lt;<a href="mailto:gljennjohn@gmail.com" rel="noreferrer noreferrer" target="_blank">gljennjohn@gmail.com</a>&gt; wrote:<br>
<br>
On Wed, 22 Dec 2021 16:27:52 +0100<br>
Kristof Provost &lt;kp@FreeBSD.org&gt; wrote:<br>
<br>
&gt; On 22 Dec 2021, at 8:21, Konrad Sewi??o-Jopek wrote:  <br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; I think the reason is somewhere in tools/build/test-includes:<br>
&gt; &gt;<br>
&gt; &gt; --- net/if_pfsync.o ---<br>
&gt; &gt; In file included from net/if_pfsync.c:1:<br>
&gt; &gt; In file included from<br>
&gt; &gt; [...]freebsd/arm64.aarch64/tmp/usr/include/net/if_pfsync.h:56:<br>
&gt; &gt; [...]freebsd/arm64.aarch64/tmp/usr/include/net/pfvar.h:65:10: fatal error:<br>
&gt; &gt; &#39;netpfil/pf/pf.h&#39; file not found<br>
&gt; &gt; #include &lt;netpfil/pf/pf.h&gt;<br>
&gt; &gt;          ^~~~~~~~~~~~~~~~~<br>
&gt; &gt; 1 error generated.<br>
&gt; &gt; *** [net/if_pfsync.o] Error code 1<br>
&gt; &gt;<br>
&gt; &gt; make[3]: stopped in [...]freebsd/tools/build/test-includes<br>
&gt; &gt; --- net/pfvar.o ---<br>
&gt; &gt; &gt; In file included from net/pfvar.c:1:<br>
&gt; &gt; &gt; [...]freebsd/arm64.aarch64/tmp/usr/include/net/pfvar.h:65:10: fatal error:<br>
&gt; &gt; &gt; &#39;netpfil/pf/pf.h&#39; file not found<br>
&gt; &gt; &gt; #include &lt;netpfil/pf/pf.h&gt;<br>
&gt; &gt; &gt;          ^~~~~~~~~~~~~~~~~<br>
&gt; &gt; &gt; 1 error generated.<br>
&gt; &gt; &gt; *** [net/pfvar.o] Error code 1<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; make[3]: stopped in [...]freebsd/tools/build/test-includes<br>
&gt; &gt; &gt; 2 errors<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; make[3]: stopped in [...]freebsd/tools/build/test-includes<br>
&gt; &gt; &gt; *** [test-includes] Error code 2<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; make[2]: stopped in [...]freebsd<br>
&gt; &gt; &gt; 1 error<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Best regards,<br>
&gt; &gt; &gt; Konrad Sewi??o-Jopek<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; niedz., 19 gru 2021 o 12:26 Gary Jennejohn &lt;<a href="mailto:gljennjohn@gmail.com" rel="noreferrer noreferrer" target="_blank">gljennjohn@gmail.com</a>&gt;<br>
&gt; &gt; &gt; napisa?(a):<br>
&gt; &gt; &gt;    <br>
&gt; &gt; &gt;&gt; On Sun, 19 Dec 2021 19:05:35 +0800<br>
&gt; &gt; &gt;&gt; Alastair Hogge &lt;<a href="mailto:agh@riseup.net" rel="noreferrer noreferrer" target="_blank">agh@riseup.net</a>&gt; wrote:<br>
&gt; &gt; &gt;&gt;    <br>
&gt; &gt; &gt;&gt;&gt; On Sunday, 19 December 2021 6:47:23 PM AWST Gary Jennejohn wrote:    <br>
&gt; &gt; &gt;&gt;&gt;&gt; Some recent change, probably in a .mk file, breaks builworld on HEAD<br>
&gt; &gt; &gt;&gt;&gt;&gt; when WITHOUT_PF is enabled in src.conf.    <br>
&gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt;&gt;&gt; I have had to disable WITHOUT_PF since 2020-07-27, but probably earlier.<br>
&gt; &gt; &gt;&gt;&gt;    <br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; Hmm.  I did a successful buildworld a few days ago with WITHOUT_PF<br>
&gt; &gt; &gt;&gt; enabled, so it&#39;s new breakge for me at least.<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; I don&#39;t enable pf in the kernel and don&#39;t need it in userland.<br>
&gt; &gt; &gt;&gt;    <br>
&gt; &gt; &gt;&gt;&gt;&gt; Disabling WITHOUT_PF results in a successful buildworld.<br>
&gt; &gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt;&gt;&gt;&gt; The reported error is that netpfil/pf/pf.h can&#39;t be found.    <br>
&gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt;&gt;&gt; Some ports depend on that too.<br>
&gt; &gt; &gt;&gt;&gt;    <br>
&gt; &gt; &gt;&gt;    <br>
&gt; This is the test-includes target, which validates that include files are self-contained (that is, you can &#39;#include &lt;$file&gt;&#39; without prerequisites.<br>
&gt; The target fails because it looks at all headers in /usr/src/sys and then tries to build them, but some of those headers (like the pf headers) include other headers that may not be getting installed because they&#39;re disabled.<br>
&gt; <br>
&gt; I&#39;m not quite sure how to best fix this.<br>
&gt; <br>
&gt; Note that it is not happening because some pf tools are still getting built. This is a validation target that fails.<br>
&gt; <br>
&gt; We could potentially add the pf headers to BADHDRS depending on the WITHOUT_ flag, but that would mean manually maintaining badfiles.inc.<br>
&gt; Or perhaps we should keep installing the pf headers even when WITHOUT_PF is set, but I&#39;m not actually sure how we convince the build system to do that. Or if it&#39;s a good idea.<br>
&gt; <br>
&gt; Warner might have better ideas on how to fix this.<br>
&gt;   <br>
<br>
This simple patch to /usr/src/include/Makefile fixes it for me:<br>
<br>
--- Makefile.orig       2021-12-22 13:37:02.817745000 +0100<br>
+++ Makefile    2021-12-22 13:37:12.177336000 +0100<br>
@@ -246,9 +246,7 @@<br>
 INCSGROUPS+=   IPFILTER<br>
 .endif<br>
<br>
-.if ${MK_PF} != &quot;no&quot;<br>
 INCSGROUPS+=   PF<br>
-.endif<br>
<br>
 .if ${MK_CDDL} != &quot;no&quot;<br>
 INCSGROUPS+=   NVPAIR<br>
<br>
Since pf.h is used so widely in the tree it&#39;s probably the simplest fix.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I like this. I&#39;d unconditionally remove the test in preference to adding it conditionally. </div><div dir="auto"><br></div><div dir="auto">Warner</div></div>
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqAdO1HMDnWMsEU1LarRj36GzA%2Bog%2BxGkBY6rziA_yLWQ>