pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
msys2 vs pg_upgrade/test.sh
3+ messages / 2 participants
[nested] [flat]

* msys2 vs pg_upgrade/test.sh
@ 2019-09-08 22:06  Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Andrew Dunstan @ 2019-09-08 22:06 UTC (permalink / raw)
  To: pgsql-hackers


Diagnosing this took quite a lot of time and detective work. For some
reason I don't quite understand, when calling the Windows command
processor in a modern msys2/WindowsServer2019 installation, you need to
double the slash, thus:


    cmd //c foo.bat


Some Internet postings at least seem to suggest this is by design. (FSVO
"design")


I tested this on older versions and the change appears to work, so I
propose to apply the attached patch.


This is the last obstacle I have to declaring msys2 fully supportable.



cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

  [text/x-patch] pg_upgrade_msys2.patch (759B, ../../3227042f-cfcc-745a-57dd-fb8c471f8ddf@2ndQuadrant.com/2-pg_upgrade_msys2.patch)
  download | inline diff:
diff --git a/src/bin/pg_upgrade/test.sh b/src/bin/pg_upgrade/test.sh
index c9de4f8a7e..2d78f63f5e 100644
--- a/src/bin/pg_upgrade/test.sh
+++ b/src/bin/pg_upgrade/test.sh
@@ -244,8 +244,11 @@ esac
 
 pg_ctl start -l "$logdir/postmaster2.log" -o "$POSTMASTER_OPTS" -w
 
+# modern versions of msys/Windows require a double slash when calling
+# "cmd /c". This also works on older versions.
+
 case $testhost in
-	MINGW*)	cmd /c analyze_new_cluster.bat ;;
+	MINGW*)	cmd //c analyze_new_cluster.bat ;;
 	*)		sh ./analyze_new_cluster.sh ;;
 esac
 
@@ -258,7 +261,7 @@ if [ -n "$pg_dumpall2_status" ]; then
 fi
 
 case $testhost in
-	MINGW*)	cmd /c delete_old_cluster.bat ;;
+	MINGW*)	cmd //c delete_old_cluster.bat ;;
 	*)	    sh ./delete_old_cluster.sh ;;
 esac
 

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: msys2 vs pg_upgrade/test.sh
@ 2019-09-09 08:48  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Peter Eisentraut @ 2019-09-09 08:48 UTC (permalink / raw)
  To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>; pgsql-hackers

On 2019-09-09 00:06, Andrew Dunstan wrote:
> Diagnosing this took quite a lot of time and detective work. For some
> reason I don't quite understand, when calling the Windows command
> processor in a modern msys2/WindowsServer2019 installation, you need to
> double the slash, thus:
> 
>     cmd //c foo.bat
> 
> Some Internet postings at least seem to suggest this is by design. (FSVO
> "design")
> 
> I tested this on older versions and the change appears to work, so I
> propose to apply the attached patch.

If we're worried about messing things up for non-msys2 environments, we
could also set MSYS2_ARG_CONV_EXCL instead; see
<https://github.com/msys2/msys2/wiki/Porting#filesystem-namespaces;.
According to that page, that would seem to be the more proper way to do it.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: msys2 vs pg_upgrade/test.sh
@ 2019-09-09 12:39  Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Andrew Dunstan @ 2019-09-09 12:39 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers


On 9/9/19 4:48 AM, Peter Eisentraut wrote:
> On 2019-09-09 00:06, Andrew Dunstan wrote:
>> Diagnosing this took quite a lot of time and detective work. For some
>> reason I don't quite understand, when calling the Windows command
>> processor in a modern msys2/WindowsServer2019 installation, you need to
>> double the slash, thus:
>>
>>     cmd //c foo.bat
>>
>> Some Internet postings at least seem to suggest this is by design. (FSVO
>> "design")
>>
>> I tested this on older versions and the change appears to work, so I
>> propose to apply the attached patch.
> If we're worried about messing things up for non-msys2 environments, we
> could also set MSYS2_ARG_CONV_EXCL instead; see
> <https://github.com/msys2/msys2/wiki/Porting#filesystem-namespaces;.
> According to that page, that would seem to be the more proper way to do it.
>


Nice find, thanks, I'll do it that way.


cheers


andrew



-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-09-09 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-09-08 22:06 msys2 vs pg_upgrade/test.sh Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
2019-09-09 08:48 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2019-09-09 12:39   ` Andrew Dunstan <andrew.dunstan@2ndquadrant.com>

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