コード例 #1
0
ファイル: build_sdk.py プロジェクト: zoritle/chromium
def BuildStepBuildAppEngine(pepperdir, chrome_revision):
  """Build the projects found in src/gonacl_appengine/src"""
  buildbot_common.BuildStep('Build GoNaCl AppEngine Projects')
  cmd = ['make', 'upload', 'REVISION=%s' % chrome_revision]
  env = dict(os.environ)
  env['NACL_SDK_ROOT'] = pepperdir
  env['NACLPORTS_NO_ANNOTATE'] = "1"
  buildbot_common.Run(cmd, env=env, cwd=GONACL_APPENGINE_SRC_DIR)
コード例 #2
0
def BuildStepDownloadToolchains():
    buildbot_common.BuildStep('Running download_toolchains.py')
    download_script = os.path.join('build', 'download_toolchains.py')
    buildbot_common.Run([
        sys.executable, download_script, '--no-arm-trusted', '--arm-untrusted',
        '--keep'
    ],
                        cwd=NACL_DIR)
コード例 #3
0
ファイル: build_sdk.py プロジェクト: subhanshuja/ofa
def BuildStepCleanPepperDirs(pepperdir, pepperdir_old):
    buildbot_common.BuildStep('Clean Pepper Dirs')
    dirs_to_remove = (pepperdir, pepperdir_old,
                      os.path.join(OUT_DIR, 'arm_trusted'))
    for dirname in dirs_to_remove:
        if os.path.exists(dirname):
            buildbot_common.RemoveDir(dirname)
    buildbot_common.MakeDir(pepperdir)
コード例 #4
0
def BuildStepDownloadToolchains(toolchains):
  buildbot_common.BuildStep('Running package_version.py')
  args = [sys.executable, PKGVER, '--exclude', 'arm_trusted']
  if 'bionic' in toolchains:
    build_platform = '%s_x86' % getos.GetPlatform()
    args.extend(['--append', os.path.join(build_platform, 'nacl_arm_bionic')])
  args.append('sync')
  buildbot_common.Run(args, cwd=NACL_DIR)
コード例 #5
0
def BuildStepVerifyFilelist(pepperdir):
    buildbot_common.BuildStep('Verify SDK Files')
    file_list_path = os.path.join(SCRIPT_DIR, 'sdk_files.list')
    try:
        verify_filelist.Verify(file_list_path, pepperdir)
        print 'OK'
    except verify_filelist.ParseException, e:
        buildbot_common.ErrorExit('Parsing sdk_files.list failed:\n\n%s' % e)
コード例 #6
0
def BuildStepTarBundle(pepper_ver, tarfile):
    buildbot_common.BuildStep('Tar Pepper Bundle')
    buildbot_common.MakeDir(os.path.dirname(tarfile))
    buildbot_common.Run([
        sys.executable, CYGTAR, '-C', OUT_DIR, '-cjf', tarfile,
        'pepper_' + pepper_ver
    ],
                        cwd=NACL_DIR)
コード例 #7
0
def BuildStepBuildToolchains(pepperdir, toolchains):
    buildbot_common.BuildStep('SDK Items')

    GypNinjaBuild_NaCl(GYPBUILD_DIR)
    GypNinjaBuild_Breakpad(GYPBUILD_DIR)

    platform = getos.GetPlatform()
    tcname = platform + '_x86'
    newlibdir = os.path.join(pepperdir, 'toolchain', tcname + '_newlib')
    glibcdir = os.path.join(pepperdir, 'toolchain', tcname + '_glibc')
    pnacldir = os.path.join(pepperdir, 'toolchain', tcname + '_pnacl')

    if set(toolchains) & set(['glibc', 'newlib']):
        GypNinjaBuild_PPAPI('ia32', GYPBUILD_DIR)

    if 'arm' in toolchains:
        GypNinjaBuild_PPAPI('arm', GYPBUILD_DIR + '-arm')

    GypNinjaInstall(pepperdir, toolchains)

    if 'newlib' in toolchains:
        InstallNaClHeaders(GetToolchainNaClInclude('newlib', newlibdir, 'x86'),
                           'newlib')

    if 'glibc' in toolchains:
        InstallNaClHeaders(GetToolchainNaClInclude('glibc', glibcdir, 'x86'),
                           'glibc')

    if 'arm' in toolchains:
        tcname = platform + '_arm_newlib'
        armdir = os.path.join(pepperdir, 'toolchain', tcname)
        InstallNaClHeaders(GetToolchainNaClInclude('newlib', armdir, 'arm'),
                           'arm')

    if 'pnacl' in toolchains:
        # NOTE: For ia32, gyp builds both x86-32 and x86-64 by default.
        for arch in ('ia32', 'arm'):
            # Fill in the latest native pnacl shim library from the chrome build.
            build_dir = GYPBUILD_DIR + '-pnacl-' + arch
            GypNinjaBuild_Pnacl(build_dir, arch)
            if arch == 'ia32':
                nacl_arches = ['x86-32', 'x86-64']
            elif arch == 'arm':
                nacl_arches = ['arm']
            else:
                buildbot_common.ErrorExit('Unknown architecture: %s' % arch)
            for nacl_arch in nacl_arches:
                release_build_dir = os.path.join(OUT_DIR, build_dir, 'Release',
                                                 'gen', 'tc_pnacl_translate',
                                                 'lib-' + nacl_arch)

                buildbot_common.CopyFile(
                    os.path.join(release_build_dir, 'libpnacl_irt_shim.a'),
                    GetPNaClNativeLib(pnacldir, nacl_arch))

        InstallNaClHeaders(GetToolchainNaClInclude('pnacl', pnacldir, 'x86'),
                           'newlib')
