Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Dec 2017 10:25:55 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        "Rodney W. Grimes" <rgrimes@freebsd.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r326535 - head/tools/boot
Message-ID:  <CANCZdfqRPX0ZC%2BA-=9JAPMD%2BXc8gsXm-cHBD5CPbBmJSh3O_%2BA@mail.gmail.com>
In-Reply-To: <201712041714.vB4HEwpd046935@pdx.rh.CN85.dnsmgr.net>
References:  <201712041638.vB4GcK0q087528@repo.freebsd.org> <201712041714.vB4HEwpd046935@pdx.rh.CN85.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 4, 2017 at 10:14 AM, Rodney W. Grimes <
freebsd@pdx.rh.cn85.dnsmgr.net> wrote:

> [ Charset UTF-8 unsupported, converting... ]
> > Author: imp
> > Date: Mon Dec  4 16:38:20 2017
> > New Revision: 326535
> > URL: https://svnweb.freebsd.org/changeset/base/326535
> >
> > Log:
> >   Just use the last line of the output from getting .OBJDIR. The
> >   buildenv target prints other stuff too that needs to be ignored.
> >
> >   Sponsored by: Netflix
> >
> > Modified:
> >   head/tools/boot/universe.sh
> >
> > Modified: head/tools/boot/universe.sh
> > ============================================================
> ==================
> > --- head/tools/boot/universe.sh       Mon Dec  4 15:28:07 2017
> (r326534)
> > +++ head/tools/boot/universe.sh       Mon Dec  4 16:38:20 2017
> (r326535)
> > @@ -26,7 +26,7 @@ dobuild()
> >      local opt=$3
> >
> >      echo -n "Building $ta ${opt} ... "
> > -    objdir=$(make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -V
> .OBJDIR")
> > +    objdir=$(make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -V
> .OBJDIR" | tail -1)
> >      rm -rf ${objdir}
> >      if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean
> cleandepend cleandir obj depend"  \
> >        > $lf 2>&1; then
>
> We should probably find a better way than this,
> that is a very error prone mechanism to use.
>
> And given your gona run an rm -rf on the return value very dangerious
> if wrong.
>
>
> Something like adding a QUIET=true to buildenv so that it only outputs the
> desired value?  Or having buildenv have options to directly output your
> desired .OBJDIR value?
>

This method works regardless of what noise is output, from none at all, to
paragraphs of help. I'm content with the solution. This tool is primarily
used by me for testing that changes to src/stand work on all the relevant
environments. I'm OK with some fragility and sharp edges.

While I wouldn't mind more knobs on the buildenv stuff, our current build
system is somewhat overburdened with knobs so a new knob for a narrow use
case isn't my first choice. I'd rather work around it in this case. I'd, of
course, revisit this choice if there's other users that come forward. So
far I think I'm the only one given the other bugs I had to fix in
buildenv...

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqRPX0ZC%2BA-=9JAPMD%2BXc8gsXm-cHBD5CPbBmJSh3O_%2BA>