Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bbf32e1

Browse files
committed
Issue #28573: Missing sys._mercurial info and other build issues.
2 parents 0b87b69 + 02a4018 commit bbf32e1

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

PCbuild/pythoncore.vcxproj

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,21 @@
406406
<ImportGroup Label="ExtensionTargets">
407407
</ImportGroup>
408408
<Target Name="_GetBuildInfo" BeforeTargets="PrepareForBuild">
409-
<Exec Command="hg id -b &gt; &quot;$(IntDir)hgbranch.txt&quot;" ContinueOnError="true" />
410-
<Exec Command="hg id -i &gt; &quot;$(IntDir)hgversion.txt&quot;" ContinueOnError="true" />
411-
<Exec Command="hg id -t &gt; &quot;$(IntDir)hgtag.txt&quot;" ContinueOnError="true" />
409+
<PropertyGroup>
410+
<HG Condition="$(HG) == ''">hg</HG>
411+
<_HG>$(HG)</_HG>
412+
<_HG Condition="$(HG.Contains(` `))">"$(HG)"</_HG>
413+
</PropertyGroup>
414+
<Message Text="Getting build info from $(_HG)" Importance="high" />
415+
<Exec Command="$(_HG) id -b &gt; &quot;$(IntDir)hgbranch.txt&quot;" ContinueOnError="true" />
416+
<Exec Command="$(_HG) id -i &gt; &quot;$(IntDir)hgversion.txt&quot;" ContinueOnError="true" />
417+
<Exec Command="$(_HG) id -t &gt; &quot;$(IntDir)hgtag.txt&quot;" ContinueOnError="true" />
412418
<PropertyGroup>
413419
<HgBranch Condition="Exists('$(IntDir)hgbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgbranch.txt').Trim())</HgBranch>
414420
<HgVersion Condition="Exists('$(IntDir)hgversion.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgversion.txt').Trim())</HgVersion>
415421
<HgTag Condition="Exists('$(IntDir)hgtag.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgtag.txt').Trim())</HgTag>
416422
</PropertyGroup>
423+
<Message Text="Building $(HgTag):$(HgVersion) $(HgBranch)" Importance="high" />
417424
<ItemGroup>
418425
<ClCompile Include="..\Modules\getbuildinfo.c">
419426
<PreprocessorDefinitions>HGVERSION="$(HgVersion)";HGTAG="$(HgTag)";HGBRANCH="$(HgBranch)";%(PreprocessorDefinitions)</PreprocessorDefinitions>

Tools/msi/buildrelease.bat

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ call "%D%..\..\doc\make.bat" htmlhelp
7878
if errorlevel 1 goto :eof
7979
:skipdoc
8080

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

8384
where dlltool /q && goto skipdlltoolsearch
8485
set _DLLTOOL_PATH=
@@ -128,6 +129,12 @@ if exist "%BUILD%en-us" (
128129
if errorlevel 1 exit /B
129130
)
130131

132+
if exist "%D%obj\Debug_%OBJDIR_PLAT%" (
133+
echo Deleting "%D%obj\Debug_%OBJDIR_PLAT%"
134+
rmdir /q/s "%D%obj\Debug_%OBJDIR_PLAT%"
135+
if errorlevel 1 exit /B
136+
)
137+
131138
if exist "%D%obj\Release_%OBJDIR_PLAT%" (
132139
echo Deleting "%D%obj\Release_%OBJDIR_PLAT%"
133140
rmdir /q/s "%D%obj\Release_%OBJDIR_PLAT%"
@@ -145,8 +152,14 @@ if not "%PGO%" EQU "" (
145152
set PGOOPTS=
146153
)
147154
if not "%SKIPBUILD%" EQU "1" (
148-
@echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %CERTOPTS% %PGOOPTS%
149-
@call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %CERTOPTS% %PGOOPTS%
155+
@echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%
156+
@call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%
157+
@if errorlevel 1 exit /B
158+
@rem build.bat turns echo back on, so we disable it again
159+
@echo off
160+
161+
@echo call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%
162+
@call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%
150163
@if errorlevel 1 exit /B
151164
@rem build.bat turns echo back on, so we disable it again
152165
@echo off

0 commit comments

Comments
 (0)