summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJoão Reis <reis@janeasystems.com>2019-10-24 02:13:52 +0100
committerSam Roberts <vieuxtech@gmail.com>2019-10-25 11:35:01 -0700
commitd1d571e089e69bc9e3ae525012f6ec00da3a0ab8 (patch)
treeac1fb4414866c3beb0a6764285bc006a0f098d07 /tools
parentb2ccbb27dc98dfd771d7d5592e139e2001baa56c (diff)
downloadandroid-node-v8-d1d571e089e69bc9e3ae525012f6ec00da3a0ab8.tar.gz
android-node-v8-d1d571e089e69bc9e3ae525012f6ec00da3a0ab8.tar.bz2
android-node-v8-d1d571e089e69bc9e3ae525012f6ec00da3a0ab8.zip
build: vcbuild uses default Python, not Py2
vcbuild now searches for the first python.exe found, and uses it, where it used to look for Python 2 first. PR-URL: https://github.com/nodejs/node/pull/30091 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/msvs/find_python.cmd52
1 files changed, 1 insertions, 51 deletions
diff --git a/tools/msvs/find_python.cmd b/tools/msvs/find_python.cmd
index 728eeb405b..671fcbd7e5 100644
--- a/tools/msvs/find_python.cmd
+++ b/tools/msvs/find_python.cmd
@@ -3,27 +3,6 @@
echo Looking for Python
setlocal enabledelayedexpansion
-:: To remove the preference for Python 2, but still support it, just remove
-:: the 5 blocks marked with "Python 2:" and the support warnings
-
-:: Python 2: If python.exe is in %Path%, use if it's Python 2
-FOR /F "delims=" %%a IN ('where python.exe 2^> NUL') DO (
- SET need_path=0
- SET p=%%~dpa
- CALL :validate-v2
- IF NOT ERRORLEVEL 1 GOTO :found-python2
- GOTO :done-path-v2
-)
-:done-path-v2
-
-:: Python 2: Query the 3 locations mentioned in PEP 514 for a python2 InstallPath
-FOR %%K IN ( "HKCU\Software", "HKLM\SOFTWARE", "HKLM\Software\Wow6432Node") DO (
- SET need_path=1
- CALL :find-versions-v2 %%K
- IF NOT ERRORLEVEL 1 CALL :validate-v2
- IF NOT ERRORLEVEL 1 GOTO :found-python2
-)
-
:: Use python.exe if in %PATH%
set need_path=0
for /f "delims=" %%a in ('where python.exe 2^> nul') do (
@@ -41,14 +20,6 @@ for %%k in ( "HKCU\Software", "HKLM\SOFTWARE", "HKLM\Software\Wow6432Node") do (
goto :no-python
-:: Python 2: Find Python 2 installations in a registry location
-:find-versions-v2
-for /f "delims=" %%a in ('reg query "%~1\Python\PythonCore" /f * /k 2^> nul ^| findstr /r ^^HK ^| findstr "\\2\."') do (
- call :read-installpath %%a
- if not errorlevel 1 exit /b 0
-)
-exit /b 1
-
:: Find Python installations in a registry location
:find-versions
for /f "delims=" %%a in ('reg query "%~1\Python\PythonCore" /f * /k 2^> nul ^| findstr /r ^^HK') do (
@@ -73,32 +44,11 @@ for /f "skip=2 tokens=1* delims=)" %%a in ('reg query "%1\InstallPath" /ve /t RE
)
exit /b 1
-
-:: Python 2: Check if %p% holds a path to a real python2 executable
-:validate-v2
-IF NOT EXIST "%p%\python.exe" EXIT /B 1
-:: Check if %p% is python2
-"%p%\python.exe" -V 2>&1 | findstr /R "^Python.2.*" > NUL
-EXIT /B %ERRORLEVEL%
-
-
-:: Python 2:
-:found-python2
-echo Python 2 found in %p%\python.exe
-set pyver=2
-goto :done
-
:found-python
echo Python found in %p%\python.exe
-echo WARNING: Python 3 is not yet fully supported, to avoid issues Python 2 should be installed.
-set pyver=3
-goto :done
-
-:done
endlocal ^
& set "pt=%p%" ^
- & set "need_path_ext=%need_path%" ^
- & set "VCBUILD_PYTHON_VERSION=%pyver%"
+ & set "need_path_ext=%need_path%"
set "VCBUILD_PYTHON_LOCATION=%pt%\python.exe"
if %need_path_ext%==1 set "PATH=%pt%;%PATH%"
set "pt="