Skip site navigation (1)Skip section navigation (2)
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
--000000000000ee225b060be56852
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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=3D\"${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@=E2=80=99s 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
>

--000000000000ee225b060be56852
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Wed, Dec 6, 2023, 9:55 PM Simon J. Gerraty &lt;<a h=
ref=3D"mailto:sjg@juniper.net">sjg@juniper.net</a>&gt; wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex">Jessica Clarke &lt;<a href=3D"mailto:jrtc27@free=
bsd.org" target=3D"_blank" rel=3D"noreferrer">jrtc27@freebsd.org</a>&gt; wr=
ote:<br>
&gt; &gt; Warner Losh &lt;<a href=3D"mailto:imp@bsdimp.com" target=3D"_blan=
k" rel=3D"noreferrer">imp@bsdimp.com</a>&gt; wrote:<br>
&gt; &gt;&gt; Silly question: why not just add it to CFLAGS with<br>
&gt; &gt;&gt; -DOSNAME=3D\&quot;${OSNAME}\&quot; rather than generating thi=
s file?<br>
&gt; &gt;<br>
&gt; &gt; Actually it is an excellent question - I&#39;ve no idea why opt_o=
sname.h is<br>
&gt; &gt; needed.<br>
&gt; <br>
&gt; To quote the motivation from brd@=E2=80=99s original review:<br>
&gt; <br>
&gt; &gt; The reason I did it using a file is so that make(1) would detect =
a<br>
&gt; &gt; change a rebuild if you change the value and do another build.<br=
>
<br>
A fair point.=C2=A0 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=3D"auto"=
><br></div><div dir=3D"auto">This name never changes on practice.=C2=A0 We =
shouldn&#39;t optimize for a rare case that causes build races. Who would e=
ver change it in the same tree?</div><div dir=3D"auto"><br></div><div dir=
=3D"auto">Warner=C2=A0</div><div dir=3D"auto"><br></div><div dir=3D"auto"><=
div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin=
:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
--sjg<br>
</blockquote></div></div></div>

--000000000000ee225b060be56852--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoK4V_r_3qVgKJLPMxweTyXyPLFrHHJqTXRomE=woqSRQ>