From 848b3af816872725d9b5332b26783d8284e653df Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Tue, 8 Aug 2023 02:14:55 +0300 Subject: [PATCH] MDEV-30836 MTR MSYS2 fix attempt MSYS2 is basically Cygwin, except it has more easy installation (but with tools which are not used) and it has some more control of path conversion via MSYS2_ARG_CONV_EXCL and MSYS2_ENV_CONV_EXCL. So it should be more Windows-friendly than Cygwin. Installation Similar to Cygwin, except installing patch requires additional command run from shell: pacman -S patch MSYS2 still doesn't work as it returns wierd "Bad address" when exec-ing forked process from create_process(). Same exec from standalone perl -e runs just fine... :( --- mysql-test/lib/My/Platform.pm | 8 +++++++- mysql-test/lib/My/SafeProcess.pm | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm index 15a08e38914..2b32ef87b81 100644 --- a/mysql-test/lib/My/Platform.pm +++ b/mysql-test/lib/My/Platform.pm @@ -23,7 +23,7 @@ use File::Path; use Carp; use base qw(Exporter); -our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL IS_AIX +our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX native_path posix_path mixed_path check_socket_path_length process_alive open_for_append); @@ -34,9 +34,15 @@ BEGIN { die "Could not execute 'cygpath': $!"; } eval 'sub IS_CYGWIN { 1 }'; + eval 'sub IS_MSYS { 0 }'; + } + elsif ($^O eq "msys") { + eval 'sub IS_CYGWIN { 1 }'; + eval 'sub IS_MSYS { 1 }'; } else { eval 'sub IS_CYGWIN { 0 }'; + eval 'sub IS_MSYS { 0 }'; } if ($^O eq "MSWin32") { eval 'sub IS_WIN32PERL { 1 }'; diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm index 69033649b46..e3b46b3709e 100644 --- a/mysql-test/lib/My/SafeProcess.pm +++ b/mysql-test/lib/My/SafeProcess.pm @@ -102,7 +102,7 @@ else # Find the safe process binary or script sub find_bin { - if (IS_WIN32PERL or IS_CYGWIN) + if (IS_WINDOWS) { # Use my_safe_process.exe my $exe= my_find_bin($bindir, ["lib/My/SafeProcess", "My/SafeProcess"],