Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3624)

Unified Diff: build/win/reorder-imports.py

Issue 137643003: Temporary fix for telemetry builds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use target_arch instead Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/chrome_exe.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/win/reorder-imports.py
diff --git a/build/win/reorder-imports.py b/build/win/reorder-imports.py
index d320b51e9e7cc6d39445ef06fabd753375839e29..081537790dc715ea60d3a254b5ed4c29b1ae154a 100755
--- a/build/win/reorder-imports.py
+++ b/build/win/reorder-imports.py
@@ -10,7 +10,7 @@ import shutil
import subprocess
import sys
-def reorder_imports(input_dir, output_dir):
+def reorder_imports(input_dir, output_dir, architecture):
"""Run swapimports.exe on the initial chrome.exe, and write to the output
directory. Also copy over any related files that might be needed
(pdbs, manifests etc.).
@@ -18,11 +18,16 @@ def reorder_imports(input_dir, output_dir):
input_image = '--input-image=%s' % (os.path.join(input_dir, 'chrome.exe'))
output_image = '--output-image=%s' % (os.path.join(output_dir, 'chrome.exe'))
- swap_exe = os.path.join(
- __file__,
- '..\\..\\..\\third_party\\syzygy\\binaries\\exe\\swapimport.exe')
- subprocess.call(
- [swap_exe, input_image, output_image, '--overwrite', 'chrome_elf.dll'])
+ # TODO(caitkp): Remove this once swapimport works on x64 builds.
+ if architecture == 'x64':
+ shutil.copy(os.path.join(input_dir, 'chrome.exe'),
+ os.path.join(output_dir, 'chrome.exe'))
+ else:
+ swap_exe = os.path.join(
+ __file__,
+ '..\\..\\..\\third_party\\syzygy\\binaries\\exe\\swapimport.exe')
+ subprocess.call(
+ [swap_exe, input_image, output_image, '--overwrite', 'chrome_elf.dll'])
for fname in glob.iglob(os.path.join(input_dir, 'chrome.exe.*')):
shutil.copy(fname, os.path.join(output_dir, os.path.basename(fname)))
@@ -30,17 +35,18 @@ def reorder_imports(input_dir, output_dir):
def main(argv):
- usage = 'reorder_imports.py -i <input_dir> -o <output_dir>'
+ usage = 'reorder_imports.py -i <input_dir> -o <output_dir> -a <target_arch>'
parser = optparse.OptionParser(usage=usage)
parser.add_option('-i', '--input', help='reorder chrome.exe in DIR',
metavar='DIR')
parser.add_option('-o', '--output', help='write new chrome.exe to DIR',
metavar='DIR')
+ parser.add_option('-a', '--arch', help='architecture of build (optional)')
opts, args = parser.parse_args()
if not opts.input or not opts.output:
parser.error('Please provide and input and output directory')
- return reorder_imports(opts.input, opts.output)
+ return reorder_imports(opts.input, opts.output, opts.arch)
scottmg 2014/01/20 01:23:22 i think this will error out if -a isn't provided,
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
« no previous file with comments | « no previous file | chrome/chrome_exe.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698