Handle spaces for Python install location in MSVC scripts
authorMichael Paquier <[email protected]>
Wed, 6 May 2020 12:08:31 +0000 (21:08 +0900)
committerMichael Paquier <[email protected]>
Wed, 6 May 2020 12:08:31 +0000 (21:08 +0900)
Attempting to use an installation path of Python that includes spaces
caused the MSVC builds to fail.  This fixes the issue by using the same
quoting method as ad7595b for OpenSSL.

Author: Victor Wagner
Discussion: https://postgr.es/m/20200430150608.6dc6b8c4@antares.wagner.home
Backpatch-through: 9.5

src/tools/msvc/Mkvcbuild.pm

index 93f364a9f2184fcfe8f646711730a7f3d8cf53aa..717730ac626d4d4bb4d8ff15edd17c5d73062485 100644 (file)
@@ -480,7 +480,7 @@ sub mkvcbuild
        my $pythonprog = "import sys;print(sys.prefix);"
          . "print(str(sys.version_info[0])+str(sys.version_info[1]))";
        my $prefixcmd =
-         $solution->{options}->{python} . "\\python -c \"$pythonprog\"";
+         qq("$solution->{options}->{python}\\python" -c "$pythonprog");
        my $pyout = `$prefixcmd`;
        die "Could not query for python version!\n" if $?;
        my ($pyprefix, $pyver) = split(/\r?\n/, $pyout);