Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Make vpython-invocation code work on windows #601

Merged
merged 2 commits into from Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/build.py
Expand Up @@ -896,7 +896,8 @@ def V8():
buildbot.Step('V8')
src_dir = work_dirs.GetV8()
out_dir = os.path.join(src_dir, 'out.gn', 'x64.release')
proc.check_call(['vpython',
vpython = 'vpython' + ('.bat' if IsWindows() else '')
proc.check_call([vpython,
os.path.join(src_dir, 'tools', 'dev', 'v8gen.py'),
'-vv', 'x64.release'],
cwd=src_dir)
Expand Down
18 changes: 10 additions & 8 deletions src/host_toolchains.py
Expand Up @@ -30,12 +30,14 @@


def SetupToolchain():
return os.path.join(work_dirs.GetV8(), 'build', 'toolchain', 'win',
'setup_toolchain.py')
return ['vpython.bat',
os.path.join(work_dirs.GetV8(), 'build', 'toolchain',
'win', 'setup_toolchain.py')]


def VSToolchainPy():
return os.path.join(work_dirs.GetV8(), 'build', 'vs_toolchain.py')
return ['vpython.bat',
os.path.join(work_dirs.GetV8(), 'build', 'vs_toolchain.py')]


def WinToolchainJson():
Expand All @@ -52,7 +54,7 @@ def SyncPrebuiltClang(name, src_dir):

def SyncWinToolchain():
"""Update the VS toolchain used by Chromium bots"""
proc.check_call([VSToolchainPy(), 'update'])
proc.check_call(VSToolchainPy() + ['update'])


def GetVSEnv(dir):
Expand All @@ -74,7 +76,7 @@ def GetVSEnv(dir):

def GetRuntimeDir():
# Get the chromium-packaged toolchain directory info in a JSON file
proc.check_call([VSToolchainPy(), 'get_toolchain_dir'])
proc.check_call(VSToolchainPy() + ['get_toolchain_dir'])
with open(WinToolchainJson()) as f:
paths = json.load(f)
# Extract the 64-bit runtime path
Expand All @@ -85,14 +87,14 @@ def SetUpVSEnv(outdir):
"""Set up the VS build environment used by Chromium bots"""

# Get the chromium-packaged toolchain directory info in a JSON file
proc.check_call([VSToolchainPy(), 'get_toolchain_dir'])
proc.check_call(VSToolchainPy() + ['get_toolchain_dir'])
with open(WinToolchainJson()) as f:
paths = json.load(f)

# Write path information (usable by a non-chromium build) into an environment
# block
runtime_dirs = os.pathsep.join(paths['runtime_dirs'])
proc.check_call([SetupToolchain(),
proc.check_call(SetupToolchain() + [
'foo', paths['win_sdk'], runtime_dirs,
'win', 'x64', 'environment.x64'],
cwd=outdir)
Expand All @@ -102,7 +104,7 @@ def SetUpVSEnv(outdir):
def CopyDlls(dir, configuration):
"""Copy MSVS Runtime dlls into a build directory"""
file_util.Mkdir(dir)
proc.check_call([VSToolchainPy(), 'copy_dlls', dir, configuration, 'x64'])
proc.check_call(VSToolchainPy() + ['copy_dlls', dir, configuration, 'x64'])
# LLD needs also concrt140.dll, which the Chromium copy_dlls doesn't include.
for dll in glob.glob(os.path.join(GetRuntimeDir(), 'concrt140*.dll')):
print('Copying %s to %s' % (dll, dir))
Expand Down