Skip site navigation (1) Skip section navigation (2)

Re: pg_regress inputdir

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Jorgen Austvik - Sun Norway <Jorgen(dot)Austvik(at)Sun(dot)COM>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_regress inputdir
Date: 2008-07-30 14:14:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Jorgen Austvik - Sun Norway wrote:
> Alvaro Herrera wrote:

>> I think this breaks VPATH builds in both letter and spirit. 
> Letter:
> --------8<---------------8<---------------8<---------------8<---------------8<---------------8<-------
> bash-3.2$ ggrep -R "\-\-inputdir" *
> src/test/regress/pg_regress.c:  printf(_("  --inputdir=DIR take input 
> files from DIR (default \".\")\n"));
> Binary file src/test/regress/pg_regress.o matches
> Binary file src/test/regress/pg_regress matches
> Binary file  
> src/test/regress/tmp_check/install/usr/local/pgsql/lib/pgxs/src/test/regress/pg_regress 
> matches
> --------8<---------------8<---------------8<---------------8<---------------8<---------------8<-------
> Since it is not used in PostgreSQL build (only default value - "."), I  
> have problems seeing how writing to e.g. "./sql/file" instead of writing  
> to "sql/file" could break anything. Please explain.

Well, that's exactly my point -- because in a normal build, it is only
passed as . but in a VPATH dir it is passed as the source dir (relative
or absolute path as when you invoked configure).

> Spirit:
> Nobody has ever accuse me of being spiritual ;-), but if you have a URI  
> that explains the VPATH spirit, I'd be interested to read about it.

The VPATH spirit is that generated files should reside in the build
directory, not in the source directory.  Try creating an empty directory
somewhere, cd'ing to that, and calling /path/to/pgsqlsource/configure.
In the resulting dir try "make installcheck" and see what is passed as

Hmm ... maybe I spoke too soon; I don't see --inputdir used anywhere.

> > Why do you need this anyway?
> I tried to explain that in the first mail, but let me try again.
> Use case:
> Running pg_regress outside of PostgreSQL build system. pg_regress is  
> installed in e.g. /usr/postgres/8.3/bin/, "input", "output", "sql" and  
> "expected" are installed in some other path, e.g.  
> /usr/postgres/8.3/share/test. User is in ~ and tries to run the  
> PostgreSQL regression tests. It doesn't work, in fact the only way to  
> make it work is to cd to the parent directory of "sql" and "expected".
> Today, using --inputdir in pg_regress does not work for any other value  
> than something that resolves to cwd, since it will write a file to  
> "./sql", but try to read the same file from "<inputdir>/sql".

Maybe I'm missing something, but I don't see any reason why this is a
scenario worth supporting.  What's the problem with cd'ing into the
directory containing the tests?

Alvaro Herrera                      
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2008-07-30 14:25:39
Subject: Re: Type Categories for User-Defined Types
Previous:From: Gregory StarkDate: 2008-07-30 10:08:54
Subject: Re: Type Categories for User-Defined Types

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group