From a478c1ab51ea3e04e79791ac3d1dad01b3f57434 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Tue, 25 Apr 2017 22:26:49 -0400 Subject: [PATCH] win: mkdir even when copying directory * also "fix" the paths in the message * un-skip test/copies/gyptest-all.py BUG=gyp:536 Change-Id: Id8ff7941b995c25d68d454138cd8b04940fdd82b Reviewed-on: https://chromium-review.googlesource.com/487521 Commit-Queue: Dirk Pranke Reviewed-by: Dirk Pranke --- pylib/gyp/generator/msvs.py | 13 ++++++++----- test/copies/gyptest-all.py | 5 ----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pylib/gyp/generator/msvs.py b/pylib/gyp/generator/msvs.py index ab92979e..705d5e17 100644 --- a/pylib/gyp/generator/msvs.py +++ b/pylib/gyp/generator/msvs.py @@ -1717,14 +1717,17 @@ def _GetCopies(spec): src_bare = src[:-1] base_dir = posixpath.split(src_bare)[0] outer_dir = posixpath.split(src_bare)[1] - cmd = 'cd "%s" && xcopy /e /f /y "%s" "%s\\%s\\"' % ( - _FixPath(base_dir), outer_dir, _FixPath(dst), outer_dir) + fixed_dst = _FixPath(dst) + full_dst = '"%s\\%s\\"' % (fixed_dst, outer_dir) + cmd = 'mkdir %s 2>nul & cd "%s" && xcopy /e /f /y "%s" %s' % ( + full_dst, _FixPath(base_dir), outer_dir, full_dst) copies.append(([src], ['dummy_copies', dst], cmd, - 'Copying %s to %s' % (src, dst))) + 'Copying %s to %s' % (src, fixed_dst))) else: + fix_dst = _FixPath(cpy['destination']) cmd = 'mkdir "%s" 2>nul & set ERRORLEVEL=0 & copy /Y "%s" "%s"' % ( - _FixPath(cpy['destination']), _FixPath(src), _FixPath(dst)) - copies.append(([src], [dst], cmd, 'Copying %s to %s' % (src, dst))) + fix_dst, _FixPath(src), _FixPath(dst)) + copies.append(([src], [dst], cmd, 'Copying %s to %s' % (src, fix_dst))) return copies diff --git a/test/copies/gyptest-all.py b/test/copies/gyptest-all.py index ec38a297..aeccf332 100755 --- a/test/copies/gyptest-all.py +++ b/test/copies/gyptest-all.py @@ -12,11 +12,6 @@ test = TestGyp.TestGyp() -# The test seems to fail on msvs on the waterfall but not the try servers. -# Need to investigate further. -if test.format == 'msvs': - test.skip_test() # bug=536 - test.run_gyp('copies.gyp', '-G', 'xcode_ninja_target_pattern=^(?!copies_null)', chdir='src')