| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # This script is wrapper for Chromium that adds some support for how GYP | 7 # This script is wrapper for Chromium that adds some support for how GYP |
| 8 # is invoked by Chromium beyond what can be done in the gclient hooks. | 8 # is invoked by Chromium beyond what can be done in the gclient hooks. |
| 9 | 9 |
| 10 import ctypes |
| 10 import glob | 11 import glob |
| 11 import gyp_helper | 12 import gyp_helper |
| 12 import json | 13 import json |
| 13 import os | 14 import os |
| 14 import pipes | 15 import pipes |
| 15 import shlex | 16 import shlex |
| 16 import shutil | 17 import shutil |
| 17 import subprocess | 18 import subprocess |
| 18 import string | 19 import string |
| 19 import sys | 20 import sys |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 if os.path.exists(out_release) and not os.path.exists(out_release_nacl64): | 387 if os.path.exists(out_release) and not os.path.exists(out_release_nacl64): |
| 387 os.makedirs(out_release_nacl64) | 388 os.makedirs(out_release_nacl64) |
| 388 copy_runtime(out_debug, x86, 'msvc%s120d.dll') | 389 copy_runtime(out_debug, x86, 'msvc%s120d.dll') |
| 389 copy_runtime(out_release, x86, 'msvc%s120.dll') | 390 copy_runtime(out_release, x86, 'msvc%s120.dll') |
| 390 copy_runtime(out_debug_x64, x64, 'msvc%s120d.dll') | 391 copy_runtime(out_debug_x64, x64, 'msvc%s120d.dll') |
| 391 copy_runtime(out_release_x64, x64, 'msvc%s120.dll') | 392 copy_runtime(out_release_x64, x64, 'msvc%s120.dll') |
| 392 copy_runtime(out_debug_nacl64, x64, 'msvc%s120d.dll') | 393 copy_runtime(out_debug_nacl64, x64, 'msvc%s120d.dll') |
| 393 copy_runtime(out_release_nacl64, x64, 'msvc%s120.dll') | 394 copy_runtime(out_release_nacl64, x64, 'msvc%s120.dll') |
| 394 | 395 |
| 395 | 396 |
| 397 def GetFreeSpaceMBWindows(path): |
| 398 """Returns the number of mebibytes free for a given directory.""" |
| 399 free_bytes = ctypes.c_ulonglong(0) |
| 400 ctypes.windll.kernel32.GetDiskFreeSpaceExW( |
| 401 ctypes.c_wchar_p(path), None, None, ctypes.pointer(free_bytes)) |
| 402 return free_bytes.value / 1024 / 1024 |
| 403 |
| 404 |
| 396 if __name__ == '__main__': | 405 if __name__ == '__main__': |
| 397 args = sys.argv[1:] | 406 args = sys.argv[1:] |
| 398 | 407 |
| 399 if int(os.environ.get('GYP_CHROMIUM_NO_ACTION', 0)): | 408 if int(os.environ.get('GYP_CHROMIUM_NO_ACTION', 0)): |
| 400 print 'Skipping gyp_chromium due to GYP_CHROMIUM_NO_ACTION env var.' | 409 print 'Skipping gyp_chromium due to GYP_CHROMIUM_NO_ACTION env var.' |
| 401 sys.exit(0) | 410 sys.exit(0) |
| 402 | 411 |
| 403 # Use the Psyco JIT if available. | 412 # Use the Psyco JIT if available. |
| 404 if psyco: | 413 if psyco: |
| 405 psyco.profile() | 414 psyco.profile() |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 # values there. | 518 # values there. |
| 510 gyp_defines_dict = gyp.NameValueListToDict(gyp.ShlexEnv('GYP_DEFINES')) | 519 gyp_defines_dict = gyp.NameValueListToDict(gyp.ShlexEnv('GYP_DEFINES')) |
| 511 gyp_defines_dict['windows_sdk_path'] = win8sdk | 520 gyp_defines_dict['windows_sdk_path'] = win8sdk |
| 512 os.environ['GYP_DEFINES'] = ' '.join('%s=%s' % (k, pipes.quote(str(v))) | 521 os.environ['GYP_DEFINES'] = ' '.join('%s=%s' % (k, pipes.quote(str(v))) |
| 513 for k, v in gyp_defines_dict.iteritems()) | 522 for k, v in gyp_defines_dict.iteritems()) |
| 514 os.environ['WINDOWSSDKDIR'] = win8sdk | 523 os.environ['WINDOWSSDKDIR'] = win8sdk |
| 515 os.environ['WDK_DIR'] = wdk | 524 os.environ['WDK_DIR'] = wdk |
| 516 # Include the VS runtime in the PATH in case it's not machine-installed. | 525 # Include the VS runtime in the PATH in case it's not machine-installed. |
| 517 runtime_path = ';'.join(vs2013_runtime_dll_dirs) | 526 runtime_path = ';'.join(vs2013_runtime_dll_dirs) |
| 518 os.environ['PATH'] = runtime_path + ';' + os.environ['PATH'] | 527 os.environ['PATH'] = runtime_path + ';' + os.environ['PATH'] |
| 519 print('Using automatic toolchain in %s (%s edition).' % ( | 528 # TODO(scottmg): Temporarily add free space print to try to see how close |
| 520 toolchain, 'Pro' if version_is_pro else 'Express')) | 529 # we're getting to failures on windows bots. http://crbug.com/348350 |
| 530 print('Using automatic toolchain in %s (%s edition), free space: %dM.' % ( |
| 531 toolchain, |
| 532 'Pro' if version_is_pro else 'Express', |
| 533 GetFreeSpaceMBWindows(GetOutputDirectory()))) |
| 521 | 534 |
| 522 # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check | 535 # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check |
| 523 # to enfore syntax checking. | 536 # to enfore syntax checking. |
| 524 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 537 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
| 525 if syntax_check and int(syntax_check): | 538 if syntax_check and int(syntax_check): |
| 526 args.append('--check') | 539 args.append('--check') |
| 527 | 540 |
| 528 supplemental_includes = GetSupplementalFiles() | 541 supplemental_includes = GetSupplementalFiles() |
| 529 gn_vars_dict = GetGypVarsForGN(supplemental_includes) | 542 gn_vars_dict = GetGypVarsForGN(supplemental_includes) |
| 530 | 543 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 555 print 'Running build/landmines.py...' | 568 print 'Running build/landmines.py...' |
| 556 subprocess.check_call( | 569 subprocess.check_call( |
| 557 [sys.executable, os.path.join(script_dir, 'landmines.py')]) | 570 [sys.executable, os.path.join(script_dir, 'landmines.py')]) |
| 558 | 571 |
| 559 if vs2013_runtime_dll_dirs: | 572 if vs2013_runtime_dll_dirs: |
| 560 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs | 573 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs |
| 561 CopyVsRuntimeDlls(os.path.join(chrome_src, GetOutputDirectory()), | 574 CopyVsRuntimeDlls(os.path.join(chrome_src, GetOutputDirectory()), |
| 562 (x86_runtime, x64_runtime)) | 575 (x86_runtime, x64_runtime)) |
| 563 | 576 |
| 564 sys.exit(gyp_rc) | 577 sys.exit(gyp_rc) |
| OLD | NEW |