Thread

  1. make check in contrib

    Peter Eisentraut <peter_e@gmx.net> — 2011-04-24T23:18:18Z

    I noticed again that make check in contrib doesn't work, so here is a
    patch to fix it.  Perhaps someone wants to fill in the Windows support
    for it.  Naturally, this works only for contrib itself, not for external
    packages that use pgxs.
    
    A secondary issue that actually led to this:  I was preparing a Debian
    package for some module^Wextension^W^Hthing that uses pgxs.  The Debian
    packaging tools ("dh", to be exact, for the insiders) have this
    convenience that by default they examine your makefile and execute the
    standard targets, if found, in order.  So it runs make all, make check,
    which then fails because of
    
    check:
    	@echo "'make check' is not supported."
    	@echo "Do 'make install', then 'make installcheck' instead."
    	@exit 1
    
    You can override this, but it still means that everyone who packages an
    extension will have to re-figure this out.
    
    So while this message might be moderately useful (although I'm not sure
    whether it's guaranteed that the suggestion will always work), I'd
    rather get rid of it and not have a check target in the pgxs case.
    
    Comments?
    
  2. Re: make check in contrib

    Robert Haas <robertmhaas@gmail.com> — 2011-04-25T12:53:37Z

    On Sun, Apr 24, 2011 at 7:18 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
    > I noticed again that make check in contrib doesn't work, so here is a
    > patch to fix it.  Perhaps someone wants to fill in the Windows support
    > for it.  Naturally, this works only for contrib itself, not for external
    > packages that use pgxs.
    >
    > A secondary issue that actually led to this:  I was preparing a Debian
    > package for some module^Wextension^W^Hthing that uses pgxs.  The Debian
    > packaging tools ("dh", to be exact, for the insiders) have this
    > convenience that by default they examine your makefile and execute the
    > standard targets, if found, in order.  So it runs make all, make check,
    > which then fails because of
    >
    > check:
    >        @echo "'make check' is not supported."
    >        @echo "Do 'make install', then 'make installcheck' instead."
    >        @exit 1
    >
    > You can override this, but it still means that everyone who packages an
    > extension will have to re-figure this out.
    >
    > So while this message might be moderately useful (although I'm not sure
    > whether it's guaranteed that the suggestion will always work), I'd
    > rather get rid of it and not have a check target in the pgxs case.
    
    I think it might be more useful to have a check target that actually
    succeeds, even if it does nothing useful.  The argument that no check
    target at all is more useful than a check target that fails with a
    reasonably informative error message seems week to me.  It's only
    going to be true if - as in the case you mention - external software
    is directly inspecting the makefile to figure out what to do.  And
    that's a pretty weird case to optimize for.
    
    Maybe just change @exit 1 to @exit 0 and call it good?
    
    -- 
    Robert Haas
    EnterpriseDB: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company
    
    
  3. Re: make check in contrib

    Andrew Dunstan <andrew@dunslane.net> — 2011-04-25T13:21:20Z

    
    On 04/25/2011 08:53 AM, Robert Haas wrote:
    > The argument that no check
    > target at all is more useful than a check target that fails with a
    > reasonably informative error message seems week to me.
    
    +1 (weak too)
    
    cheers
    
    andrew
    
    
  4. Re: make check in contrib

    Tom Lane <tgl@sss.pgh.pa.us> — 2011-04-25T14:21:22Z

    Robert Haas <robertmhaas@gmail.com> writes:
    > On Sun, Apr 24, 2011 at 7:18 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
    >> I noticed again that make check in contrib doesn't work, so here is a
    >> patch to fix it.
    
    > I think it might be more useful to have a check target that actually
    > succeeds, even if it does nothing useful.
    
    That argument seems a bit irrelevant to the proposed patch.
    
    			regards, tom lane
    
    
  5. Re: make check in contrib

    Robert Haas <robertmhaas@gmail.com> — 2011-04-25T15:16:13Z

    On Mon, Apr 25, 2011 at 10:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
    > Robert Haas <robertmhaas@gmail.com> writes:
    >> On Sun, Apr 24, 2011 at 7:18 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
    >>> I noticed again that make check in contrib doesn't work, so here is a
    >>> patch to fix it.
    >
    >> I think it might be more useful to have a check target that actually
    >> succeeds, even if it does nothing useful.
    >
    > That argument seems a bit irrelevant to the proposed patch.
    
    How so?
    
    -- 
    Robert Haas
    EnterpriseDB: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company
    
    
  6. Re: make check in contrib

    Tom Lane <tgl@sss.pgh.pa.us> — 2011-04-25T15:22:49Z

    Robert Haas <robertmhaas@gmail.com> writes:
    > On Mon, Apr 25, 2011 at 10:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
    >> Robert Haas <robertmhaas@gmail.com> writes:
    >>> On Sun, Apr 24, 2011 at 7:18 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
    >>>> I noticed again that make check in contrib doesn't work, so here is a
    >>>> patch to fix it.
    
    >>> I think it might be more useful to have a check target that actually
    >>> succeeds, even if it does nothing useful.
    
    >> That argument seems a bit irrelevant to the proposed patch.
    
    > How so?
    
    The proposed patch is to fix it, not remove it.  Surely that's more
    useful than a no-op target.
    
    			regards, tom lane
    
    
  7. Re: make check in contrib

    Robert Haas <robertmhaas@gmail.com> — 2011-04-25T15:43:53Z

    On Mon, Apr 25, 2011 at 11:22 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
    > Robert Haas <robertmhaas@gmail.com> writes:
    >> On Mon, Apr 25, 2011 at 10:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
    >>> Robert Haas <robertmhaas@gmail.com> writes:
    >>>> On Sun, Apr 24, 2011 at 7:18 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
    >>>>> I noticed again that make check in contrib doesn't work, so here is a
    >>>>> patch to fix it.
    >
    >>>> I think it might be more useful to have a check target that actually
    >>>> succeeds, even if it does nothing useful.
    >
    >>> That argument seems a bit irrelevant to the proposed patch.
    >
    >> How so?
    >
    > The proposed patch is to fix it, not remove it.  Surely that's more
    > useful than a no-op target.
    
    Oh, that's different... never mind.
    
    -- 
    Robert Haas
    EnterpriseDB: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company
    
    
  8. Re: make check in contrib

    Peter Eisentraut <peter_e@gmx.net> — 2011-04-25T17:06:10Z

    On mån, 2011-04-25 at 11:22 -0400, Tom Lane wrote:
    > Robert Haas <robertmhaas@gmail.com> writes:
    > > On Mon, Apr 25, 2011 at 10:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
    > >> Robert Haas <robertmhaas@gmail.com> writes:
    > >>> On Sun, Apr 24, 2011 at 7:18 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
    > >>>> I noticed again that make check in contrib doesn't work, so here is a
    > >>>> patch to fix it.
    > 
    > >>> I think it might be more useful to have a check target that actually
    > >>> succeeds, even if it does nothing useful.
    > 
    > >> That argument seems a bit irrelevant to the proposed patch.
    > 
    > > How so?
    > 
    > The proposed patch is to fix it, not remove it.  Surely that's more
    > useful than a no-op target.
    
    The proposed patch will support make check for contrib modules, but not
    for external users of pgxs.
    
    
    
  9. Re: make check in contrib

    Tom Lane <tgl@sss.pgh.pa.us> — 2011-04-25T17:12:11Z

    Peter Eisentraut <peter_e@gmx.net> writes:
    > On mn, 2011-04-25 at 11:22 -0400, Tom Lane wrote:
    >> The proposed patch is to fix it, not remove it.  Surely that's more
    >> useful than a no-op target.
    
    > The proposed patch will support make check for contrib modules, but not
    > for external users of pgxs.
    
    So what will happen if an external user tries it?  What happens now?
    
    			regards, tom lane
    
    
  10. Re: make check in contrib

    Peter Eisentraut <peter_e@gmx.net> — 2011-04-25T17:43:39Z

    On mån, 2011-04-25 at 13:12 -0400, Tom Lane wrote:
    > Peter Eisentraut <peter_e@gmx.net> writes:
    > > On mån, 2011-04-25 at 11:22 -0400, Tom Lane wrote:
    > >> The proposed patch is to fix it, not remove it.  Surely that's more
    > >> useful than a no-op target.
    > 
    > > The proposed patch will support make check for contrib modules, but not
    > > for external users of pgxs.
    > 
    > So what will happen if an external user tries it?  What happens now?
    
    Now:
    
    $ make check
    'make check' is not supported.
    Do 'make install', then 'make installcheck' instead.
    make: *** [check] Error 1
    
    If we removed that, then it would be:
    
    make: Nothing to be done for `check'.
    [exit 0]
    
    Hmm, I'm slightly surprised by the latter behavior, but it's the case
    that since "check" is a global phony target, if you don't provide
    commands for it, it will just do nothing and succeed.
    
    Since some people didn't like removing the hint about "installcheck",
    I'd suggest just removing the "exit 1", which should then be pretty
    consistent overall.
    
    
    
    
  11. Re: make check in contrib

    Tom Lane <tgl@sss.pgh.pa.us> — 2011-04-25T17:52:16Z

    Peter Eisentraut <peter_e@gmx.net> writes:
    > Since some people didn't like removing the hint about "installcheck",
    > I'd suggest just removing the "exit 1", which should then be pretty
    > consistent overall.
    
    Works for me.
    
    			regards, tom lane