]> granicus.if.org Git - python/commitdiff
Issue #28573: Avoid setting up env too many times during build
authorSteve Dower <steve.dower@microsoft.com>
Tue, 15 Nov 2016 00:13:56 +0000 (16:13 -0800)
committerSteve Dower <steve.dower@microsoft.com>
Tue, 15 Nov 2016 00:13:56 +0000 (16:13 -0800)
PCbuild/build.bat
Tools/msi/buildrelease.bat

index 88b1f060ab1f0470ed836f2f70770f7f6c7df310..ffcc197004331707514a454f9c440ff7a05b7b1f 100644 (file)
@@ -120,9 +120,9 @@ if "%do_pgo%"=="true" (
     @echo off\r
     call :Kill\r
     set conf=PGUpdate\r
+    set target=Build\r
 )\r
 goto Build\r
-\r
 :Kill\r
 echo on\r
 msbuild "%dir%\pythoncore.vcxproj" /t:KillPython %verbose%^\r
index e7d225d54975588618cce38ae6e2f580ca81bb2a..189bef22f2a49f1b0a988c253685d67917a911eb 100644 (file)
@@ -35,7 +35,7 @@ set BUILDX86=
 set BUILDX64=\r
 set TARGET=Rebuild\r
 set TESTTARGETDIR=\r
-set PGO=default\r
+set PGO=-m test -q --pgo\r
 set BUILDNUGET=1\r
 set BUILDZIP=1\r
 \r
@@ -109,14 +109,12 @@ exit /B 0
 @echo off\r
 \r
 if "%1" EQU "x86" (\r
-    call "%PCBUILD%env.bat" x86\r
     set PGO=\r
     set BUILD=%PCBUILD%win32\\r
     set BUILD_PLAT=Win32\r
     set OUTDIR_PLAT=win32\r
     set OBJDIR_PLAT=x86\r
 ) else (\r
-    call "%PCBUILD%env.bat" amd64\r
     set BUILD=%PCBUILD%amd64\\r
     set PGO=%~2\r
     set BUILD_PLAT=x64\r
@@ -143,37 +141,18 @@ if not "%CERTNAME%" EQU "" (
 )\r
 \r
 if not "%SKIPBUILD%" EQU "1" (\r
-    @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -d -t %TARGET% %CERTOPTS%\r
-    @if errorlevel 1 exit /B\r
-    @rem build.bat turns echo back on, so we disable it again\r
-    @echo off\r
-    \r
     if "%PGO%" EQU "" (\r
-        @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %CERTOPTS%\r
+        set PGOOPTS=\r
     ) else (\r
-        @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -c PGInstrument -t %TARGET% %CERTOPTS%\r
-        @if errorlevel 1 exit /B\r
-        \r
-        @del "%BUILD%*.pgc"\r
-        if "%PGO%" EQU "default" (\r
-            "%BUILD%python.exe" -m test -q --pgo\r
-        ) else if "%PGO%" EQU "default2" (\r
-            "%BUILD%python.exe" -m test -r -q --pgo\r
-            "%BUILD%python.exe" -m test -r -q --pgo\r
-        ) else if "%PGO%" EQU "default10" (\r
-            for /L %%i in (0, 1, 9) do "%BUILD%python.exe" -m test -q -r --pgo\r
-        ) else if "%PGO%" EQU "pybench" (\r
-            "%BUILD%python.exe" "%PCBUILD%..\Tools\pybench\pybench.py"\r
-        ) else (\r
-            "%BUILD%python.exe" %PGO%\r
-        )\r
-        \r
-        @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -c PGUpdate -t Build %CERTOPTS%\r
+        set PGOOPTS=--pgo --pgojob "%PGO%"\r
     )\r
+    @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %CERTOPTS% %PGOOPTS%\r
     @if errorlevel 1 exit /B\r
+    @rem build.bat turns echo back on, so we disable it again\r
     @echo off\r
 )\r
 \r
+call "%PCBUILD%env.bat"\r
 if "%OUTDIR_PLAT%" EQU "win32" (\r
     msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI%\r
     if errorlevel 1 exit /B\r
@@ -222,10 +201,9 @@ echo    --build (-b)        Incrementally build Python rather than rebuilding
 echo    --skip-build (-B)   Do not build Python (just do the installers)\r
 echo    --skip-doc (-D)     Do not build documentation\r
 echo    --pgo               Specify PGO command for x64 installers\r
-echo    --skip-pgo          Build x64 installers using PGO\r
+echo    --skip-pgo          Build x64 installers without using PGO\r
 echo    --skip-nuget        Do not build Nuget packages\r
 echo    --skip-zip          Do not build embeddable package\r
-echo    --pgo               Build x64 installers using PGO\r
 echo    --download          Specify the full download URL for MSIs\r
 echo    --test              Specify the test directory to run the installer tests\r
 echo    -h                  Display this help information\r
@@ -233,13 +211,8 @@ echo.
 echo If no architecture is specified, all architectures will be built.\r
 echo If --test is not specified, the installer tests are not run.\r
 echo.\r
-echo For the --pgo option, any Python command line can be used as well as the\r
-echo following shortcuts:\r
-echo     Shortcut        Description\r
-echo     default         Test suite with --pgo\r
-echo     default2        2x test suite with --pgo and randomized test order\r
-echo     default10       10x test suite with --pgo and randomized test order\r
-echo     pybench         pybench script\r
+echo For the --pgo option, any Python command line can be used, or 'default' to\r
+echo use the default task (-m test --pgo).\r
 echo.\r
 echo The following substitutions will be applied to the download URL:\r
 echo     Variable        Description         Example\r