aboutsummaryrefslogtreecommitdiffhomepage
path: root/gyp_skia
diff options
context:
space:
mode:
authorGravatar borenet <borenet@chromium.org>2016-03-18 08:33:38 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-18 08:33:38 -0700
commit1195260e22fc2e9c92b435491d4d19108a20df5c (patch)
tree25dfb6f13e3bbbde1c9d7af7b41ea39b2df78dd4 /gyp_skia
parent83c17fa56b23159166394cb3feb431ffafbbab48 (diff)
Make Win runtime DLLs writeable before overwriting
This should fix the VS2015 bot which is failing because we can't overwrite read-only DLL files. BUG=skia:4553 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1813233002 Review URL: https://codereview.chromium.org/1813233002
Diffstat (limited to 'gyp_skia')
-rwxr-xr-xgyp_skia21
1 files changed, 15 insertions, 6 deletions
diff --git a/gyp_skia b/gyp_skia
index 91d93ca97f..ed6d38376f 100755
--- a/gyp_skia
+++ b/gyp_skia
@@ -13,6 +13,7 @@ import glob
import os
import platform
import shlex
+import stat
import sys
script_dir = os.path.abspath(os.path.dirname(__file__))
@@ -90,7 +91,7 @@ if __name__ == '__main__':
print ('%s environment variable not set, using default, %s' %
(ENVVAR_GYP_GENERATORS, default_gyp_generators))
- vs2013_runtime_dll_dirs = None
+ vs_runtime_dll_dirs = None
if os.getenv('CHROME_HEADLESS', '0') == '1':
if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
chrome_path = os.getenv('CHROME_PATH')
@@ -98,7 +99,7 @@ if __name__ == '__main__':
sys.path.append(os.path.join(chrome_path, 'build'))
sys.path.append(os.path.join(chrome_path, 'tools'))
import vs_toolchain
- vs2013_runtime_dll_dirs = \
+ vs_runtime_dll_dirs = \
vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
# Set CWD to the directory containing this script.
@@ -127,7 +128,8 @@ if __name__ == '__main__':
args.extend(['--depth', '.'])
# Tell gyp to write the build files into output_dir.
- args.extend(['--generator-output', os.path.abspath(get_output_dir())])
+ out_dir = os.path.abspath(get_output_dir())
+ args.extend(['--generator-output', out_dir])
# Tell ninja to write its output into the same directory.
args.extend(['-Goutput_dir=%s' % gyp_output_dir])
@@ -158,8 +160,15 @@ if __name__ == '__main__':
# This code is copied from Chrome's build/gyp_chromium. It's not clear why
# the *_runtime variables are reversed.
- if vs2013_runtime_dll_dirs:
- x64_runtime, x86_runtime = vs2013_runtime_dll_dirs
+ if vs_runtime_dll_dirs:
+ # The DLLs might be read-only, which will cause an error when attempting to
+ # overwrite them. Make them writeable first.
+ for path, dirs, files in os.walk(out_dir):
+ for f in files:
+ if f.endswith('.dll'):
+ os.chmod(os.path.join(path, f), stat.S_IWRITE)
+
+ x64_runtime, x86_runtime = vs_runtime_dll_dirs
vs_toolchain.CopyVsRuntimeDlls(
- os.path.join(os.getenv('CHROME_PATH'), get_output_dir()),
+ os.path.join(os.getenv('CHROME_PATH'), out_dir),
(x86_runtime, x64_runtime))