Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: buildbot/buildbot_standard.py

Issue 1924743004: Remove GYP build from bots and 'gclient runhooks' (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: punt gyp build from pnacl script Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « buildbot/buildbot_selector.py ('k') | buildbot/buildbot_toolchain_build.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: buildbot/buildbot_standard.py
diff --git a/buildbot/buildbot_standard.py b/buildbot/buildbot_standard.py
index 77a8c88ab1d164ad385421d147e44a41a67e4255..532bb02929ab229a736c23a50dc3bffc5aabf44c 100644
--- a/buildbot/buildbot_standard.py
+++ b/buildbot/buildbot_standard.py
@@ -15,11 +15,11 @@ import sys
import time
from buildbot_lib import (
- BuildContext, BuildStatus, Command, EnsureDirectoryExists,
+ BuildContext, BuildStatus, Command, EnsureDirectoryExists, GNArch,
ParseStandardCommandLine, RemoveDirectory, RemovePath,
RemoveGypBuildDirectories, RemoveSconsBuildDirectories, RunBuild, SCons,
- SetupLinuxEnvironment, SetupMacEnvironment, SetupWindowsEnvironment,
- SetupAndroidEnvironment, Step, StepLink, StepText, TryToCleanContents,
+ SetupLinuxEnvironment, SetupWindowsEnvironment,
+ Step, StepLink, StepText, TryToCleanContents,
RunningOnBuildbot)
@@ -78,84 +78,19 @@ def ArchiveCoverage(context):
print '@@@STEP_LINK@view@%s@@@' % link_url
-def CommandGypBuild(context):
- # Do not use goma when inside a toolchain build, because the
- # freshly-built NaCl compilers will never be available via goma.
- # This sacrifices the benefits of goma for building the trusted
- # code too, but it's not clear how to teach Gyp to use goma for
- # some compilers and not others.
- use_goma = (RunningOnBuildbot() and
- not context['no_goma'] and
- not context['inside_toolchain'])
-
- if use_goma:
- # Since this is for buildbot, it should not be good to use the result
- # generated by the different version compiler.
- os.environ['GOMA_HERMETIC'] = 'fallback'
- else:
- os.environ['GOMA_DISABLED'] = '1'
-
- runtest_py = os.environ.get('RUNTEST')
- alt_runtest_py = '/b/build/scripts/slave/runtest.py'
- if runtest_py is None and os.path.exists(alt_runtest_py):
- runtest_py = alt_runtest_py
-
- # TODO(bradnelson): Figure out why win64 trybots can't upload goma logs.
- buildername = os.environ.get('BUILDBOT_BUILDERNAME', '')
- excluded_os = False
- for name in ['win64', 'vista', 'win7-64', 'win8-64']:
- if name in buildername:
- excluded_os = True
-
- if runtest_py is None or excluded_os:
- # Fallback to direct goma + ninja if not run on bots.
- try:
- if use_goma:
- Command(context, cmd=[
- sys.executable, '/b/build/goma/goma_ctl.py', 'restart'])
- cmd = ['ninja', '-v', '-k', '0', '-C', '../out/' + context['gyp_mode']]
- if use_goma:
- cmd += ['-j50']
- Command(context, cmd=cmd)
- finally:
- if use_goma:
- Command(context, cmd=[
- sys.executable, '/b/build/goma/goma_ctl.py', 'stop'])
- else:
- # Infer the location of compile.py from runtest.py.
- compile_py = os.path.join(os.path.dirname(runtest_py), 'compile.py')
- cmd = [sys.executable, compile_py, '--target', context['gyp_mode'],
- '--src-dir', '../', '--build-tool', 'ninja',
- '--ninja-ensure-up-to-date']
- if use_goma:
- cmd += ['--compiler', 'goma']
- cmd += ['--goma-dir', '/b/build/goma']
- # Verbose and but stop on fail.
- cmd += ['--', '-v', '-k', '0']
- Command(context, cmd=cmd)
-
-
-def CommandGypGenerate(context):
- Command(
- context,
- cmd=[sys.executable, 'native_client/build/gyp_nacl'],
- cwd='..')
-
-
def CommandGclientRunhooks(context):
if context.Windows():
gclient = 'gclient.bat'
else:
gclient = 'gclient'
print 'Running gclient runhooks...'
- print 'GYP_CROSSCOMPILE=' + context.GetEnv('GYP_CROSSCOMPILE', '')
- print 'GYP_GENERATORS=' + context.GetEnv('GYP_GENERATORS', '')
- print 'GYP_MSVS_VERSION=' + context.GetEnv('GYP_MSVS_VERSION', '')
- print 'GYP_DEFINES=' + context.GetEnv('GYP_DEFINES', '')
Command(context, cmd=[gclient, 'runhooks', '--force'])
def DoGNBuild(status, context, force_clang=False, force_arch=None):
+ if context['no_gn']:
+ return False
+
use_clang = force_clang or context['clang']
# Linux builds (or cross-builds) for every target. Mac builds for
@@ -174,6 +109,20 @@ def DoGNBuild(status, context, force_clang=False, force_arch=None):
else:
arch = context['arch']
+ if context.Linux():
+ # The Linux build uses a sysroot. 'gclient runhooks' installs this
+ # for the default architecture, but this might be a cross-build that
+ # gclient didn't know was going to be done. The script completes
+ # quickly when it's redundant with a previous run.
+ with Step('update_sysroot', status):
+ sysroot_arch = {'arm': 'arm',
+ '32': 'i386',
+ '64': 'amd64',
+ 'mips32': 'mips'}[arch]
+ Command(context, cmd=[sys.executable,
+ '../build/linux/sysroot_scripts/install-sysroot.py',
+ '--arch=' + sysroot_arch])
+
out_suffix = '_' + arch
if force_clang:
out_suffix += '_clang'
@@ -184,12 +133,7 @@ def DoGNBuild(status, context, force_clang=False, force_arch=None):
gn_newlib = BoolFlag(not context['use_glibc'])
gn_glibc = BoolFlag(context['use_glibc'])
-
- gn_arch_name = {
- 'arm': 'arm',
- '32': 'x86',
- '64': 'x64'
- }[arch]
+ gn_arch_name = GNArch(arch)
gn_gen_args = [
# The Chromium GN definitions might default enable_nacl to false
@@ -385,10 +329,7 @@ def BuildScript(status, context):
# Skip over hooks when run inside the toolchain build because
# package_version would overwrite the toolchain build.
- if inside_toolchain:
- with Step('gyp_generate_only', status):
- CommandGypGenerate(context)
- else:
+ if not inside_toolchain:
with Step('gclient_runhooks', status):
CommandGclientRunhooks(context)
@@ -449,11 +390,6 @@ def BuildScript(status, context):
with Step('checkdeps', status):
Command(context, cmd=[sys.executable, 'tools/checkdeps/checkdeps.py'])
- # Make sure our Gyp build is working.
- if not context['no_gyp']:
- with Step('gyp_compile', status):
- CommandGypBuild(context)
-
# On a subset of Linux builds, build Breakpad tools for testing.
if context['use_breakpad_tools']:
with Step('breakpad configure', status):
@@ -531,12 +467,11 @@ def Main():
if context.Windows():
SetupWindowsEnvironment(context)
elif context.Linux():
- if context['android']:
- SetupAndroidEnvironment(context)
- else:
+ if not context['android']:
SetupLinuxEnvironment(context)
elif context.Mac():
- SetupMacEnvironment(context)
+ # No setup to do for Mac.
+ pass
else:
raise Exception("Unsupported platform.")
RunBuild(BuildScript, status)
« no previous file with comments | « buildbot/buildbot_selector.py ('k') | buildbot/buildbot_toolchain_build.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698