コード例 #8
0
def BuildStepArchiveSDKTools():
    # Only push up sdk_tools.tgz and nacl_sdk.zip on the linux buildbot.
    builder_name = os.getenv('BUILDBOT_BUILDERNAME', '')
    if builder_name == 'linux-sdk-multi':
        buildbot_common.BuildStep('Build SDK Tools')
        build_updater.BuildUpdater(OUT_DIR)

        buildbot_common.BuildStep('Archive SDK Tools')
        bucket_path = 'nativeclient-mirror/nacl/nacl_sdk/%s' % (
            build_version.ChromeVersion(), )
        buildbot_common.Archive('sdk_tools.tgz',
                                bucket_path,
                                OUT_DIR,
                                step_link=False)
        buildbot_common.Archive('nacl_sdk.zip',
                                bucket_path,
                                OUT_DIR,
                                step_link=False)
コード例 #9
0
def BuildStepUntarToolchains(pepperdir, platform, arch, toolchains):
  buildbot_common.BuildStep('Untar Toolchains')
  tcname = platform + '_' + arch
  tmpdir = os.path.join(SRC_DIR, 'out', 'tc_temp')
  buildbot_common.RemoveDir(tmpdir)
  buildbot_common.MakeDir(tmpdir)

  if 'newlib' in toolchains:
    # Untar the newlib toolchains
    tarfile = GetNewlibToolchain(platform, arch)
    buildbot_common.Run([sys.executable, CYGTAR, '-C', tmpdir, '-xf', tarfile],
                        cwd=NACL_DIR)

    # Then rename/move it to the pepper toolchain directory
    srcdir = os.path.join(tmpdir, 'sdk', 'nacl-sdk')
    newlibdir = os.path.join(pepperdir, 'toolchain', tcname + '_newlib')
    buildbot_common.Move(srcdir, newlibdir)

  if 'glibc' in toolchains:
    # Untar the glibc toolchains
    tarfile = GetGlibcToolchain(platform, arch)
    buildbot_common.Run([sys.executable, CYGTAR, '-C', tmpdir, '-xf', tarfile],
                        cwd=NACL_DIR)

    # Then rename/move it to the pepper toolchain directory
    srcdir = os.path.join(tmpdir, 'toolchain', tcname)
    glibcdir = os.path.join(pepperdir, 'toolchain', tcname + '_glibc')
    buildbot_common.Move(srcdir, glibcdir)

  # Untar the pnacl toolchains
  if 'pnacl' in toolchains:
    tmpdir = os.path.join(tmpdir, 'pnacl')
    buildbot_common.RemoveDir(tmpdir)
    buildbot_common.MakeDir(tmpdir)
    tarfile = GetPNaClToolchain(platform, arch)
    buildbot_common.Run([sys.executable, CYGTAR, '-C', tmpdir, '-xf', tarfile],
                        cwd=NACL_DIR)

    # Then rename/move it to the pepper toolchain directory
    pnacldir = os.path.join(pepperdir, 'toolchain', tcname + '_pnacl')
    buildbot_common.Move(tmpdir, pnacldir)

  if options.gyp and sys.platform not in ['cygwin', 'win32']:
    # If the gyp options is specified we install a toolchain
    # wrapper so that gyp can switch toolchains via a commandline
    # option.
    bindir = os.path.join(pepperdir, 'toolchain', tcname, 'bin')
    wrapper = os.path.join(SDK_SRC_DIR, 'tools', 'compiler-wrapper.py')
    buildbot_common.MakeDir(bindir)
    buildbot_common.CopyFile(wrapper, bindir)

    # Module 'os' has no 'symlink' member (on Windows).
    # pylint: disable=E1101

    os.symlink('compiler-wrapper.py', os.path.join(bindir, 'i686-nacl-g++'))
    os.symlink('compiler-wrapper.py', os.path.join(bindir, 'i686-nacl-gcc'))
    os.symlink('compiler-wrapper.py', os.path.join(bindir, 'i686-nacl-ar'))
