diff options
author | Steve Dower <steve.dower@microsoft.com> | 2018-02-18 02:59:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-18 02:59:03 (GMT) |
commit | 01423cb53b5662b363d2f1a5963eadfe951ef3e8 (patch) | |
tree | 51d62aa19d6ff0d865080974fe8e0a2052ff1aaf /PCbuild | |
parent | d6ff8a7037903497eff95fa32bdac2b6adf71505 (diff) | |
download | cpython-01423cb53b5662b363d2f1a5963eadfe951ef3e8.zip cpython-01423cb53b5662b363d2f1a5963eadfe951ef3e8.tar.gz cpython-01423cb53b5662b363d2f1a5963eadfe951ef3e8.tar.bz2 |
Improves the ability to build in CI (GH-5728)
Diffstat (limited to 'PCbuild')
-rw-r--r-- | PCbuild/find_python.bat | 6 | ||||
-rw-r--r-- | PCbuild/get_externals.bat | 4 | ||||
-rw-r--r-- | PCbuild/python.props | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/PCbuild/find_python.bat b/PCbuild/find_python.bat index ba3a0f5..17ce7ac 100644 --- a/PCbuild/find_python.bat +++ b/PCbuild/find_python.bat @@ -31,10 +31,10 @@ @if exist "%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe" (set PYTHON="%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe") & (set _Py_Python_Source=found in externals directory) & goto :found @rem If HOST_PYTHON is recent enough, use that -@if NOT "%HOST_PYTHON%"=="" @%HOST_PYTHON% -c "import sys; assert sys.version_info[:2] >= (3, 6)" >nul 2>nul && (set PYTHON="%HOST_PYTHON%") && (set _Py_Python_Source=found as HOST_PYTHON) && goto :found +@if NOT "%HOST_PYTHON%"=="" @%HOST_PYTHON% -Ec "import sys; assert sys.version_info[:2] >= (3, 6)" >nul 2>nul && (set PYTHON="%HOST_PYTHON%") && (set _Py_Python_Source=found as HOST_PYTHON) && goto :found @rem If py.exe finds a recent enough version, use that one -@py -3.6 -V >nul 2>&1 && (set PYTHON=py -3.6) && (set _Py_Python_Source=found with py.exe) && goto :found +@py -3.6 -EV >nul 2>&1 && (set PYTHON=py -3.6) && (set _Py_Python_Source=found with py.exe) && goto :found @if NOT exist "%_Py_EXTERNALS_DIR%" mkdir "%_Py_EXTERNALS_DIR%" @set _Py_NUGET=%NUGET% @@ -50,7 +50,7 @@ @rem If it fails, retry with any available copy of Python @powershell.exe -Command Invoke-WebRequest %_Py_NUGET_URL% -OutFile '%_Py_NUGET%' @if errorlevel 1 ( - @%_Py_HOST_PYTHON% "%~dp0\urlretrieve.py" "%_Py_NUGET_URL%" "%_Py_NUGET%" + @%_Py_HOST_PYTHON% -E "%~dp0\urlretrieve.py" "%_Py_NUGET_URL%" "%_Py_NUGET%" ) ) @echo Installing Python via nuget... diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index ed9ff75..e696f22 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -65,7 +65,7 @@ for %%e in (%libraries%) do ( git clone --depth 1 https://github.com/%ORG%/cpython-source-deps --branch %%e "%EXTERNALS_DIR%\%%e" ) else ( echo.Fetching %%e... - %PYTHON% "%PCBUILD%\get_external.py" -O %ORG% %%e + %PYTHON% -E "%PCBUILD%get_external.py" -O %ORG% -e "%EXTERNALS_DIR%" %%e ) ) @@ -84,7 +84,7 @@ for %%b in (%binaries%) do ( git clone --depth 1 https://github.com/%ORG%/cpython-bin-deps --branch %%b "%EXTERNALS_DIR%\%%b" ) else ( echo.Fetching %%b... - %PYTHON% "%PCBUILD%\get_external.py" -b -O %ORG% %%b + %PYTHON% -E "%PCBUILD%get_external.py" -b -O %ORG% -e "%EXTERNALS_DIR%" %%b ) ) diff --git a/PCbuild/python.props b/PCbuild/python.props index 39b7b8a..f943313 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -43,7 +43,9 @@ <BuildPath Condition="$(Configuration) == 'PGInstrument'">$(BuildPath)instrumented\</BuildPath> <!-- Directories of external projects. tcltk is handled in tcltk.props --> - <ExternalsDir>$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals\`))</ExternalsDir> + <ExternalsDir>$(EXTERNALS_DIR)</ExternalsDir> + <ExternalsDir Condition="$(ExternalsDir) == ''">$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`))</ExternalsDir> + <ExternalsDir Condition="!HasTrailingSlash($(ExternalsDir))">$(ExternalsDir)\</ExternalsDir> <sqlite3Dir>$(ExternalsDir)sqlite-3.21.0.0\</sqlite3Dir> <bz2Dir>$(ExternalsDir)bzip2-1.0.6\</bz2Dir> <lzmaDir>$(ExternalsDir)xz-5.2.2\</lzmaDir> |