Skip to content

Commit

Permalink
Stop gyp_chromium prior to mass DLL copies on error
Browse files Browse the repository at this point in the history
Also fix last-modified-time comparison code to handle minor float
differences and thus correctly not copy identical files (for some
reason there appears to be a ~1e-07 diff between last-modified-time
of copied files...?).

BUG=603603
TEST=No more copy output from gyp_chromium when copied DLLs are already
there or gyp_rc != 0 :-)

Review URL: https://codereview.chromium.org/1890053004

Cr-Commit-Position: refs/heads/master@{#387911}
  • Loading branch information
gab authored and Commit bot committed Apr 18, 2016
1 parent 3d7ca11 commit 381d9f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/gyp_chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def main():
# Off we go...
gyp_rc = gyp.main(args)

if not use_analyzer:
if gyp_rc == 0 and not use_analyzer:
vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
if vs2013_runtime_dll_dirs:
x64_runtime, x86_runtime = vs2013_runtime_dll_dirs
Expand Down
9 changes: 5 additions & 4 deletions build/vs_toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,14 @@ def _VersionNumber():


def _CopyRuntimeImpl(target, source, verbose=True):
"""Copy |source| to |target| if it doesn't already exist or if it
needs to be updated.
"""Copy |source| to |target| if it doesn't already exist or if it needs to be
updated (comparing last modified time as an approximate float match as for
some reason the values tend to differ by ~1e-07 despite being copies of the
same file... https://crbug.com/603603).
"""
if (os.path.isdir(os.path.dirname(target)) and
(not os.path.isfile(target) or
os.stat(target).st_mtime != os.stat(source).st_mtime)):
abs(os.stat(target).st_mtime - os.stat(source).st_mtime) >= 0.01)):
if verbose:
print 'Copying %s to %s...' % (source, target)
if os.path.exists(target):
Expand All @@ -185,7 +187,6 @@ def _CopyRuntime2015(target_dir, source_dir, dll_pattern, suffix):
source = os.path.join(source_dir, dll)
_CopyRuntimeImpl(target, source)
ucrt_src_dir = os.path.join(source_dir, 'api-ms-win-*.dll')
print 'Copying %s to %s...' % (ucrt_src_dir, target_dir)
for ucrt_src_file in glob.glob(ucrt_src_dir):
file_part = os.path.basename(ucrt_src_file)
ucrt_dst_file = os.path.join(target_dir, file_part)
Expand Down

0 comments on commit 381d9f1

Please sign in to comment.