コード例 #10
0
def BuildStepBuildToolchains(pepperdir, platform, toolchains):
  buildbot_common.BuildStep('SDK Items')

  GypNinjaBuild_NaCl(platform, 'gypbuild')

  tcname = platform + '_x86'
  newlibdir = os.path.join(pepperdir, 'toolchain', tcname + '_newlib')
  glibcdir = os.path.join(pepperdir, 'toolchain', tcname + '_glibc')
  pnacldir = os.path.join(pepperdir, 'toolchain', tcname + '_pnacl')

  # Run scons TC build steps
  if set(toolchains) & set(['glibc', 'newlib']):
    GypNinjaBuild_Chrome('ia32', 'gypbuild')

  if 'arm' in toolchains:
    GypNinjaBuild_Chrome('arm', 'gypbuild-arm')

  GypNinjaInstall(pepperdir, platform, toolchains)

  if 'newlib' in toolchains:
    InstallNaClHeaders(GetToolchainNaClInclude('newlib', newlibdir, 'x86'),
                       'newlib')

  if 'glibc' in toolchains:
    InstallNaClHeaders(GetToolchainNaClInclude('glibc', glibcdir, 'x86'),
                       'glibc')

  if 'arm' in toolchains:
    tcname = platform + '_arm_newlib'
    armdir = os.path.join(pepperdir, 'toolchain', tcname)
    InstallNaClHeaders(GetToolchainNaClInclude('newlib', armdir, 'arm'),
                       'arm')

  if 'pnacl' in toolchains:
    shell = platform == 'win'
    buildbot_common.Run(
        GetBuildArgs('pnacl', pnacldir, pepperdir, 'x86', '32'),
        cwd=NACL_DIR, shell=shell)
    buildbot_common.Run(
        GetBuildArgs('pnacl', pnacldir, pepperdir, 'x86', '64'),
        cwd=NACL_DIR, shell=shell)

    for arch in ('ia32', 'arm'):
      # Fill in the latest native pnacl shim library from the chrome build.
      build_dir = 'gypbuild-pnacl-' + arch
      GypNinjaBuild_Pnacl(build_dir, arch)
      pnacl_libdir_map = {'ia32': 'x86-64', 'arm': 'arm'}
      release_build_dir = os.path.join(OUT_DIR, build_dir, 'Release',
                                       'gen', 'tc_pnacl_translate',
                                       'lib-' + pnacl_libdir_map[arch])

      buildbot_common.CopyFile(
          os.path.join(release_build_dir, 'libpnacl_irt_shim.a'),
          GetPNaClNativeLib(pnacldir, pnacl_libdir_map[arch]))

    InstallNaClHeaders(GetToolchainNaClInclude('pnacl', pnacldir, 'x86'),
                       'newlib')
コード例 #11
0
ファイル: buildbot_run.py プロジェクト: fakedrake/chromium
def StepArmRunHooks():
    if getos.GetPlatform() != 'linux':
        return
    # Run 'gclient runhooks' for arm, as some arm specific tools are only
    # installed in that case.
    buildbot_common.BuildStep('gclient runhooks for arm')
    env = dict(os.environ)
    env['GYP_DEFINES'] = 'target_arch=arm'
    Run(['gclient', 'runhooks'], env=env, cwd=SDK_SRC_DIR)
