[OpenAFS-devel] avoiding make rules with multiple targets

Marc Dionne marc.c.dionne@gmail.com
Wed, 20 Feb 2013 11:39:40 -0500


--f46d04389349cd192204d62a9a29
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Feb 19, 2013 at 7:10 PM, Benjamin Kaduk <kaduk@mit.edu> wrote:

> We've had a few commits over the years to help parallel builds along by
> splitting rules with two targets into two separate rules, one a pure
> dependency and the other with the actual contents of the rule (usually
> compile_et).
>
> A typical example is 147aeeb6c59b5f4a9f8a795a91e0c4**2ecf80278c
> (gerrit/257) (trimmed):
> -budb_errs.c budb_client.h: budb_errs.et budb_client.p.h
> +budb_client.h: budb_errs.c
> +
> +budb_errs.c: budb_errs.et budb_client.p.h
>         $(RM) -f budb_client.h budb_errs.c; ${COMPILE_ET} -p ${srcdir}
> budb_errs -h budb_client
>
> However, these changes seem to cause problems for FreeBSD make, even for
> serial builds.  The build log shows a failure to install budb_client.h , No
> such file or directory, but then continues on to compile linktest before
> bailing out (sorry for the poorly wrapped copy/paste):
>
> install  -o root -g wheel -m 444 JUAFS/libjuafs.a
> /usr/ports/net/openafs/work/**openafs-1.6.2/lib/libjuafs.a
> install  -o root -g wheel -m 444 UAFS/libuafs.a
> /usr/ports/net/openafs/work/**openafs-1.6.2/lib/libuafs.a
> case amd64_fbsd_91 in alpha_dux*|sgi_*|sun4x_*|**
> sunx86_*|rs_aix*|*linux*|hp_**ux11*|ia64_hpux*|*_darwin_1*|***nbsd*|*obsd*|*fbsd*)
> cd src && cd shlibafsauthent && make all ;;  *)  echo Not building shared
> libafsauthent for amd64_fbsd_91 ;;  esac
> install  -o root -g wheel -m 444 budb_client.h /usr/ports/net/openafs/work/
> **openafs-1.6.2/include/afs/**budb_client.h
> install: budb_client.h: No such file or directory
> *** [/usr/ports/net/openafs/work/**openafs-1.6.2/include/afs/**budb_client.h]
> Error code 71
> cc -g -O -I/usr/ports/net/openafs/work/**openafs-1.6.2/src/config
> -I/usr/ports/net/openafs/work/**openafs-1.6.2/include -I. -I.  -O2 -pipe
> -fPIC   -c budb_errs.c
> [ yes != "" ] || case amd64_fbsd_91 in alpha_dux*|sgi_*|sun*_5*|rs_**
> aix*|*linux*|hp_ux11*|ia64_**hpux*|*[nof]bsd*) cd src && cd tptserver &&
> make all ;;  *_darwin_[1-6][0-9])  echo Not building MT ptserver for
> amd64_fbsd_91 ;;  *_darwin_*)  cd src && cd tptserver  && make all ;;  *)
>  echo Not building MT ptserver for amd64_fbsd_91 ;;  esac
>
>
>
> The make debugging output is not immediately enlightening, but provides
> some hints.
>
> budb_server (???) depends on ${TOP_INCDIR}/afs/budb_client.**h depends on
> budb_client.h depends on budb_errs.c depends on budb_errs.et. Yet
> budb_errs.c has been generated from the rule for budb_errs.h (${COMPILE_ET}
> -p ${srcdir} budb_errs) and is up-to-date, so make's internal bookkeeping
> sees the empty rule to make budb_client.h from budb_errs.c, claims succes
> (I don't see this in the debugging log, though?!) and tries to install the
> header.
>
> The problem seems to stem from there being two calls to compile_et using
> budb_errs.et, one of which makes budb_errs.h and the other which makes
> budb_client.h.  Swapping the order in which the multiple targets are split
> out, so that budb_errs.c depends on budb_client.h which is made via
> compile_et, lets my build finish here, but it's probably not the best
> solution.
>
> Is there reason to not make a budb_client.h that is the contents of
> budb_client.p.h with #include <budb_errs.h> added?  Alternately we could
> process the template manually with the shell.
>
> [tbudb has the same issue]
>
> -Ben
>

Sounds like we want commit 0d0b5048a5b68d4079b13609775f9234183d1947 from
master?

Marc

--f46d04389349cd192204d62a9a29
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div class=3D"gmail_quote">On Tue, Feb 19, 2013 at 7:10 PM, Benjamin Kaduk =
<span dir=3D"ltr">&lt;<a href=3D"mailto:kaduk@mit.edu" target=3D"_blank">ka=
duk@mit.edu</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We&#39;ve had a few commits over the years to help parallel builds along by=
 splitting rules with two targets into two separate rules, one a pure depen=
dency and the other with the actual contents of the rule (usually compile_e=
t).<br>

<br>
A typical example is 147aeeb6c59b5f4a9f8a795a91e0c4<u></u>2ecf80278c (gerri=
t/257) (trimmed):<br>
-budb_errs.c budb_client.h: <a href=3D"http://budb_errs.et" target=3D"_blan=
k">budb_errs.et</a> budb_client.p.h<br>
+budb_client.h: budb_errs.c<br>
+<br>
+budb_errs.c: <a href=3D"http://budb_errs.et" target=3D"_blank">budb_errs.e=
t</a> budb_client.p.h<br>
=A0 =A0 =A0 =A0 $(RM) -f budb_client.h budb_errs.c; ${COMPILE_ET} -p ${srcd=
ir} budb_errs -h budb_client<br>
<br>
However, these changes seem to cause problems for FreeBSD make, even for se=
rial builds. =A0The build log shows a failure to install budb_client.h , No=
 such file or directory, but then continues on to compile linktest before b=
ailing out (sorry for the poorly wrapped copy/paste):<br>

<br>
install =A0-o root -g wheel -m 444 JUAFS/libjuafs.a /usr/ports/net/openafs/=
work/<u></u>openafs-1.6.2/lib/libjuafs.a<br>
install =A0-o root -g wheel -m 444 UAFS/libuafs.a /usr/ports/net/openafs/wo=
rk/<u></u>openafs-1.6.2/lib/libuafs.a<br>
case amd64_fbsd_91 in alpha_dux*|sgi_*|sun4x_*|<u></u>sunx86_*|rs_aix*|*lin=
ux*|hp_<u></u>ux11*|ia64_hpux*|*_darwin_1*|*<u></u>nbsd*|*obsd*|*fbsd*) cd =
src &amp;&amp; cd shlibafsauthent &amp;&amp; make all ;; =A0*) =A0echo Not =
building shared libafsauthent for amd64_fbsd_91 ;; =A0esac<br>

install =A0-o root -g wheel -m 444 budb_client.h /usr/ports/net/openafs/wor=
k/<u></u>openafs-1.6.2/include/afs/<u></u>budb_client.h<br>
install: budb_client.h: No such file or directory<br>
*** [/usr/ports/net/openafs/work/<u></u>openafs-1.6.2/include/afs/<u></u>bu=
db_client.h] Error code 71<br>
cc -g -O -I/usr/ports/net/openafs/work/<u></u>openafs-1.6.2/src/config -I/u=
sr/ports/net/openafs/work/<u></u>openafs-1.6.2/include -I. -I. =A0-O2 -pipe=
 -fPIC =A0 -c budb_errs.c<br>
[ yes !=3D &quot;&quot; ] || case amd64_fbsd_91 in alpha_dux*|sgi_*|sun*_5*=
|rs_<u></u>aix*|*linux*|hp_ux11*|ia64_<u></u>hpux*|*[nof]bsd*) cd src &amp;=
&amp; cd tptserver &amp;&amp; make all ;; =A0*_darwin_[1-6][0-9]) =A0echo N=
ot building MT ptserver for amd64_fbsd_91 ;; =A0*_darwin_*) =A0cd src &amp;=
&amp; cd tptserver =A0&amp;&amp; make all ;; =A0*) =A0echo Not building MT =
ptserver for amd64_fbsd_91 ;; =A0esac<br>

<br>
<br>
<br>
The make debugging output is not immediately enlightening, but provides som=
e hints.<br>
<br>
budb_server (???) depends on ${TOP_INCDIR}/afs/budb_client.<u></u>h depends=
 on budb_client.h depends on budb_errs.c depends on <a href=3D"http://budb_=
errs.et" target=3D"_blank">budb_errs.et</a>. Yet budb_errs.c has been gener=
ated from the rule for budb_errs.h (${COMPILE_ET} -p ${srcdir} budb_errs) a=
nd is up-to-date, so make&#39;s internal bookkeeping sees the empty rule to=
 make budb_client.h from budb_errs.c, claims succes (I don&#39;t see this i=
n the debugging log, though?!) and tries to install the header.<br>

<br>
The problem seems to stem from there being two calls to compile_et using <a=
 href=3D"http://budb_errs.et" target=3D"_blank">budb_errs.et</a>, one of wh=
ich makes budb_errs.h and the other which makes budb_client.h. =A0Swapping =
the order in which the multiple targets are split out, so that budb_errs.c =
depends on budb_client.h which is made via compile_et, lets my build finish=
 here, but it&#39;s probably not the best solution.<br>

<br>
Is there reason to not make a budb_client.h that is the contents of budb_cl=
ient.p.h with #include &lt;budb_errs.h&gt; added? =A0Alternately we could p=
rocess the template manually with the shell.<br>
<br>
[tbudb has the same issue]<br>
<br>
-Ben<br></blockquote></div><br>Sounds like we want commit 0d0b5048a5b68d407=
9b13609775f9234183d1947 from master?<br><br>Marc<br>

--f46d04389349cd192204d62a9a29--