]> granicus.if.org Git - python/commitdiff
Issue #28573: Missing sys._mercurial info and other build issues.
authorSteve Dower <steve.dower@microsoft.com>
Tue, 22 Nov 2016 19:48:52 +0000 (11:48 -0800)
committerSteve Dower <steve.dower@microsoft.com>
Tue, 22 Nov 2016 19:48:52 +0000 (11:48 -0800)
PCbuild/pythoncore.vcxproj
Tools/msi/buildrelease.bat

index 963da89c4485fcf5cdfcc70c328c0b9324beb3cc..89415ae087358a3d3285bfe18222477f4c6a1bd9 100644 (file)
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
   <Target Name="_GetBuildInfo" BeforeTargets="PrepareForBuild">
-    <Exec Command="hg id -b &gt; &quot;$(IntDir)hgbranch.txt&quot;" ContinueOnError="true" />
-    <Exec Command="hg id -i &gt; &quot;$(IntDir)hgversion.txt&quot;" ContinueOnError="true" />
-    <Exec Command="hg id -t &gt; &quot;$(IntDir)hgtag.txt&quot;" ContinueOnError="true" />
+    <PropertyGroup>
+      <HG Condition="$(HG) == ''">hg</HG>
+      <_HG>$(HG)</_HG>
+      <_HG Condition="$(HG.Contains(` `))">"$(HG)"</_HG>
+    </PropertyGroup>
+    <Message Text="Getting build info from $(_HG)" Importance="high" />
+    <Exec Command="$(_HG) id -b &gt; &quot;$(IntDir)hgbranch.txt&quot;" ContinueOnError="true" />
+    <Exec Command="$(_HG) id -i &gt; &quot;$(IntDir)hgversion.txt&quot;" ContinueOnError="true" />
+    <Exec Command="$(_HG) id -t &gt; &quot;$(IntDir)hgtag.txt&quot;" ContinueOnError="true" />
     <PropertyGroup>
       <HgBranch Condition="Exists('$(IntDir)hgbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgbranch.txt').Trim())</HgBranch>
       <HgVersion Condition="Exists('$(IntDir)hgversion.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgversion.txt').Trim())</HgVersion>
       <HgTag Condition="Exists('$(IntDir)hgtag.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgtag.txt').Trim())</HgTag>
     </PropertyGroup>
+    <Message Text="Building $(HgTag):$(HgVersion) $(HgBranch)" Importance="high" />
     <ItemGroup>
       <ClCompile Include="..\Modules\getbuildinfo.c">
         <PreprocessorDefinitions>HGVERSION="$(HgVersion)";HGTAG="$(HgTag)";HGBRANCH="$(HgBranch)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
index 47e4715c278cc4828ae770a2b0bcec0dc3a4c0f4..3254f310953762be45cff461543af23175338610 100644 (file)
@@ -78,7 +78,8 @@ call "%D%..\..\doc\make.bat" htmlhelp
 if errorlevel 1 goto :eof\r
 :skipdoc\r
 \r
-where hg /q || echo Cannot find Mercurial on PATH && exit /B 1\r
+where hg > "%TEMP%\hg.loc" 2> nul && set /P HG= < "%TEMP%\hg.loc" & del "%TEMP%\hg.loc"\r
+if not exist "%HG%" echo Cannot find Mercurial on PATH && exit /B 1\r
 \r
 where dlltool /q && goto skipdlltoolsearch\r
 set _DLLTOOL_PATH=\r
@@ -128,6 +129,12 @@ if exist "%BUILD%en-us" (
     if errorlevel 1 exit /B\r
 )\r
 \r
+if exist "%D%obj\Debug_%OBJDIR_PLAT%" (\r
+    echo Deleting "%D%obj\Debug_%OBJDIR_PLAT%"\r
+    rmdir /q/s "%D%obj\Debug_%OBJDIR_PLAT%"\r
+    if errorlevel 1 exit /B\r
+)\r
+\r
 if exist "%D%obj\Release_%OBJDIR_PLAT%" (\r
     echo Deleting "%D%obj\Release_%OBJDIR_PLAT%"\r
     rmdir /q/s "%D%obj\Release_%OBJDIR_PLAT%"\r
@@ -145,8 +152,14 @@ if not "%PGO%" EQU "" (
     set PGOOPTS=\r
 )\r
 if not "%SKIPBUILD%" EQU "1" (\r
-    @echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %CERTOPTS% %PGOOPTS%\r
-    @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %CERTOPTS% %PGOOPTS%\r
+    @echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%\r
+    @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %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
+    @echo call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%\r
+    @call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%\r
     @if errorlevel 1 exit /B\r
     @rem build.bat turns echo back on, so we disable it again\r
     @echo off\r