Date: Wed, 6 Dec 2023 23:16:24 -0700 From: Warner Losh <imp@bsdimp.com> To: "Simon J. Gerraty" <sjg@juniper.net> Cc: Jessica Clarke <jrtc27@freebsd.org>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, "<dev-commits-src-main@freebsd.org>" <dev-commits-src-main@freebsd.org> Subject: Re: git: 83d0b8c089d8 - main - bsdinstall generate opt_osname.h in include Message-ID: <CANCZdfoK4V_r_3qVgKJLPMxweTyXyPLFrHHJqTXRomE=woqSRQ@mail.gmail.com> In-Reply-To: <58331.1701924865@kaos.jnpr.net> References: <202312070235.3B72ZoZp043061@gitrepo.freebsd.org> <CANCZdfpm=GD5_5tf3LCrhVWcv95jb86mj23JEAX=2dsKyJQ5rQ@mail.gmail.com> <71239.1701921562@kaos.jnpr.net> <D51E0060-60C3-4D56-96C5-B51F1D07DD6C@freebsd.org> <58331.1701924865@kaos.jnpr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Wed, Dec 6, 2023, 9:55 PM Simon J. Gerraty <sjg@juniper.net> wrote:
> Jessica Clarke <jrtc27@freebsd.org> wrote:
> > > Warner Losh <imp@bsdimp.com> wrote:
> > >> Silly question: why not just add it to CFLAGS with
> > >> -DOSNAME=\"${OSNAME}\" rather than generating this file?
> > >
> > > Actually it is an excellent question - I've no idea why opt_osname.h is
> > > needed.
> >
> > To quote the motivation from brd@’s original review:
> >
> > > The reason I did it using a file is so that make(1) would detect a
> > > change a rebuild if you change the value and do another build.
>
> A fair point. Of course moot if using META_MODE.
> The other benefit of the header is only the files that include it will
> be rebuilt when the value changes whereas (with META_MODE) everything
> will be rebuilt if value is in CFLAGS.
>
> That can be mitigated by using per object CFLAGS, but all in all the
> header is a simpler solution.
>
This name never changes on practice. We shouldn't optimize for a rare case
that causes build races. Who would ever change it in the same tree?
Warner
--sjg
>
[-- Attachment #2 --]
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 6, 2023, 9:55 PM Simon J. Gerraty <<a href="mailto:sjg@juniper.net">sjg@juniper.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Jessica Clarke <<a href="mailto:jrtc27@freebsd.org" target="_blank" rel="noreferrer">jrtc27@freebsd.org</a>> wrote:<br>
> > Warner Losh <<a href="mailto:imp@bsdimp.com" target="_blank" rel="noreferrer">imp@bsdimp.com</a>> wrote:<br>
> >> Silly question: why not just add it to CFLAGS with<br>
> >> -DOSNAME=\"${OSNAME}\" rather than generating this file?<br>
> ><br>
> > Actually it is an excellent question - I've no idea why opt_osname.h is<br>
> > needed.<br>
> <br>
> To quote the motivation from brd@’s original review:<br>
> <br>
> > The reason I did it using a file is so that make(1) would detect a<br>
> > change a rebuild if you change the value and do another build.<br>
<br>
A fair point. Of course moot if using META_MODE.<br>
The other benefit of the header is only the files that include it will<br>
be rebuilt when the value changes whereas (with META_MODE) everything<br>
will be rebuilt if value is in CFLAGS.<br>
<br>
That can be mitigated by using per object CFLAGS, but all in all the<br>
header is a simpler solution.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">This name never changes on practice. We shouldn't optimize for a rare case that causes build races. Who would ever change it in the same tree?</div><div dir="auto"><br></div><div dir="auto">Warner </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
--sjg<br>
</blockquote></div></div></div>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoK4V_r_3qVgKJLPMxweTyXyPLFrHHJqTXRomE=woqSRQ>