コード例 #12
0
def main(args):
    parser = argparse.ArgumentParser()
    parser.add_argument('--install-dir',
                        help='Install Directory',
                        dest='install_dir',
                        default='naclmono')
    parser.add_argument('--tar-path',
                        help='Tarfile path',
                        dest='tar_path',
                        default='naclmono_%pepperrev%.bz2')
    parser.add_argument(
        '--upload-path',
        help='Upload path (nativeclient-mirror/nacl/nacl_sdk/XXX)',
        dest='upload_path',
        default=None)
    parser.add_argument('--pepper-revision',
                        help='Pepper revision',
                        dest='pepper_revision',
                        default=None)
    parser.add_argument('--skip-upload',
                        help='Skips upload step',
                        action="store_true",
                        dest='skip_upload')
    options = parser.parse_args(args)

    if not options.upload_path:
        buildbot_common.ErrorExit('--upload-path is required')
    if not options.pepper_revision:
        buildbot_common.ErrorExit('--pepper-revision is required')

    options.tar_path = options.tar_path.replace('%pepperrev%',
                                                options.pepper_revision)

    install_folders = [
        'bin', 'etc', 'include', 'lib', 'lib32', 'libarm', 'share'
    ]

    buildbot_common.BuildStep('Archive Build')
    tar_file = None
    buildbot_common.RemoveFile(options.tar_path)
    try:
        tar_file = tarfile.open(options.tar_path,
                                mode='w:bz2',
                                dereference=True)
        for subfolder in install_folders:
            tar_file.add(os.path.join(options.install_dir, subfolder),
                         arcname=subfolder)
    finally:
        if tar_file:
            tar_file.close()

    if not options.skip_upload:
        buildbot_common.Archive(
            os.path.basename(options.tar_path),
            'nativeclient-mirror/nacl/nacl_sdk/%s' % options.upload_path,
            cwd=os.path.dirname(os.path.abspath(options.tar_path)))
コード例 #13
0
def BuildStepMakeAll(pepperdir,
                     directory,
                     step_name,
                     deps=True,
                     clean=False,
                     config='Debug',
                     args=None):
    buildbot_common.BuildStep(step_name)
    build_projects.BuildProjectsBranch(pepperdir, directory, clean, deps,
                                       config, args)
コード例 #14
0
def BuildStepDownloadToolchains(toolchains):
    buildbot_common.BuildStep('Running download_toolchains.py')
    download_script = os.path.join('build', 'download_toolchains.py')
    args = [
        sys.executable, download_script, '--no-arm-trusted', '--arm-untrusted',
        '--keep'
    ]
    if 'bionic' in toolchains:
        args.append('--allow-bionic')
    buildbot_common.Run(args, cwd=NACL_DIR)
コード例 #15
0
def StepRunSelLdrTests(pepperdir, sanitizer):
  filters = {
    'SEL_LDR': True
  }

  tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, include=filters)

  def RunTest(test, toolchain, config, arch=None):
    args = ['STANDALONE=1', 'TOOLCHAIN=%s' % toolchain]
    args += GetSanitizerArgs(sanitizer)
    if arch is not None:
      args.append('NACL_ARCH=%s' % arch)

    build_projects.BuildProjectsBranch(pepperdir, test, clean=False,
                                       deps=False, config=config,
                                       args=args + ['run'])

  if getos.GetPlatform() == 'win':
    # On win32 we only support running on the system
    # arch
    archs = (getos.GetSystemArch('win'),)
  elif getos.GetPlatform() == 'mac':
    # We only ship 64-bit version of sel_ldr on mac.
    archs = ('x86_64',)
  else:
    # On linux we can run both 32 and 64-bit, and arm (via qemu)
    archs = ('x86_64', 'x86_32', 'arm')

  for root, projects in tree.iteritems():
    for project in projects:
      if sanitizer:
        sanitizer_name = '[sanitizer=%s]'  % sanitizer
      else:
        sanitizer_name = ''
      title = 'standalone test%s: %s' % (sanitizer_name,
                                         os.path.basename(project['NAME']))
      location = os.path.join(root, project['NAME'])
      buildbot_common.BuildStep(title)
      configs = ('Debug', 'Release')

      # On linux we can run the standalone tests natively using the host
      # compiler.
      if getos.GetPlatform() == 'linux':
        if sanitizer:
          configs = ('Debug',)
        for config in configs:
          RunTest(location, 'linux', config)

      if sanitizer:
        continue

      for toolchain in ('clang-newlib', 'glibc', 'pnacl'):
        for arch in archs:
          for config in configs:
            RunTest(location, toolchain, config, arch)
コード例 #16
0
def BuildStepTarNaClPorts(pepper_ver, tarfile):
  """Create tar archive containing headers and libs from naclports build."""
  buildbot_common.BuildStep('Tar naclports Bundle')
  buildbot_common.MakeDir(os.path.dirname(tarfile))
  pepper_dir = 'pepper_%s' % pepper_ver
  archive_dirs = [os.path.join(pepper_dir, 'ports')]

  ports_out = os.path.join(NACLPORTS_DIR, 'out', 'sdk_bundle')
  cmd = [sys.executable, CYGTAR, '-C', ports_out, '-cjf', tarfile]
  cmd += archive_dirs
  buildbot_common.Run(cmd, cwd=NACL_DIR)
