Skip to content

Commit

Permalink
Issue python#28573: Missing sys._mercurial info and other build issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Nov 22, 2016
2 parents 0b87b69 + 02a4018 commit bbf32e1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
13 changes: 10 additions & 3 deletions PCbuild/pythoncore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,21 @@
<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>
Expand Down
19 changes: 16 additions & 3 deletions Tools/msi/buildrelease.bat
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ call "%D%..\..\doc\make.bat" htmlhelp
if errorlevel 1 goto :eof
:skipdoc

where hg /q || echo Cannot find Mercurial on PATH && exit /B 1
where hg > "%TEMP%\hg.loc" 2> nul && set /P HG= < "%TEMP%\hg.loc" & del "%TEMP%\hg.loc"
if not exist "%HG%" echo Cannot find Mercurial on PATH && exit /B 1

where dlltool /q && goto skipdlltoolsearch
set _DLLTOOL_PATH=
Expand Down Expand Up @@ -128,6 +129,12 @@ if exist "%BUILD%en-us" (
if errorlevel 1 exit /B
)

if exist "%D%obj\Debug_%OBJDIR_PLAT%" (
echo Deleting "%D%obj\Debug_%OBJDIR_PLAT%"
rmdir /q/s "%D%obj\Debug_%OBJDIR_PLAT%"
if errorlevel 1 exit /B
)

if exist "%D%obj\Release_%OBJDIR_PLAT%" (
echo Deleting "%D%obj\Release_%OBJDIR_PLAT%"
rmdir /q/s "%D%obj\Release_%OBJDIR_PLAT%"
Expand All @@ -145,8 +152,14 @@ if not "%PGO%" EQU "" (
set PGOOPTS=
)
if not "%SKIPBUILD%" EQU "1" (
@echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %CERTOPTS% %PGOOPTS%
@call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %CERTOPTS% %PGOOPTS%
@echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%
@call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%
@if errorlevel 1 exit /B
@rem build.bat turns echo back on, so we disable it again
@echo off

@echo call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%
@call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%
@if errorlevel 1 exit /B
@rem build.bat turns echo back on, so we disable it again
@echo off
Expand Down

0 comments on commit bbf32e1

Please sign in to comment.