summaryrefslogtreecommitdiffstats
path: root/build/gyp_chromium
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 00:42:31 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 00:42:31 +0000
commit812ab9c324bd34ed4f1770fac071406e4b901cac (patch)
tree7da732509cdb8c3cd01b09dd8914d937d75363f7 /build/gyp_chromium
parent2cce59d422d84fcf76f6fb3fc24829fb889bf6c9 (diff)
downloadchromium_src-812ab9c324bd34ed4f1770fac071406e4b901cac.zip
chromium_src-812ab9c324bd34ed4f1770fac071406e4b901cac.tar.gz
chromium_src-812ab9c324bd34ed4f1770fac071406e4b901cac.tar.bz2
Add free space print to see how near edge bots are
Temporarily for trybots to see how close to the edge they are. TBR=iannucci@chromium.org BUG=348350 Review URL: https://codereview.chromium.org/183923014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/gyp_chromium')
-rwxr-xr-xbuild/gyp_chromium17
1 files changed, 15 insertions, 2 deletions
diff --git a/build/gyp_chromium b/build/gyp_chromium
index 97179c1..a6300a3 100755
--- a/build/gyp_chromium
+++ b/build/gyp_chromium
@@ -7,6 +7,7 @@
# This script is wrapper for Chromium that adds some support for how GYP
# is invoked by Chromium beyond what can be done in the gclient hooks.
+import ctypes
import glob
import gyp_helper
import json
@@ -393,6 +394,14 @@ def CopyVsRuntimeDlls(output_dir, runtime_dirs):
copy_runtime(out_release_nacl64, x64, 'msvc%s120.dll')
+def GetFreeSpaceMBWindows(path):
+ """Returns the number of mebibytes free for a given directory."""
+ free_bytes = ctypes.c_ulonglong(0)
+ ctypes.windll.kernel32.GetDiskFreeSpaceExW(
+ ctypes.c_wchar_p(path), None, None, ctypes.pointer(free_bytes))
+ return free_bytes.value / 1024 / 1024
+
+
if __name__ == '__main__':
args = sys.argv[1:]
@@ -516,8 +525,12 @@ if __name__ == '__main__':
# Include the VS runtime in the PATH in case it's not machine-installed.
runtime_path = ';'.join(vs2013_runtime_dll_dirs)
os.environ['PATH'] = runtime_path + ';' + os.environ['PATH']
- print('Using automatic toolchain in %s (%s edition).' % (
- toolchain, 'Pro' if version_is_pro else 'Express'))
+ # TODO(scottmg): Temporarily add free space print to try to see how close
+ # we're getting to failures on windows bots. http://crbug.com/348350
+ print('Using automatic toolchain in %s (%s edition), free space: %dM.' % (
+ toolchain,
+ 'Pro' if version_is_pro else 'Express',
+ GetFreeSpaceMBWindows(GetOutputDirectory())))
# If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check
# to enfore syntax checking.