pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Cc: peter_e@gmx.net
Subject: Re: contribcheck and modulescheck of MSVC's vcregress.pl cannot work independently
Date: Sat, 25 Jul 2015 17:50:03 -0400
Message-ID: <20150725215003.GD1452488@tornado.leadboat.com> (raw)
In-Reply-To: <CAB7nPqSBEUtZQJeHoKAZjYcUs=T7Dyv56OYK5Ga9Eu2MbHmv=A@mail.gmail.com>
References: <CAB7nPqSa6dnSP0hPgC53tx+2xm_XnJKjzN08uy6R0zkQs8-aWg@mail.gmail.com>
	<20150704013754.GA878067@tornado.leadboat.com>
	<CAB7nPqT_iRYhYXD7WHGeRGA3-WjQHKEESNEOnDrCtiDB0A_o8Q@mail.gmail.com>
	<20150707050407.GA942800@tornado.leadboat.com>
	<CAB7nPqRzWTE5fz=HbcQ56sHvLeXmk7Pa8=L7uzevPfLsjvHCkg@mail.gmail.com>
	<20150712065758.GA1085189@tornado.leadboat.com>
	<CAB7nPqSBEUtZQJeHoKAZjYcUs=T7Dyv56OYK5Ga9Eu2MbHmv=A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On Sun, Jul 12, 2015 at 05:50:42AM -0700, Michael Paquier wrote:
> On Sun, Jul 12, 2015 at 3:57 PM, Noah Misch <noah@leadboat.com> wrote:
> > On Mon, Jul 06, 2015 at 11:53:58PM -0700, Michael Paquier wrote:
> > > Attached is a patch to revert to the pre-9.4 way of doing...
> >
> > This is a start.  Study "git diff REL9_4_STABLE src/tools/msvc/
> > vcregress.pl"
> > after applying it.  To give just one example of material left to revert, it
> > leaves two absolute-path "chdir" calls in a row.
> >
> 
> Then the attached I guess addresses your concerns..

It did not; that version moved the project from 5% done to 15% done, perhaps.
I redeveloped it for several more hours last weekend and today, and I plan to
commit the attached stack of patches.

nm

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments: download all (3 files, .tar.gz)