コード例 #17
0
ファイル: buildbot_run.py プロジェクト: fakedrake/chromium
def StepRunUnittests():
    buildbot_common.BuildStep('Run unittests')

    # Our tests shouldn't be using the proxy; they should all be connecting to
    # localhost. Some slaves can't route HTTP traffic through the proxy to
    # localhost (we get 504 gateway errors), so we clear it here.
    env = dict(os.environ)
    if 'http_proxy' in env:
        del env['http_proxy']

    Run([sys.executable, 'test_all.py', '-v'], env=env, cwd=SDK_SRC_DIR)
コード例 #18
0
def BuildToolchains(pepperdir, platform, arch, pepper_ver, toolchains):
    buildbot_common.BuildStep('SDK Items')

    tcname = platform + '_' + arch
    newlibdir = os.path.join(pepperdir, 'toolchain', tcname + '_newlib')
    glibcdir = os.path.join(pepperdir, 'toolchain', tcname + '_glibc')
    pnacldir = os.path.join(pepperdir, 'toolchain', tcname + '_pnacl')

    # Run scons TC build steps
    if arch == 'x86':
        if 'newlib' in toolchains:
            buildbot_common.Run(GetBuildArgs('newlib', newlibdir, pepperdir,
                                             'x86', '32'),
                                cwd=NACL_DIR,
                                shell=(platform == 'win'))
            buildbot_common.Run(GetBuildArgs('newlib', newlibdir, pepperdir,
                                             'x86', '64'),
                                cwd=NACL_DIR,
                                shell=(platform == 'win'))
            InstallHeaders(GetToolchainNaClInclude('newlib', newlibdir, 'x86'),
                           pepper_ver, 'newlib')

        if 'glibc' in toolchains:
            buildbot_common.Run(GetBuildArgs('glibc', glibcdir, pepperdir,
                                             'x86', '32'),
                                cwd=NACL_DIR,
                                shell=(platform == 'win'))
            buildbot_common.Run(GetBuildArgs('glibc', glibcdir, pepperdir,
                                             'x86', '64'),
                                cwd=NACL_DIR,
                                shell=(platform == 'win'))
            InstallHeaders(GetToolchainNaClInclude('glibc', glibcdir, 'x86'),
                           pepper_ver, 'glibc')

        if 'pnacl' in toolchains:
            buildbot_common.Run(GetBuildArgs('pnacl', pnacldir, pepperdir,
                                             'x86', '32'),
                                cwd=NACL_DIR,
                                shell=(platform == 'win'))
            buildbot_common.Run(GetBuildArgs('pnacl', pnacldir, pepperdir,
                                             'x86', '64'),
                                cwd=NACL_DIR,
                                shell=(platform == 'win'))
            # Pnacl libraries are typically bitcode, but some are native and
            # will be looked up in the native library directory.
            buildbot_common.Move(
                os.path.join(
                    GetToolchainNaClLib('pnacl', pnacldir, 'x86', '64'),
                    'libpnacl_irt_shim.a'),
                GetPNaClNativeLib(pnacldir, 'x86-64'))
            InstallHeaders(GetToolchainNaClInclude('pnacl', pnacldir, 'x86'),
                           pepper_ver, 'newlib')
    else:
        buildbot_common.ErrorExit('Missing arch %s' % arch)
コード例 #19
0
def BuildStepSyncNaClPorts():
  """Pull the pinned revision of naclports from SVN."""
  buildbot_common.BuildStep('Sync naclports')
  if not os.path.exists(NACLPORTS_DIR):
    # checkout new copy of naclports
    cmd = ['svn', 'checkout', '-q', '-r', str(NACLPORTS_REV), NACLPORTS_URL,
           'naclports']
    buildbot_common.Run(cmd, cwd=os.path.dirname(NACLPORTS_DIR))
  else:
    # sync existing copy to pinned revision.
    cmd = ['svn', 'update', '-r', str(NACLPORTS_REV)]
    buildbot_common.Run(cmd, cwd=NACLPORTS_DIR)
コード例 #20
0
def BuildUpdater():
    buildbot_common.BuildStep('Create Updater')

    naclsdkdir = os.path.join(OUT_DIR, 'nacl_sdk')
    tooldir = os.path.join(naclsdkdir, 'sdk_tools')
    cachedir = os.path.join(naclsdkdir, 'sdk_cache')
    buildtoolsdir = os.path.join(SDK_SRC_DIR, 'build_tools')

    # Build SDK directory
    buildbot_common.RemoveDir(naclsdkdir)
    buildbot_common.MakeDir(naclsdkdir)
    buildbot_common.MakeDir(tooldir)
    buildbot_common.MakeDir(cachedir)

    # Copy launch scripts
    buildbot_common.CopyFile(os.path.join(buildtoolsdir, 'naclsdk'),
                             naclsdkdir)
    buildbot_common.CopyFile(os.path.join(buildtoolsdir, 'naclsdk.bat'),
                             naclsdkdir)

    # Copy base manifest
    json = os.path.join(buildtoolsdir, 'json', 'naclsdk_manifest0.json')
    buildbot_common.CopyFile(json,
                             os.path.join(cachedir, 'naclsdk_manifest2.json'))

    # Copy SDK tools
    sdkupdate = os.path.join(SDK_SRC_DIR, 'build_tools', 'sdk_tools',
                             'sdk_update.py')
    license = os.path.join(SDK_SRC_DIR, 'LICENSE')
    buildbot_common.CopyFile(sdkupdate, tooldir)
    buildbot_common.CopyFile(license, tooldir)
    buildbot_common.CopyFile(CYGTAR, tooldir)

    buildbot_common.RemoveFile(os.path.join(OUT_DIR, 'nacl_sdk.zip'))
    buildbot_common.Run([
        'zip', '-r', 'nacl_sdk.zip', 'nacl_sdk/naclsdk',
        'nacl_sdk/naclsdk.bat', 'nacl_sdk/sdk_tools/LICENSE',
        'nacl_sdk/sdk_tools/cygtar.py', 'nacl_sdk/sdk_tools/sdk_update.py',
        'nacl_sdk/sdk_cache/naclsdk_manifest2.json'
    ],
                        cwd=OUT_DIR)
    args = ['-v', sdkupdate, license, CYGTAR, tooldir]
    tarname = os.path.join(OUT_DIR, 'sdk_tools.tgz')

    buildbot_common.RemoveFile(tarname)
    buildbot_common.Run([
        sys.executable, CYGTAR, '-C', tooldir, '-czf', tarname,
        'sdk_update.py', 'LICENSE', 'cygtar.py'
    ],
                        cwd=NACL_DIR)
    sys.stdout.write('\n')
コード例 #21
0
def BuildStepBuildPNaClComponent(version, revision):
    # Sadly revision can go backwords for a given version since when a version
    # is built from master, revision will be a huge number (in the hundreds of
    # thousands.  Once the branch happens the revision will reset to zero.
    # TODO(sbc): figure out how to compensate for this in some way such that
    # revisions always go forward for a given version.
    buildbot_common.BuildStep('PNaCl Component')
    if len(revision) > 4:
        rev_minor = revision[-4:]
        rev_major = revision[:-4]
        version = "0.%s.%s.%s" % (version, rev_major, rev_minor)
    else:
        version = "0.%s.0.%s" % (version, revision)
    buildbot_common.Run(['./make_pnacl_component.sh', version], cwd=SCRIPT_DIR)
コード例 #22
0
def BuildStepDownloadToolchains(toolchains):
    buildbot_common.BuildStep('Running package_version.py')
    args = [sys.executable, PKGVER, '--mode', 'nacl_core_sdk']
    if 'bionic' in toolchains:
        build_platform = '%s_x86' % getos.GetPlatform()
        args.extend(
            ['--append',
             os.path.join(build_platform, 'nacl_arm_bionic')])
    if getos.GetPlatform() == 'linux':
        # TODO(sbc): remove this once this change makes it into chrome
        # https://codereview.chromium.org/1080513003/
        args.extend(['--append', 'arm_trusted'])
    args.extend(['sync', '--extract'])
    buildbot_common.Run(args, cwd=NACL_DIR)
コード例 #23
0
ファイル: build_sdk.py プロジェクト: Jlakshan/chromium
def BuildStepCopyExamples(pepperdir, toolchains, build_experimental, clobber):
    buildbot_common.BuildStep('Copy examples')

    if not os.path.exists(os.path.join(pepperdir, 'tools')):
        buildbot_common.ErrorExit('Examples depend on missing tools.')
    if not os.path.exists(os.path.join(pepperdir, 'toolchain')):
        buildbot_common.ErrorExit('Examples depend on missing toolchains.')

    exampledir = MakeDirectoryOrClobber(pepperdir, 'examples', clobber)
    libdir = MakeDirectoryOrClobber(pepperdir, 'lib', clobber)

    plat = getos.GetPlatform()
    for arch in LIB_DICT[plat]:
        buildbot_common.MakeDir(
            os.path.join(libdir, '%s_%s_host' % (plat, arch)))
        if options.gyp and plat != 'win':
            configs = ['debug', 'release']
        else:
            configs = ['Debug', 'Release']
        for config in configs:
            buildbot_common.MakeDir(
                os.path.join(libdir, '%s_%s_host' % (plat, arch), config))

    MakeDirectoryOrClobber(pepperdir, 'src', clobber)

    # Copy individual files
    files = ['favicon.ico', 'httpd.cmd']
    for filename in files:
        oshelpers.Copy(
            ['-v', os.path.join(SDK_EXAMPLE_DIR, filename), exampledir])

    args = ['--dstroot=%s' % pepperdir, '--master']
    for toolchain in toolchains:
        if toolchain != 'arm':
            args.append('--' + toolchain)

    for example in EXAMPLE_LIST:
        dsc = os.path.join(SDK_EXAMPLE_DIR, example, 'example.dsc')
        args.append(dsc)

    for library in LIBRARY_LIST:
        dsc = os.path.join(SDK_LIBRARY_DIR, library, 'library.dsc')
        args.append(dsc)

    if build_experimental:
        args.append('--experimental')

    print "Generting Makefiles: %s" % str(args)
    if generate_make.main(args):
        buildbot_common.ErrorExit('Failed to build examples.')
