Re: Repeated pg_upgrade buildfarm failures on binturon - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Repeated pg_upgrade buildfarm failures on binturon
Date
Msg-id 26168.1436282665@sss.pgh.pa.us
Whole thread Raw
In response to Re: Repeated pg_upgrade buildfarm failures on binturon  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> Given the last sentence in the POSIX 2008 text, I think unconditionally
> munging PWD as you're proposing is a bit risky.  What I suggest is that
> we add code to set PWD only if it's not set, which is most easily done
> in test.sh itself, along the lines of

>     # Very old shells may not set PWD for us.
>     if [ x"$PWD" = x"" ]; then
>       PWD=`pwd -P`
>     fi

Oh, wait, scratch that: the build logs you showed clearly indicate that
the test is running with temp_root set to
/export/home/pgfarmer/build-farm/tmp_check
which implies that PWD was not empty but "/export/home/pgfarmer/build-farm".
So the above wouldn't fix it.

A likely hypothesis is that the buildfarm script was invoked using some
modern shell that did set PWD, but then test.sh is being executed (in a
much lower directory) by some SUSv2-era shell that doesn't.

I'm still kind of afraid to explicitly change PWD in a modern shell,
though.  Perhaps the right thing is just not to rely on PWD at all
in test.sh, but replace $PWD with `pwd -P`.  (I did check that this
utility is required by SUSv2.)
        regards, tom lane



pgsql-hackers by date:

Previous
From: David Christensen
Date:
Subject: [PATCH] correct the initdb.log path for pg_regress
Next
From: Simon Riggs
Date:
Subject: Re: Freeze avoidance of very large table.