automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: false positive result with 'make distcheck'


From: Ralf Wildenhues
Subject: Re: false positive result with 'make distcheck'
Date: Tue, 5 Sep 2006 18:17:20 +0200
User-agent: Mutt/1.5.13 (2006-09-01)

Hello Guillaume,

* Guillaume Rousse wrote on Tue, Sep 05, 2006 at 05:53:59PM CEST:
> Ralf Wildenhues wrote:
> > Could you make a tarball exposing the bug you see available?
> http://www.zarb.org/~guillomovitch/rpmbuildupdate-0.7.tar.gz

Thanks.  What an interesting failure.  See more below.

> > Some minor nits:
*snip*
> In that particular case, I'm not sure a rpm-handling software is really
> useful elsewhere as Linux, but anyway this is good to know. Thanks for
> the tips.

Would you believe when I told you that I added those warnings rather
mechanically, without ever thinking, and only noticed after sending
that those names had "rpm" all stuck over them?

But what's even more funny, would you believe that my nits actually had
to do with the issue you are seeing?

I took these steps to reproduce the issue (`make' is GNU make):
  wget http://www.zarb.org/~guillomovitch/rpmbuildupdate-0.7.tar.gz
  gzip -dc rpmbuildupdate-0.7.tar.gz | tar xf -
  cd rpmbuildupdate-0.7
  touch rpmbuildupdate.comp.in rpmbuildupdate.in
  ./configure
  make distcheck

With this, distcheck passes, but it should have failed.
Glancing over its output, we see this:

|           && ../configure --srcdir=.. --prefix="$dc_install_base" \
|              \
|           && make  \
[...]
| checking for a BSD-compatible install... /usr/bin/install -c
| checking whether build environment is sane... yes
| checking for gawk... gawk
| checking whether make sets $(MAKE)... yes
| configure: creating ./config.status
| config.status: creating Makefile
| make[1]: Entering directory 
`/tmp/rpmbuildupdate-0.7/rpmbuildupdate-0.7/_build'
| perl -pi -e 
s'|address@hidden@|/tmp/rpmbuildupdate-0.7/rpmbuildupdate-0.7/_inst/etc|' < 
../../rpmbuildupdate.in > rpmbuildupdate
| perl -pi -e 
s'|address@hidden@|/tmp/rpmbuildupdate-0.7/rpmbuildupdate-0.7/_inst/etc|' < 
../../rpmbuildupdate.comp.in > rpmbuildupdate.comp

What happened?  Let's remember the rules you are using are these:

>>> rpmbuildupdate: $(srcdir)/rpmbuildupdate.in
>>>      perl -pi -e s'|address@hidden@|$(sysconfdir)|' < $< > $@
>>>
>>> rpmbuildupdate.comp: $(srcdir)/rpmbuildupdate.comp.in
>>>      perl -pi -e s'|address@hidden@|$(sysconfdir)|' < $< > $@

Now, even when you stick "$(srcdir)/" in front of the prerequisites,
still VPATH searching applies.  Since source tree of the distcheck
source (that below /tmp/rpmbuildupdate-0.7/rpmbuildupdate-0.7) does
not contain the *.in files, but VPATH contains "..", the `make' executed
inside the directory /tmp/rpmbuildupdate-0.7/_build finds the file
  ../../rpmbuildupdate.in.in

and happily uses them; that is: the second "../" is your "$(srcdir)/",
and the first "../" is the result from make's VPATH search.

Was this understandable?


Two ways to get out of this:
- do not stick $(srcdir)/ in front of the prerequisites.  For example,
  this should work portably (if you take care not to stick $(srcdir)/
  elsewhere before the *.in files):

rpmbuildupdate: rpmbuildupdate.in
        perl -pi -e s'|address@hidden@|$(sysconfdir)|' \
          < $(srcdir)/rpmbuildupdate.in > $@

rpmbuildupdate.comp: rpmbuildupdate.comp.in
        perl -pi -e s'|address@hidden@|$(sysconfdir)|' \
          < $(srcdir)/rpmbuildupdate.comp.in > $@

(Note that even Solaris make would not VPATH-rewrite the rule, since the
string `rpmbuildupdate.in' is not surrounded by white space in the rule.)

- Try issing distcheck from a VPATH build itself.  For example,
  after the exact steps printed at the beginning of this mail, do:

    make distclean  # needed so configure from VPATH will not complain
    mkdir ../build
    cd ../build
    ../rpmbuildupdate-0.7/configure
    make distcheck  # fails

Hope this helps.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]