install-msvc-skip-temp-v1.patch (text/plain, 1.8K) download commit 44cc701 Author: Noah Misch <noah@leadboat.com> AuthorDate: Sat Jul 25 17:39:12 2015 -0400 Commit: Noah Misch <noah@leadboat.com> CommitDate: Sat Jul 25 17:39:12 2015 -0400 MSVC: Future-proof installation file skip logic. This code relied on knowing exactly where in the source tree temporary installations might appear. A reasonable hacker may not think to update this code when adding use of a temporary installation, making it fragile. Observe that commit 9fa8b0ee90c44c0f97d16bf65e94322988c94864 broke it unnoticed, and commit dcae5faccab64776376d354decda0017c648bb53 fixed it unnoticed. Back-patch to 9.5 only; use of temporary installations is unlikely to change in released versions. diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index b592f99..f955725 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -98,6 +98,9 @@ sub Install { wanted => sub { /^.*\.sample\z/s && push(@$sample_files, $File::Find::name); + + # Don't find files of in-tree temporary installations. + $_ eq 'share' and $File::Find::prune = 1; } }, @top_dir); @@ -152,6 +155,9 @@ sub Install { wanted => sub { /^(.*--.*\.sql|.*\.control)\z/s && push(@$pl_extension_files, $File::Find::name); + + # Don't find files of in-tree temporary installations. + $_ eq 'share' and $File::Find::prune = 1; } }, @pldirs); @@ -199,8 +205,6 @@ sub CopySetOfFiles print "Copying $what" if $what; foreach (@$flist) { - next if /regress/; # Skip temporary install in regression subdir - next if /ecpg.test/; # Skip temporary install in regression subdir my $tgt = $target . basename($_); print "."; lcopy($_, $tgt) || croak "Could not copy $_: $!\n";
path-dedup-vcregress-v1.patch (text/plain, 915B) download commit fe76c04 Author: Noah Misch <noah@leadboat.com> AuthorDate: Sat Jul 25 17:39:43 2015 -0400 Commit: Noah Misch <noah@leadboat.com> CommitDate: Sat Jul 25 17:39:43 2015 -0400 MSVC: Remove duplicate PATH entry in test harness. Back-patch to 9.5, where commit 4cb7d671fddc8855c8def2de51fb23df1c8ac0af introduced it. diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index 6196383..1a0ae67 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -50,7 +50,7 @@ copy("$Config/autoinc/autoinc.dll", "src/test/regress"); copy("$Config/regress/regress.dll", "src/test/regress"); copy("$Config/dummy_seclabel/dummy_seclabel.dll", "src/test/regress"); -$ENV{PATH} = "$topdir/$Config/libpq;$topdir/$Config/libpq;$ENV{PATH}"; +$ENV{PATH} = "$topdir/$Config/libpq;$ENV{PATH}"; my $schedule = shift; unless ($schedule)
revert-95-vcregress-v1.patch (text/plain, 5.8K) download commit b5277e2 (HEAD, master) Author: Noah Misch <noah@leadboat.com> AuthorDate: Sat Jul 25 17:40:04 2015 -0400 Commit: Noah Misch <noah@leadboat.com> CommitDate: Sat Jul 25 17:40:04 2015 -0400 MSVC: Revert most 9.5 changes to pre-9.5 vcregress.pl tests. The reverted changes did not narrow the semantic gap between the MSVC build system and the GNU make build system. For targets that run multiple suites, restore vcregress.pl to mimicking "make -k" rather than the "make -S" default. Lack of "-k" would be more burdensome than lack of "-S"; that affects both the pre-9.5 "contribcheck" target and the new "modulescheck" target. Keep changes reflecting contemporary changes to the GNU make build system, and keep updates to Makefile parsing. Keep the loss of --psqldir in "check" and "ecpgcheck" targets; it had been a no-op when used alongside --temp-install. No log message mentioned any of the reverted changes. Based on a germ by Michael Paquier. Back-patch to 9.5. diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index 1a0ae67..0d2f5ec 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -108,15 +108,12 @@ sub installcheck sub check { - chdir $startdir; - InstallTemp(); chdir "${topdir}/src/test/regress"; - my @args = ( - "${tmp_installdir}/bin/pg_regress", + "../../../$Config/pg_regress/pg_regress", "--dlpath=.", - "--bindir=${tmp_installdir}/bin", + "--bindir=", "--schedule=${schedule}_schedule", "--encoding=SQL_ASCII", "--no-locale", @@ -136,11 +133,9 @@ sub ecpgcheck exit $status if $status; InstallTemp(); chdir "$topdir/src/interfaces/ecpg/test"; - - $ENV{PATH} = "${tmp_installdir}/bin;${tmp_installdir}/lib;$ENV{PATH}"; $schedule = "ecpg"; my @args = ( - "${tmp_installdir}/bin/pg_regress_ecpg", + "../../../../$Config/pg_regress_ecpg/pg_regress_ecpg", "--bindir=", "--dbname=regress1,connectdb", "--create-role=connectuser,connectdb", @@ -156,14 +151,12 @@ sub ecpgcheck sub isolationcheck { - chdir $startdir; - - InstallTemp(); - chdir "${topdir}/src/test/isolation"; - + chdir "../isolation"; + copy("../../../$Config/isolationtester/isolationtester.exe", + "../../../$Config/pg_isolation_regress"); my @args = ( - "${tmp_installdir}/bin/pg_isolation_regress", - "--bindir=${tmp_installdir}/bin", + "../../../$Config/pg_isolation_regress/pg_isolation_regress", + "--bindir=../../../$Config/psql", "--inputdir=.", "--schedule=./isolation_schedule"); push(@args, $maxconn) if $maxconn; @@ -174,10 +167,7 @@ sub isolationcheck sub plcheck { - chdir $startdir; - - InstallTemp(); - chdir "${topdir}/src/pl"; + chdir "../../pl"; foreach my $pl (glob("*")) { @@ -214,8 +204,8 @@ sub plcheck "============================================================\n"; print "Checking $lang\n"; my @args = ( - "${tmp_installdir}/bin/pg_regress", - "--bindir=${tmp_installdir}/bin", + "../../../$Config/pg_regress/pg_regress", + "--bindir=../../../$Config/psql", "--dbname=pl_regression", @lang_args, @tests); system(@args); my $status = $? >> 8; @@ -230,7 +220,6 @@ sub subdircheck { my $subdir = shift; my $module = shift; - my $mstat = 0; if ( !-d "$module/sql" || !-d "$module/expected" @@ -277,24 +266,19 @@ sub subdircheck print "============================================================\n"; print "Checking $module\n"; my @args = ( - "${tmp_installdir}/bin/pg_regress", - "--bindir=${tmp_installdir}/bin", + "$topdir/$Config/pg_regress/pg_regress", + "--bindir=${topdir}/${Config}/psql", "--dbname=contrib_regression", @opts, @tests); system(@args); - my $status = $? >> 8; - $mstat ||= $status; chdir ".."; - - exit $mstat if $mstat; } sub contribcheck { - InstallTemp(); - chdir "$topdir/contrib"; + chdir "../../../contrib"; + my $mstat = 0; foreach my $module (glob("*")) { - # these configuration-based exclusions must match Install.pm next if ($module eq "uuid-ossp" && !defined($config->{uuid})); next if ($module eq "sslinfo" && !defined($config->{openssl})); @@ -305,26 +289,31 @@ sub contribcheck next if ($module eq "sepgsql"); subdircheck("$topdir/contrib", $module); + my $status = $? >> 8; + $mstat ||= $status; } + exit $mstat if $mstat; } sub modulescheck { - InstallTemp(); - chdir "$topdir/src/test/modules"; + chdir "../../../src/test/modules"; + my $mstat = 0; foreach my $module (glob("*")) { subdircheck("$topdir/src/test/modules", $module); + my $status = $? >> 8; + $mstat ||= $status; } + exit $mstat if $mstat; } - # Run "initdb", then reconfigure authentication. sub standard_initdb { return ( - system("${tmp_installdir}/bin/initdb", '-N') == 0 and system( - "${tmp_installdir}/bin/pg_regress", '--config-auth', + system('initdb', '-N') == 0 and system( + "$topdir/$Config/pg_regress/pg_regress", '--config-auth', $ENV{PGDATA}) == 0); } @@ -343,13 +332,14 @@ sub upgradecheck $ENV{PGPORT} ||= 50432; my $tmp_root = "$topdir/src/bin/pg_upgrade/tmp_check"; (mkdir $tmp_root || die $!) unless -d $tmp_root; - - InstallTemp(); + my $upg_tmp_install = "$tmp_root/install"; # unshared temp install + print "Setting up temp install\n\n"; + Install($upg_tmp_install, "all", $config); # Install does a chdir, so change back after that chdir $cwd; my ($bindir, $libdir, $oldsrc, $newsrc) = - ("$tmp_installdir/bin", "$tmp_installdir/lib", $topdir, $topdir); + ("$upg_tmp_install/bin", "$upg_tmp_install/lib", $topdir, $topdir); $ENV{PATH} = "$bindir;$ENV{PATH}"; my $data = "$tmp_root/data"; $ENV{PGDATA} = "$data.old"; @@ -488,6 +478,7 @@ sub InstallTemp { print "Setting up temp install\n\n"; Install("$tmp_installdir", "all", $config); + $ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}"; } sub usage

view thread (9+ messages)

Message-ID: <20150725215003.GD1452488@tornado.leadboat.com>
Permalink:  ../20150725215003.GD1452488@tornado.leadboat.com/
Also on:    postgresql.org/message-id/20150725215003.GD1452488@tornado.leadboat.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noah@leadboat.com, michael.paquier@gmail.com, andrew@dunslane.net, peter_e@gmx.net
  Subject: Re: contribcheck and modulescheck of MSVC's vcregress.pl cannot work independently
  In-Reply-To: <20150725215003.GD1452488@tornado.leadboat.com>
  References: <CAB7nPqSa6dnSP0hPgC53tx+2xm_XnJKjzN08uy6R0zkQs8-aWg@mail.gmail.com> <20150704013754.GA878067@tornado.leadboat.com> <CAB7nPqT_iRYhYXD7WHGeRGA3-WjQHKEESNEOnDrCtiDB0A_o8Q@mail.gmail.com> <20150707050407.GA942800@tornado.leadboat.com> <CAB7nPqRzWTE5fz=HbcQ56sHvLeXmk7Pa8=L7uzevPfLsjvHCkg@mail.gmail.com> <20150712065758.GA1085189@tornado.leadboat.com> <CAB7nPqSBEUtZQJeHoKAZjYcUs=T7Dyv56OYK5Ga9Eu2MbHmv=A@mail.gmail.com> <20150725215003.GD1452488@tornado.leadboat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox