Re: pg_regress inputdir - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pg_regress inputdir
Date
Msg-id 20080730141428.GA3977@alvh.no-ip.org
Whole thread Raw
In response to Re: pg_regress inputdir  (Jorgen Austvik - Sun Norway <Jorgen.Austvik@Sun.COM>)
Responses Re: pg_regress inputdir
List 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
--inputdir.

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                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Type Categories for User-Defined Types
Next
From: Tom Lane
Date:
Subject: Re: Type Categories for User-Defined Types