コード例 #24
0
ファイル: test_sdk.py プロジェクト: bopopescu/webrtc-2
def StepCopyTests(pepperdir, toolchains, build_experimental):
    buildbot_common.BuildStep('Copy Tests')

    # Update test libraries and test apps
    filters = {'DEST': ['tests']}
    if not build_experimental:
        filters['EXPERIMENTAL'] = False

    tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, include=filters)
    build_projects.UpdateHelpers(pepperdir, clobber=False)
    build_projects.UpdateProjects(pepperdir,
                                  tree,
                                  clobber=False,
                                  toolchains=toolchains)
コード例 #25
0
def BuildStepBuildToolchains(pepperdir, platform, arch, pepper_ver,
                             toolchains):
  buildbot_common.BuildStep('SDK Items')

  tcname = platform + '_' + arch
  newlibdir = os.path.join(pepperdir, 'toolchain', tcname + '_newlib')
  glibcdir = os.path.join(pepperdir, 'toolchain', tcname + '_glibc')
  pnacldir = os.path.join(pepperdir, 'toolchain', tcname + '_pnacl')

  # Run scons TC build steps
  if arch == 'x86':
    if set(toolchains) & set(['newlib', 'glibc']):
      GypNinjaBuild_X86(pepperdir, platform, toolchains)

    if 'newlib' in toolchains:
      InstallHeaders(GetToolchainNaClInclude('newlib', newlibdir, 'x86'),
                     pepper_ver,
                     'newlib')

    if 'glibc' in toolchains:
      InstallHeaders(GetToolchainNaClInclude('glibc', glibcdir, 'x86'),
                     pepper_ver,
                     'glibc')

    if 'pnacl' in toolchains:
      shell = platform == 'win'
      buildbot_common.Run(
          GetBuildArgs('pnacl', pnacldir, pepperdir, 'x86', '32'),
          cwd=NACL_DIR, shell=shell)
      buildbot_common.Run(
          GetBuildArgs('pnacl', pnacldir, pepperdir, 'x86', '64'),
          cwd=NACL_DIR, shell=shell)

      for arch in ('ia32', 'arm'):
        # Fill in the latest native pnacl shim library from the chrome build.
        GypNinjaBuild_Pnacl('gypbuild-' + arch, arch)
        release_build_dir = os.path.join(OUT_DIR, 'gypbuild-' + arch,
                                         'Release')

        pnacl_libdir_map = { 'ia32': 'x86-64', 'arm': 'arm' }
        buildbot_common.CopyFile(
            os.path.join(release_build_dir, 'libpnacl_irt_shim.a'),
            GetPNaClNativeLib(pnacldir, pnacl_libdir_map[arch]))

      InstallHeaders(GetToolchainNaClInclude('pnacl', pnacldir, 'x86'),
                     pepper_ver,
                     'newlib')
  else:
    buildbot_common.ErrorExit('Missing arch %s' % arch)
コード例 #26
0
def BuildStepUpdateUserProjects(pepperdir, platform, toolchains,
                                build_experimental, clobber):
  buildbot_common.BuildStep('Update examples and libraries')

  filters = {}
  if not build_experimental:
    filters['EXPERIMENTAL'] = False
  if toolchains:
    filters['TOOLS'] = toolchains

  # Update examples and libraries
  filters['DEST'] = ['examples', 'src']

  tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, filters=filters)
  build_projects.UpdateProjects(pepperdir, platform, tree, clobber=clobber,
                                toolchains=toolchains)
