From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Date: Thu, 5 Oct 2017 21:09:30 +0000 (-0700)
Subject: [3.6] bpo-31523: Reliability improvements to the Windows build files (GH-3900) (...
X-Git-Tag: v3.6.4rc1~183
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=051295a8c57cc649fa5eaa43526143984a147411;p=python
[3.6] bpo-31523: Reliability improvements to the Windows build files (GH-3900) (#3902)
(cherry picked from commit 2084b30e540d88b9fc752c5bdcc2f24334af4f2b)
---
diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props
index 3d46a0fcba..5a2da998c3 100644
--- a/PCbuild/pyproject.props
+++ b/PCbuild/pyproject.props
@@ -6,7 +6,7 @@
$(BuildPath)
$(OutDir)\
$(MSBuildThisFileDirectory)obj\
- $(Py_IntDir)\$(ArchName)_$(Configuration)\$(ProjectName)\
+ $(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)_$(Configuration)\$(ProjectName)\
$(ProjectName)
$(TargetName)$(PyDebugExt)
false
diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props
index 60abba1f7b..6109599108 100644
--- a/Tools/msi/msi.props
+++ b/Tools/msi/msi.props
@@ -48,7 +48,7 @@
- $(Py_IntDir)\$(Configuration)_$(Platform)_Setup\$(OutputName)
+ $(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)_$(Configuration)\msi_$(OutputName)
$(IntermediateOutputPath)_$(OutputSuffix)
$(BuildPath)
$(OutputPath)\
diff --git a/Tools/msi/purge.py b/Tools/msi/purge.py
index 76dbc49ae8..24fdae2438 100644
--- a/Tools/msi/purge.py
+++ b/Tools/msi/purge.py
@@ -25,7 +25,7 @@ except LookupError:
sys.exit(1)
URL = "https://www.python.org/ftp/python/{}/".format(m.group(1))
-
+REL = m.group(2) or ''
FILES = [
"core.msi",
@@ -64,7 +64,7 @@ PATHS = [
"python-{}-webinstall.exe".format(m.group(0)),
"python-{}-amd64.exe".format(m.group(0)),
"python-{}-amd64-webinstall.exe".format(m.group(0)),
-] + ["win32{}/{}".format(m.group(2), f) for f in FILES] + ["amd64{}/{}".format(m.group(2), f) for f in FILES]
+] + ["win32{}/{}".format(REL, f) for f in FILES] + ["amd64{}/{}".format(REL, f) for f in FILES]
print('Purged:')
for n in PATHS:
diff --git a/Tools/msi/uploadrelease.bat b/Tools/msi/uploadrelease.bat
index 6441db9ee6..d9dcc7a09e 100644
--- a/Tools/msi/uploadrelease.bat
+++ b/Tools/msi/uploadrelease.bat
@@ -8,8 +8,9 @@ set HOST=
set USER=
set TARGET=
set DRYRUN=false
+set NOUPLOAD=
set NOGPG=
-set PURGE_OPTION=/p:Purge=true
+set NOPURGE=
set NOTEST=
:CheckOpts
@@ -21,8 +22,9 @@ if "%1" EQU "--user" (set USER=%~2) && shift && shift && goto CheckOpts
if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts
if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts
if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts
+if "%1" EQU "--skip-upload" (set NOUPLOAD=true) && shift && goto CheckOpts
if "%1" EQU "--skip-gpg" (set NOGPG=true) && shift && goto CheckOpts
-if "%1" EQU "--skip-purge" (set PURGE_OPTION=) && shift && goto CheckOpts
+if "%1" EQU "--skip-purge" (set NOPURGE=true) && shift && goto CheckOpts
if "%1" EQU "--skip-test" (set NOTEST=true) && shift && goto CheckOpts
if "%1" EQU "-T" (set NOTEST=true) && shift && goto CheckOpts
if "%1" NEQ "" echo Unexpected argument "%1" & exit /B 1
@@ -52,17 +54,43 @@ if defined NOGPG (
call "%PCBUILD%find_msbuild.bat" %MSBUILD%
if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
pushd "%D%"
-%MSBUILD% /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86 %PURGE_OPTION%
-%MSBUILD% /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false %PURGE_OPTION%
+if not defined NOUPLOAD (
+ %MSBUILD% /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86
+ if errorlevel 1 goto :failed
+ %MSBUILD% /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false
+ if errorlevel 1 goto :failed
+)
+if not defined NOPURGE (
+ %MSBUILD% /v:m /nologo uploadrelease.proj /t:Purge
+)
if not defined NOTEST (
- %MSBUILD% /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x86
- %MSBUILD% /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x64
+ call :test x86
+ if errorlevel 1 goto :failed
+ call :test x64
+ if errorlevel 1 goto :failed
)
%MSBUILD% /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86
+if errorlevel 1 goto :failed
%MSBUILD% /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false
+if errorlevel 1 goto :failed
+
popd
exit /B 0
+:test
+%MSBUILD% /v:m /nologo uploadrelease.proj /t:Test /p:Platform=%1
+if errorlevel 1 (
+ echo Test failed - purging and retrying
+ %MSBUILD% /v:m /nologo uploadrelease.proj /t:Purge
+ if errorlevel 1 exit /B
+ %MSBUILD% /v:m /nologo uploadrelease.proj /t:Test /p:Platform=%1
+)
+exit /B
+
+:failed
+popd
+exit /B
+
:Help
echo uploadrelease.bat --host HOST --user USERNAME [--target TARGET] [--dry-run] [-h]
echo.
diff --git a/Tools/msi/uploadrelease.proj b/Tools/msi/uploadrelease.proj
index 75840f2f85..881b825e10 100644
--- a/Tools/msi/uploadrelease.proj
+++ b/Tools/msi/uploadrelease.proj
@@ -10,7 +10,6 @@
true
true
false
- false
@@ -43,7 +42,8 @@
-
+
%(File.CopyTo)
@@ -52,23 +52,15 @@
-
+
+
+
-
-
-
-
-
-
+
+
+
@@ -82,6 +74,7 @@ echo." />
$(OutputPath)\%(Filename)_layoutlog\%(Filename).log
+
@@ -95,14 +88,22 @@ echo." />
-
+
+
+
+
+
+
+
+
+