Re: pgsql: Fix pg_isolation_regress to work outside its build directory. - Mailing list pgsql-committers

From Andres Freund
Subject Re: pgsql: Fix pg_isolation_regress to work outside its build directory.
Date
Msg-id 20131109141314.GA25959@alap2.anarazel.de
Whole thread Raw
In response to pgsql: Fix pg_isolation_regress to work outside its build directory.  (Robert Haas <rhaas@postgresql.org>)
Responses Re: pgsql: Fix pg_isolation_regress to work outside its build directory.
List pgsql-committers
Hi,

On 2013-11-08 20:02:30 +0000, Robert Haas wrote:
> Fix pg_isolation_regress to work outside its build directory.

> This makes it possible to, for example, use the isolation tester to
> test a contrib module.

Unfortunately this isn't working all that well on anole and currawong :/.
Looking at the output on the former the reason becomes clear:
./pg_isolation_regress --temp-install=./tmp_check --inputdir=. --top-builddir=../../.. --schedule=./isolation_schedule
/usr/lib/hpux64/dld.so: Unable to find library 'libpq.so.5'.
sh: 15000 Killed

isolationtester doesn't find libpq during find_other_exec(). I think that is because it normally
only gets run when pg_regress.c has done:
        /*
         * Set up shared library paths to include the temp install.
         *
         * LD_LIBRARY_PATH covers many platforms.  DYLD_LIBRARY_PATH works on
         * Darwin, and maybe other Mach-based systems.    LIBPATH is for AIX.
         * Windows needs shared libraries in PATH (only those linked into
         * executables, not dlopen'ed ones). Feel free to account for others
         * as well.
         */
        add_to_path("LD_LIBRARY_PATH", ':', libdir);
        add_to_path("DYLD_LIBRARY_PATH", ':', libdir);
        add_to_path("LIBPATH", ':', libdir);
#if defined(WIN32)
        add_to_path("PATH", ';', libdir);
#elif defined(__CYGWIN__)
        add_to_path("PATH", ':', libdir);
#endif

but the initialization functions are run earlier:
    /*
     * We call the initialization function here because that way we can set
     * default parameters and let them be overwritten by the commandline.
     */
    ifunc(argc, argv);

The only hack I currently can think of is to store argv[0] in a global
variable and to run the find_other_exec() in the first run through
isolation_start_test() :/.

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-committers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value
Next
From: Robert Haas
Date:
Subject: pgsql: Fix ECPG compiler warning.