Commit 51f7506a authored by Sebastien Marchand's avatar Sebastien Marchand Committed by Commit Bot

Fix build_clang_tools_extra.py on Windows.

The script fails with the following error on Windows when using the
--fetch flag:

Traceback (most recent call last):
  File "tools/clang/scripts/build_clang_tools_extra.py", line 97, in <module>
    sys.exit(main())
  File "tools/clang/scripts/build_clang_tools_extra.py", line 90, in main
    FetchLLVM(GetCheckoutDir(args.OUT_DIR), args.revision)
  File "tools/clang/scripts/build_clang_tools_extra.py", line 54, in FetchLLVM
    subprocess.check_call(args, cwd=checkout_dir)
  File "C:\python_27_amd64\files\lib\subprocess.py", line 185, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\python_27_amd64\files\lib\subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\python_27_amd64\files\lib\subprocess.py", line 394, in __init__
    errread, errwrite)
  File "C:\python_27_amd64\files\lib\subprocess.py", line 644, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

With these few changes the scripts works fine on Windows.

This also switch this script to using GN instead of cmake.

Change-Id: I2af10fd0d03d4d18394b792e1b7780f2084bfa9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1968071Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726680}
parent 9f422fb8
...@@ -51,10 +51,10 @@ def FetchLLVM(checkout_dir, revision): ...@@ -51,10 +51,10 @@ def FetchLLVM(checkout_dir, revision):
# Otherwise, try to update it. # Otherwise, try to update it.
print('-- Attempting to update existing repo') print('-- Attempting to update existing repo')
args = ['git', 'pull', '--rebase', 'origin', 'master'] args = ['git', 'pull', '--rebase', 'origin', 'master']
subprocess.check_call(args, cwd=checkout_dir) subprocess.check_call(args, cwd=checkout_dir, shell=sys.platform == 'win32')
if revision: if revision:
args = ['git', 'checkout', revision] args = ['git', 'checkout', revision]
subprocess.check_call(args, cwd=checkout_dir) subprocess.check_call(args, cwd=checkout_dir, shell=sys.platform == 'win32')
def BuildTargets(build_dir, targets): def BuildTargets(build_dir, targets):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment