def FTSlave(config): # Run SWTBot tests if len(sys.argv) > 0: scriptdir = os.path.dirname(sys.argv[0]) builddir = os.path.join(scriptdir, '..', '..', 'editor', 'build') testScript = os.path.join(builddir, 'testswteditor.py') cmd = [sys.executable, testScript] try: subprocess.call(cmd, shell=IsWindows()) except: pass # Prepare to run EggPlant tests with bot.BuildStep('Fetching editor'): revision = int(os.environ['BUILDBOT_GOT_REVISION']) bot_name, _ = bot.GetBotName() print bot_name channel = bot_utils.GetChannelFromName(bot_name) namer = bot_utils.GCSNamer(channel=channel) system = config.system if system == 'mac': system = 'macos' editor_path = namer.editor_zipfilepath(revision, system, 'x64') gsutils = bot_utils.GSUtil() editor_location = '/home/chrome-bot/Desktop' if system == 'macos': editor_location = '/Users/chrome-bot/Desktop' local_path = os.path.join(editor_location, 'editor.zip') if os.path.exists(local_path): os.remove(local_path) local_extracted = os.path.join(editor_location, 'dart') shutil.rmtree(local_extracted, ignore_errors=True) gsutils.execute(['cp', editor_path, local_path]) Run(['unzip', local_path, '-d', editor_location])
def main(): name, is_buildbot = bot.GetBotName() cross_vm_pattern_match = re.match(CROSS_VM, name) target_vm_pattern_match = re.match(TARGET_VM, name) if cross_vm_pattern_match: arch = cross_vm_pattern_match.group(1) mode = cross_vm_pattern_match.group(2) cross_compiling_builder(arch, mode) elif target_vm_pattern_match: arch = target_vm_pattern_match.group(1) mode = target_vm_pattern_match.group(2) target_builder(arch, mode) else: raise Exception("Unknown builder name %s" % name)
def VersionSteps(build_info): with bot.BuildStep('Version file sanity checking'): bot_name, _ = bot.GetBotName() channel = bot_utils.GetChannelFromName(bot_name) if channel == bot_utils.Channel.BLEEDING_EDGE: print 'No sanity checking on bleeding edge' else: assert (channel == bot_utils.Channel.STABLE or channel == bot_utils.Channel.DEV) latest_version = GetLatestVersionFromGCS(channel) version = utils.GetVersion() print 'Latests version on GCS: %s' % latest_version print 'Version currently building: %s' % version if not ValidateChannelVersion(latest_version, channel): print "Validation failed" sys.exit(1) else: print 'Version file changed, sanity checks passed'
def FTSlave(config): with bot.BuildStep('Fetching editor'): revision = int(os.environ['BUILDBOT_GOT_REVISION']) bot_name, _ = bot.GetBotName() print bot_name channel = bot_utils.GetChannelFromName(bot_name) namer = bot_utils.GCSNamer(channel=channel) system = config.system if system == 'mac': system = 'macos' editor_path = namer.editor_zipfilepath(revision, system, 'x64') gsutils = bot_utils.GSUtil() editor_location = '/home/chrome-bot/Desktop' if system == 'macos': editor_location = '/Users/chrome-bot/Desktop' local_path = os.path.join(editor_location, 'editor.zip') if os.path.exists(local_path): os.remove(local_path) local_extracted = os.path.join(editor_location, 'dart') shutil.rmtree(local_extracted, ignore_errors=True) gsutils.execute(['cp', editor_path, local_path]) Run(['unzip', local_path, '-d', editor_location])
#!/usr/bin/env python # # Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import os import os.path import shutil import sys import subprocess import bot import bot_utils utils = bot_utils.GetUtils() BUILD_OS = utils.GuessOS() (bot_name, _) = bot.GetBotName() CHANNEL = bot_utils.GetChannelFromName(bot_name) if __name__ == '__main__': print "This step should run dartdevc tests" print "Current directory when running on a bot should be" print "/b/build/slave/[builder name]/build/sdk"
def Main(): name, _ = bot.GetBotName() dartino_match = re.match(DARTINO_REGEXP, name) cross_match = re.match(CROSS_REGEXP, name) target_match = re.match(TARGET_REGEXP, name) if not dartino_match and not cross_match and not target_match: raise Exception('Invalid buildername') SetupClangEnvironment(utils.GuessOS()) SetupJavaEnvironment(utils.GuessOS()) # Clobber build directory if the checkbox was pressed on the BB. with utils.ChangedWorkingDirectory(DARTINO_PATH): bot.Clobber() # Accumulate daemon logs messages in '.debug.log' to be displayed on the # buildbot.Log with utils.ChangedWorkingDirectory(DARTINO_PATH): StepsCleanLogs() with open(DEBUG_LOG, 'w') as debug_log: if dartino_match: system = dartino_match.group('system') if system == 'lk': StepsLK(debug_log) elif system == 'free-rtos': StepsFreeRtos(debug_log) else: modes = ['debug', 'release'] archs = ['ia32', 'x64'] asans = [False] embedded_libs = [False] # Split configurations? partial_configuration =\ dartino_match.group('partial_configuration') != None if partial_configuration: architecture_match = dartino_match.group( 'architecture') archs = { 'x86': ['ia32', 'x64'], 'x64': ['x64'], 'ia32': ['ia32'], }[architecture_match] modes = [dartino_match.group('mode')] asans = [bool(dartino_match.group('asan'))] embedded_libs = [ bool(dartino_match.group('embedded_libs')) ] sdk_build = dartino_match.group('sdk') if sdk_build: StepsSDK(debug_log, system, modes, archs, embedded_libs) else: StepsNormal(debug_log, system, modes, archs, asans, embedded_libs) elif cross_match: system = cross_match.group(1) arch = cross_match.group(2) assert system == 'linux' assert arch == 'arm' modes = ['debug', 'release'] arch = 'xarm' StepsCrossBuilder(debug_log, system, modes, arch) elif target_match: assert target_match.group(1) == 'linux' system = 'linux' mode = target_match.group(2) arch = 'xarm' StepsTargetRunner(debug_log, system, mode, arch) StepsShowLogs() return 1 if bot.HAS_FAILURES else 0
def IsBleedingEdge(): name, _ = bot.GetBotName() channel = bot_utils.GetChannelFromName(name) return channel == bot_utils.Channel.BLEEDING_EDGE
def GetNamer(temporary=False): name, _ = bot.GetBotName() channel = bot_utils.GetChannelFromName(name) return dartino_namer.DartinoGCSNamer(channel, temporary=temporary)
def PackagesSteps(build_info): with bot.BuildStep('Testing packages'): bot_name, _ = bot.GetBotName() print bot_name
def main(): name, is_buildbot = bot.GetBotName() build_py = os.path.join('tools', 'build.py') test_py = os.path.join('tools', 'test.py') cross_vm_pattern_match = re.match(CROSS_VM, name) target_vm_pattern_match = re.match(TARGET_VM, name) if cross_vm_pattern_match: arch = cross_vm_pattern_match.group(1) mode = cross_vm_pattern_match.group(2) bot.Clobber() with bot.BuildStep('Build %s %s' % (arch, mode)): args = [ sys.executable, build_py, '-m%s' % mode, '--arch=%s' % arch, 'runtime' ] run(args) tarball = 'cross_build_%s_%s.tar.bz2' % (arch, mode) try: with bot.BuildStep('Create build tarball'): run([ 'tar', '-cjf', tarball, '--exclude=**/obj', '--exclude=**/obj.host', '--exclude=**/obj.target', '--exclude=**/*analyzer*', 'out/' ]) with bot.BuildStep('Upload build tarball'): uri = "%s/%s" % (GCS_BUCKET, tarball) run([GSUTIL, 'cp', tarball, uri]) run([GSUTIL, 'setacl', 'public-read', uri]) finally: if os.path.exists(tarball): os.remove(tarball) elif target_vm_pattern_match: arch = target_vm_pattern_match.group(1) mode = target_vm_pattern_match.group(2) bot.Clobber() tarball = 'cross_build_%s_%s.tar.bz2' % (arch, mode) try: test_args = [ sys.executable, test_py, '--progress=line', '--report', '--time', '--mode=' + mode, '--arch=' + arch, '--compiler=none', '--runtime=vm', '--write-debug-log' ] with bot.BuildStep('Fetch build tarball'): run([GSUTIL, 'cp', "%s/%s" % (GCS_BUCKET, tarball), tarball]) with bot.BuildStep('Unpack build tarball'): run(['tar', '-xjf', tarball]) with bot.BuildStep('tests'): run(test_args) with bot.BuildStep('checked_tests'): run(test_args + ['--checked']) finally: if os.path.exists(tarball): os.remove(tarball) else: raise Exception("Unknown builder name %s" % name)
gsutil = bot_utils.GSUtil() revision = utils.GetArchiveVersion() # Archive the src tar to the src dir remote_tarfile = '/'.join( [namer.src_directory(revision), os.path.basename(tarfile)]) gsutil.upload(tarfile, remote_tarfile, public=True) # Archive all files except the tar file to the linux packages dir for entry in os.listdir(builddir): full_path = os.path.join(builddir, entry) # We expect a flat structure, not subdirectories assert (os.path.isfile(full_path)) if full_path != tarfile: package_dir = namer.linux_packages_directory(revision) remote_file = '/'.join([package_dir, os.path.basename(entry)]) gsutil.upload(full_path, remote_file, public=True) if __name__ == '__main__': bot_name, _ = bot.GetBotName() channel = bot_utils.GetChannelFromName(bot_name) if channel != bot_utils.Channel.BLEEDING_EDGE: builddir = os.path.join(bot_utils.DART_DIR, utils.GetBuildDir(HOST_OS), 'src_and_installation') version = utils.GetVersion() tarfilename = 'dart-%s.tar.gz' % version tarfile = os.path.join(builddir, tarfilename) ArchiveArtifacts(tarfile, builddir, channel) else: print 'Not uploading artifacts on bleeding edge'
def GetNamer(temporary=False): name, _ = bot.GetBotName() channel = bot_utils.GetChannelFromName(name) return fletch_namer.FletchGCSNamer(channel, temporary=temporary)
def Main(): name, _ = bot.GetBotName() fletch_match = re.match(FLETCH_REGEXP, name) cross_match = re.match(CROSS_REGEXP, name) target_match = re.match(TARGET_REGEXP, name) if not fletch_match and not cross_match and not target_match: raise Exception('Invalid buildername') SetupClangEnvironment(utils.GuessOS()) # TODO(ager/kustermann): We temporarily disable the leak detector due to # flakiness on our buildbot of the following form: # # ASAN:SIGSEGV # ==10777==LeakSanitizer has encountered a fatal error. # # See https://github.com/dart-lang/fletch/issues/56. DisableMemoryLeakDetector() # Clobber build directory if the checkbox was pressed on the BB. with utils.ChangedWorkingDirectory(FLETCH_PATH): bot.Clobber() # Accumulate daemon logs messages in '.debug.log' to be displayed on the # buildbot.Log with open(DEBUG_LOG, 'w') as debug_log: with utils.ChangedWorkingDirectory(FLETCH_PATH): if fletch_match: system = fletch_match.group(1) modes = ['debug', 'release'] archs = ['ia32', 'x64'] asans = [False, True] # Split configurations? partial_configuration = fletch_match.group(2) if partial_configuration: mode_or_asan = fletch_match.group(3) architecture_match = fletch_match.group(4) archs = { 'x86' : ['ia32', 'x64'], }[architecture_match] # We split our builders into: # fletch-linux-debug # fletch-linux-release # fletch-linux-asan (includes debug and release) if mode_or_asan == 'asan': modes = ['debug', 'release'] asans = [True] else: modes = [mode_or_asan] asans = [False] StepsNormal(debug_log, system, modes, archs, asans) elif cross_match: system = cross_match.group(1) arch = cross_match.group(2) assert system == 'linux' assert arch == 'arm' modes = ['debug', 'release'] arch = 'xarm' StepsCrossBuilder(debug_log, system, modes, arch) elif target_match: assert target_match.group(1) == 'linux' system = 'linux' mode = target_match.group(2) arch = 'xarm' StepsTargetRunner(debug_log, system, mode, arch)
def SrcSteps(build_info): # We always clobber the bot, to not leave old tarballs and packages # floating around the out dir. bot.Clobber(force=True) version = utils.GetVersion() builddir = os.path.join(bot_utils.DART_DIR, utils.GetBuildDir(HOST_OS), 'src_and_installation') if not os.path.exists(builddir): os.makedirs(builddir) tarfilename = 'dart-%s.tar.gz' % version tarfile = os.path.join(builddir, tarfilename) with bot.BuildStep('Validating linux system'): print 'Validating that we are on debian jessie' args = ['cat', '/etc/os-release'] (stdout, stderr, exitcode) = bot_utils.run(args) if exitcode != 0: print "Could not find linux system, exiting" sys.exit(1) if not "jessie" in stdout: print "Trying to build debian bits but not on debian Jessie" print "You can't fix this, please contact whesse@" sys.exit(1) with bot.BuildStep('Create src tarball'): print 'Building src tarball' Run([ sys.executable, './tools/create_tarball.py', '--tar_filename', tarfile ]) print 'Building Debian packages' Run([ sys.executable, './tools/create_debian_packages.py', '--tar_filename', tarfile, '--out_dir', builddir ]) with bot.BuildStep('Sanity check installation'): if os.path.exists('/usr/bin/dart') or os.path.exists( '/usr/lib/dart/bin/dart2js'): print "Dart already installed, removing" UninstallDart() TestInstallation(assume_installed=False) InstallFromDep(builddir) TestInstallation(assume_installed=True) # We build the runtime target to get everything we need to test the # standalone target. Run([ sys.executable, './tools/build.py', '-mrelease', '-ax64', 'runtime' ]) # Copy in the installed binary to avoid poluting /usr/bin (and having to # run as root) Run(['cp', '/usr/bin/dart', 'out/ReleaseX64/dart']) # We currently can't run the testing script on wheezy since the checked in # binary is built on precise, see issue 18742 # TODO(18742): Run './tools/test.py' '-mrelease' 'standalone' # Sanity check dart2js and the analyzer against a hello world program with utils.TempDir() as temp_dir: test_file = CreateDartTestFile(temp_dir) Run(['/usr/lib/dart/bin/dart2js', test_file]) Run(['/usr/lib/dart/bin/dartanalyzer', test_file]) Run(['/usr/lib/dart/bin/dart', test_file]) # Sanity check that pub can start up and print the version Run(['/usr/lib/dart/bin/pub', '--version']) UninstallDart() TestInstallation(assume_installed=False) with bot.BuildStep('Upload artifacts'): bot_name, _ = bot.GetBotName() channel = bot_utils.GetChannelFromName(bot_name) if channel != bot_utils.Channel.BLEEDING_EDGE: ArchiveArtifacts(tarfile, builddir, channel) else: print 'Not uploading artifacts on bleeding edge'
def Main(): name, _ = bot.GetBotName() fletch_match = re.match(FLETCH_REGEXP, name) cross_match = re.match(CROSS_REGEXP, name) target_match = re.match(TARGET_REGEXP, name) if not fletch_match and not cross_match and not target_match: raise Exception('Invalid buildername') SetupClangEnvironment(utils.GuessOS()) SetupJavaEnvironment(utils.GuessOS()) # Clobber build directory if the checkbox was pressed on the BB. with utils.ChangedWorkingDirectory(FLETCH_PATH): bot.Clobber() # Accumulate daemon logs messages in '.debug.log' to be displayed on the # buildbot.Log with open(DEBUG_LOG, 'w') as debug_log: with utils.ChangedWorkingDirectory(FLETCH_PATH): if fletch_match: system = fletch_match.group(1) if system == 'lk': StepsLK(debug_log) return modes = ['debug', 'release'] archs = ['ia32', 'x64'] asans = [False] # Split configurations? partial_configuration = fletch_match.group(2) if partial_configuration: mode = fletch_match.group(3) asan = fletch_match.group(4) architecture_match = fletch_match.group(5) archs = { 'x86': ['ia32', 'x64'], 'x64': ['x64'], 'ia32': ['ia32'], }[architecture_match] modes = [mode] asans = [bool(asan)] sdk_build = fletch_match.group(6) if sdk_build: StepsSDK(debug_log, system, modes, archs) else: StepsNormal(debug_log, system, modes, archs, asans) elif cross_match: system = cross_match.group(1) arch = cross_match.group(2) assert system == 'linux' assert arch == 'arm' modes = ['debug', 'release'] arch = 'xarm' StepsCrossBuilder(debug_log, system, modes, arch) elif target_match: assert target_match.group(1) == 'linux' system = 'linux' mode = target_match.group(2) arch = 'xarm' StepsTargetRunner(debug_log, system, mode, arch)