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... :(
This commit is contained in:
Aleksey Midenkov 2023-08-08 02:14:55 +03:00 committed by Daniel Black
parent 640cd404af
commit 848b3af816
2 changed files with 8 additions and 2 deletions

View file

@ -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 }';

View file

@ -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"],