Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Commit 4e4854b

Browse files
committed
Update build scripts to Python 3 and add logging
Also updated code-recognition in rename_to_version.py from const to constexpr.
1 parent e10e0e7 commit 4e4854b

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

make_zip_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import zipfile
44

55
if len(sys.argv) < 3:
6-
print "Usage: %s zipfile directory" % sys.argv[0]
6+
print('Usage: %s zipfile directory' % sys.argv[0])
77
sys.exit(0)
88

99
filename = sys.argv[1]

package_etw.bat

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ set vcvars32="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\V
4040
call %vcvars32%
4141

4242
@rem Build DelayedCreateProcess.exe to the bin directory
43+
@echo Building DelayedCreateProcess.exe
4344
call DelayedCreateProcess\make.bat
4445

4546
cd /d %UIforETW%ETWInsights
47+
@echo Building ETWInsights
4648
devenv /rebuild "release|Win32" ETWInsights.sln
4749
@if ERRORLEVEL 1 goto BuildFailure
4850
xcopy Release\flame_graph.exe %UIforETW%\bin /y
@@ -53,15 +55,18 @@ cd /d %UIforETW%UIforETW
5355
sed "s/UIforETW.vcxproj/UIforETWStatic.vcxproj/" <UIforETW.sln >UIforETWStatic.sln
5456
@echo First do a test build with ETW marks disabled to test the inline functions.
5557
sed "s/_WINDOWS/_WINDOWS;DISABLE_ETW_MARKS/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
58+
@echo Building UIforETW 32-bit test build
5659
devenv /rebuild "release|Win32" UIforETWStatic.sln
5760
@if ERRORLEVEL 1 goto BuildFailure
5861

5962
@rem Now prepare for the real builds
6063
sed "s/UseOfMfc>Dynamic/UseOfMfc>Static/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
6164
if exist Release rmdir Release /s/q
6265
if exist x64\Release rmdir x64\Release /s/q
66+
@echo Building UIforETW 32-bit official build
6367
devenv /rebuild "release|Win32" UIforETWStatic.sln
6468
@if ERRORLEVEL 1 goto BuildFailure
69+
@echo Building UIforETW 64-bit official build
6570
devenv /rebuild "release|x64" UIforETWStatic.sln
6671
@if ERRORLEVEL 1 goto BuildFailure
6772
@rem Clean up after building the static version.
@@ -173,11 +178,11 @@ del etwsymserver\refs.ptr /s
173178

174179
@rem Make the redistributable .zip file
175180
del *.zip 2>nul
176-
call python make_zip_file.py etwpackage.zip etwpackage
181+
call python3 make_zip_file.py etwpackage.zip etwpackage
177182
@echo on
178183

179184
@rem Rename to the current version.
180-
call python rename_to_version.py UIforETW\Version.h
185+
call python3 rename_to_version.py UIforETW\Version.h
181186
@echo on
182187

183188
@echo Now upload the new etwpackage*.zip
@@ -194,7 +199,7 @@ cd etwsymserver
194199
@rem Upload to the randomascii-symbols public symbol server.
195200
@echo Final step - ready to upload the symbols?
196201
@pause
197-
call python c:\src\depot_tools\gsutil.py cp -Z -R . gs://randomascii-symbols
202+
call python3 c:\src\depot_tools\gsutil.py cp -Z -R . gs://randomascii-symbols
198203
cd ..
199204
@echo on
200205

rename_to_version.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import os
22
import sys
33

4-
prefix = 'const float kCurrentVersion = '
4+
prefix = 'constexpr float kCurrentVersion = '
55

66
version_header = sys.argv[1]
77
for line in open(version_header).readlines():
88
if line.startswith(prefix):
99
version = line[len(prefix) : len(prefix) + 4]
10-
print 'Renaming zip files to version "%s"' % version
10+
print('Renaming zip files to version "%s"' % version)
1111
os.rename('etwpackage.zip', 'etwpackage%s.zip' % version)
1212
sys.exit(0)
13-
assert(0)
13+
14+
assert(not "Didn't find header")

0 commit comments

Comments
 (0)