Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZJ7Ko-0002ry-O7 for pgsql-bugs@arkaria.postgresql.org; Sat, 25 Jul 2015 21:50:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZJ7Kn-0006xW-OK for pgsql-bugs@arkaria.postgresql.org; Sat, 25 Jul 2015 21:50:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZJ7Kl-0006x7-N4 for pgsql-bugs@postgresql.org; Sat, 25 Jul 2015 21:50:19 +0000 Received: from mail-pd0-x234.google.com ([2607:f8b0:400e:c02::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZJ7Kc-00071E-T9 for pgsql-bugs@postgresql.org; Sat, 25 Jul 2015 21:50:18 +0000 Received: by pdrg1 with SMTP id g1so30779316pdr.2 for ; Sat, 25 Jul 2015 14:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=orLje9dMbyk0Aw5Bb7R1hSu+wAEKpezy7y7aL0EAaCo=; b=UBo4Sfbte/8F7lCGRheYgcf17Z2nuszrB3iJjqn6I5yjGowoPQzq+YalIJbjEQrksh jj/tfn1IdWLwsSoPoxBsFo7+mb7AquuYO4ywobin4WVGmmt7BrmpDkrit0eT8vcfADxF d83UgwqjVJlygfHXSYNo3BYXzAZ8nQD7BpRLY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=orLje9dMbyk0Aw5Bb7R1hSu+wAEKpezy7y7aL0EAaCo=; b=QIfp877ZwUjphcOdax1mi8I58X6EWNS1dHTpNM4xcTVenKyWfrf2rg6ntY+sM1tEzj 946xR/778d0BvUaDYAl2IhHSNifg9S8Jl7ox2D3Ee7z3/uN8gAZpWycSm7yInguZhDsd qvgi+x4V6d6BZEft6Bdw77PEPVbUEveo1xcgMeyAtMOwGptmtMhiPO2/OTuU5yfZZAQu U5vCvgDnfJ/zJk9ouFo9dEvm/x8vjMSePZ6a/ONTr15vMaALCO/ZEAoEEIpSSD1az9D0 7G72hDTqCnhS3in5Ihh1c4MDcx6f9pCc+6V0ehHA8EykPK7a5sXFoZPnLzRoAo5k8xLr Q6yg== X-Gm-Message-State: ALoCoQmt+L05YltwcA8rGqFtSmljaS0t5jpljqeovGlabeHg968ZIw3+dDI7lZ6ODVRC8D92Fahg X-Received: by 10.70.89.199 with SMTP id bq7mr47095607pdb.168.1437861006751; Sat, 25 Jul 2015 14:50:06 -0700 (PDT) Received: from tornado.leadboat.com (c-98-248-47-228.hsd1.ca.comcast.net. [98.248.47.228]) by smtp.gmail.com with ESMTPSA id q7sm21521174pdj.31.2015.07.25.14.50.05 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 25 Jul 2015 14:50:05 -0700 (PDT) Date: Sat, 25 Jul 2015 17:50:03 -0400 From: Noah Misch To: Michael Paquier Cc: Andrew Dunstan , PostgreSQL mailing lists , peter_e@gmx.net Subject: Re: contribcheck and modulescheck of MSVC's vcregress.pl cannot work independently Message-ID: <20150725215003.GD1452488@tornado.leadboat.com> References: <20150704013754.GA878067@tornado.leadboat.com> <20150707050407.GA942800@tornado.leadboat.com> <20150712065758.GA1085189@tornado.leadboat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="XF85m9dhOBO43t/C" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --XF85m9dhOBO43t/C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Jul 12, 2015 at 05:50:42AM -0700, Michael Paquier wrote: > On Sun, Jul 12, 2015 at 3:57 PM, Noah Misch 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 --XF85m9dhOBO43t/C Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="install-msvc-skip-temp-v1.patch" commit 44cc701 Author: Noah Misch AuthorDate: Sat Jul 25 17:39:12 2015 -0400 Commit: Noah Misch 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"; --XF85m9dhOBO43t/C Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="path-dedup-vcregress-v1.patch" commit fe76c04 Author: Noah Misch AuthorDate: Sat Jul 25 17:39:43 2015 -0400 Commit: Noah Misch 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) --XF85m9dhOBO43t/C Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="revert-95-vcregress-v1.patch" commit b5277e2 (HEAD, master) Author: Noah Misch AuthorDate: Sat Jul 25 17:40:04 2015 -0400 Commit: Noah Misch 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 --XF85m9dhOBO43t/C Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs --XF85m9dhOBO43t/C--