def FetchDeps(v8_path): # Verify path. v8_path = os.path.abspath(v8_path) assert os.path.isdir(v8_path) # Check out depot_tools if necessary. depot_tools = node_common.EnsureDepotTools(v8_path, True) temporary_git = EnsureGit(v8_path) try: print "Fetching dependencies." env = os.environ.copy() # gclient needs to have depot_tools in the PATH. env["PATH"] = depot_tools + os.pathsep + env["PATH"] spec = "solutions = %s" % GCLIENT_SOLUTION subprocess.check_call(["gclient", "sync", "--spec", spec], cwd=os.path.join(v8_path, os.path.pardir), env=env) except: raise finally: if temporary_git: node_common.UninitGit(v8_path) # Clean up .gclient_entries file. gclient_entries = os.path.normpath( os.path.join(v8_path, os.pardir, ".gclient_entries")) if os.path.isfile(gclient_entries): os.remove(gclient_entries)
def FetchDeps(v8_path): # TODO(v8:6105): # The return value gates whether Node's configure script actually # uses GN. Change this to true once everything is ready so that # the change to enable the GN build on the bots comes from V8. return False # Verify path. v8_path = os.path.abspath(v8_path) assert os.path.isdir(v8_path) # Check out depot_tools if necessary. depot_tools = node_common.EnsureDepotTools(v8_path, True) temporary_git = EnsureGit(v8_path) try: print "Fetching dependencies." env = os.environ.copy() # gclient needs to have depot_tools in the PATH. env["PATH"] = depot_tools + os.pathsep + env["PATH"] spec = "solutions = %s" % GCLIENT_SOLUTION subprocess.check_call(["gclient", "sync", "--spec", spec], cwd=os.path.join(v8_path, os.path.pardir), env=env) except: raise finally: if temporary_git: node_common.UninitGit(v8_path) # Clean up .gclient_entries file. gclient_entries = os.path.normpath( os.path.join(v8_path, os.pardir, ".gclient_entries")) if os.path.isfile(gclient_entries): os.remove(gclient_entries)
def Build(options): print "Building." depot_tools = node_common.EnsureDepotTools(options.v8_path, False) ninja = os.path.join(depot_tools, "ninja") subprocess.check_call( [ninja, "-v", "-C", options.build_path, BUILD_TARGET], cwd=options.v8_path)
def Main(v8_path): # Verify paths. v8_path = os.path.abspath(v8_path) assert os.path.isdir(v8_path) # Check out depot_tools if necessary. depot_tools = node_common.EnsureDepotTools(v8_path, True) # Fetch dependencies with gclient. FetchDeps(v8_path, depot_tools)
def Main(v8_path, build_path, is_debug, build_flags): # Verify paths. v8_path = os.path.abspath(v8_path) assert os.path.isdir(v8_path) build_path = os.path.abspath(build_path) build_path = os.path.join(build_path, BUILD_SUBDIR) if not os.path.isdir(build_path): os.makedirs(build_path) # Check that we have depot tools. depot_tools = node_common.EnsureDepotTools(v8_path, False) # Build with GN. Build(v8_path, build_path, depot_tools, is_debug, build_flags)
def Build(options): depot_tools = node_common.EnsureDepotTools(options.v8_path, False) ninja = os.path.join(depot_tools, "ninja") if sys.platform == 'win32': # Required because there is an extension-less file called "ninja". ninja += ".exe" args = [ninja, "-C", options.build_path, BUILD_TARGET] if options.max_load: args += ["-l" + options.max_load] if options.max_jobs: args += ["-j" + options.max_jobs] else: with open(os.path.join(options.build_path, "args.gn")) as f: if "use_goma = true" in f.read(): args += ["-j500"] subprocess.check_call(args)