コード例 #27
0
ファイル: test_sdk.py プロジェクト: bihubihu/chromium-1
def BuildStepCopyTests(pepperdir, toolchains, build_experimental, clobber):
    buildbot_common.BuildStep('Copy Tests')

    # Update test libraries and test apps
    filters = {'DEST': ['testlibs', 'tests']}
    if not build_experimental:
        filters['EXPERIMENTAL'] = False

    tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, filters=filters)
    platform = getos.GetPlatform()
    build_projects.UpdateHelpers(pepperdir, platform, clobber=clobber)
    build_projects.UpdateProjects(pepperdir,
                                  platform,
                                  tree,
                                  clobber=clobber,
                                  toolchains=toolchains)
コード例 #28
0
def BuildStepUntarToolchains(pepperdir, toolchains):
    buildbot_common.BuildStep('Untar Toolchains')
    platform = getos.GetPlatform()
    build_platform = '%s_x86' % platform
    tmpdir = os.path.join(OUT_DIR, 'tc_temp')
    buildbot_common.RemoveDir(tmpdir)
    buildbot_common.MakeDir(tmpdir)

    # Create a list of extract packages tuples, the first part should be
    # "$PACKAGE_TARGET/$PACKAGE". The second part should be the destination
    # directory relative to pepperdir/toolchain.
    extract_packages = []
    for toolchain in toolchains:
        toolchain_map = TOOLCHAIN_PACKAGE_MAP.get(toolchain, None)
        if toolchain_map:
            package_name, tcdir, _ = toolchain_map
            package_tuple = (os.path.join(build_platform,
                                          package_name), tcdir % {
                                              'platform': platform
                                          })
            extract_packages.append(package_tuple)

    # On linux we also want to extract the arm_trusted package which contains
    # the ARM libraries we ship in support of sel_ldr_arm.
    if platform == 'linux':
        extract_packages.append((os.path.join(build_platform,
                                              'arm_trusted'), 'arm_trusted'))
    if extract_packages:
        # Extract all of the packages into the temp directory.
        package_names = [
            package_tuple[0] for package_tuple in extract_packages
        ]
        buildbot_common.Run([
            sys.executable, PKGVER, '--packages', ','.join(package_names),
            '--tar-dir', NACL_TOOLCHAINTARS_DIR, '--dest-dir', tmpdir,
            'extract'
        ])

        # Move all the packages we extracted to the correct destination.
        for package_name, dest_dir in extract_packages:
            full_src_dir = os.path.join(tmpdir, package_name)
            full_dst_dir = os.path.join(pepperdir, 'toolchain', dest_dir)
            buildbot_common.Move(full_src_dir, full_dst_dir)

    # Cleanup the temporary directory we are no longer using.
    buildbot_common.RemoveDir(tmpdir)
コード例 #29
0
def BuildStepCopyTextFiles(pepperdir, pepper_ver, revision):
  buildbot_common.BuildStep('Add Text Files')
  files = ['AUTHORS', 'COPYING', 'LICENSE']
  files = [os.path.join(SDK_SRC_DIR, filename) for filename in files]
  oshelpers.Copy(['-v'] + files + [pepperdir])

  # Replace a few placeholders in README
  readme_text = open(os.path.join(SDK_SRC_DIR, 'README'), 'rt').read()
  readme_text = readme_text.replace('${VERSION}', pepper_ver)
  readme_text = readme_text.replace('${REVISION}', revision)

  # Year/Month/Day Hour:Minute:Second
  time_format = '%Y/%m/%d %H:%M:%S'
  readme_text = readme_text.replace('${DATE}',
      datetime.datetime.now().strftime(time_format))

  open(os.path.join(pepperdir, 'README'), 'wt').write(readme_text)
コード例 #30
0
def BuildStepCopyTextFiles(pepperdir, pepper_ver, chrome_revision,
                           nacl_revision):
  buildbot_common.BuildStep('Add Text Files')
  InstallFiles(SDK_SRC_DIR, pepperdir, TEXT_FILES)

  # Replace a few placeholders in README
  readme_text = open(os.path.join(SDK_SRC_DIR, 'README')).read()
  readme_text = readme_text.replace('${VERSION}', pepper_ver)
  readme_text = readme_text.replace('${CHROME_REVISION}', chrome_revision)
  readme_text = readme_text.replace('${NACL_REVISION}', nacl_revision)

  # Year/Month/Day Hour:Minute:Second
  time_format = '%Y/%m/%d %H:%M:%S'
  readme_text = readme_text.replace('${DATE}',
      datetime.datetime.now().strftime(time_format))

  open(os.path.join(pepperdir, 'README'), 'w').write(readme_text)