On 2023-01-18 We 14:32, Tom Lane wrote: > One more thing before we move on from this topic. I'd been testing > modified versions of the AdjustUpgrade.pm logic by building from a > --from-source source tree, which seemed way easier than dealing > with a private git repo. As it stands, TestUpgradeXversion.pm > refuses to run under $from_source, but I just diked that check out > and it seemed to work fine for my purposes. Now, that's going to be > a regular need going forward, so I'd like to not need a hacked version > of the BF client code to do it. > > Also, your committed version of TestUpgradeXversion.pm breaks that > use-case because you did > > - unshift(@INC, "$self->{pgsql}/src/test/perl"); > + unshift(@INC, "$self->{buildroot}/$this_branch/pgsql/src/test/perl"); > > which AFAICS is an empty directory in a $from_source run. > > I suppose that the reason for not running under $from_source is to > avoid corrupting the saved installations with unofficial versions. > However, couldn't we skip the "save" step and still run the upgrade > tests against whatever we have saved? (Maybe skip the same-version > test, as it's not quite reflecting any real case then.) > > Here's a quick draft patch showing what I have in mind. There may > well be a better way to deal with the wheres-the-source issue than > what is in hunk 2. Also, I didn't reindent the unchanged code in > sub installcheck, and I didn't add anything about skipping > same-version tests.
No that won't work if we're using vpath builds (which was why I changed it from what you had). $self->{pgsql} is always the build directory. Something like this should do it: my $source_tree = $from_source || "$self->{buildroot}/$this_branch/pgsql"; cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com