Exemple #1
0
 def test_BuildAfterChange(self):
     # Test that changes trigger a rebuild immediately.
     with pynacl.working_directory.TemporaryWorkingDirectory() as work_dir:
         source_dir = os.path.join(work_dir, 'src')
         output_dir = os.path.join(work_dir, 'out')
         cache_dir = os.path.join(work_dir, 'cache')
         readme_out = os.path.join(output_dir, 'newlib_build_install',
                                   'test1')
         args = [
             '--source', source_dir, '--output', output_dir, '--cache',
             cache_dir, '--no-use-remote-cache', '--sync'
         ]
         if '-v' in sys.argv or '--verbose' in sys.argv:
             args += ['--verbose', '--emit-signatures=-', '--no-annotator']
         else:
             args += ['--quiet']
         packages = GetTestPackages(change_readme=False)
         package_targets = GetTestPackageTargets()
         # Build once (so things are in place).
         tb = toolchain_main.PackageBuilder(packages, package_targets, args)
         tb.Main()
         self.assertEqual(INITIAL_README_TEXT,
                          pynacl.file_tools.ReadFile(readme_out))
         # Build again (so the the cache is hit).
         tb = toolchain_main.PackageBuilder(packages, package_targets, args)
         tb.Main()
         self.assertEqual(INITIAL_README_TEXT,
                          pynacl.file_tools.ReadFile(readme_out))
         # Build again after changing README.
         packages = GetTestPackages(change_readme=True)
         tb = toolchain_main.PackageBuilder(packages, package_targets, args)
         tb.Main()
         self.assertEqual(LATER_README_TEXT,
                          pynacl.file_tools.ReadFile(readme_out))
Exemple #2
0
def FetchAndBuildGCC():
    if 'arm' in ARCHES:
        tc_args = ['-y', '--no-use-remote-cache', 'gcc_libs_arm']
        toolchain_main.PackageBuilder(toolchain_build.PACKAGES, tc_args).Main()

    if 'x86' in ARCHES:
        process.Run(['make', 'sync'], cwd=os.path.join(NATIVE_CLIENT, 'tools'))
Exemple #3
0
def FetchAndBuild_gcc_libs():
    tc_args = [
        '-y', '--no-use-cached-results', '--no-use-remote-cache',
        'gcc_libs_arm'
    ]
    # Call toolchain_build to build the gcc libs. We do not need to fill in
    # any package targets since we are using toolchain_build as an
    # intermediate step.
    toolchain_main.PackageBuilder(toolchain_build.PACKAGES, {}, tc_args).Main()
          },
      }
  return libs


def CollectPackages(targets):
  packages = HOST_GCC_LIBS.copy()
  for target in targets:
    packages.update(HostTools(target))
    # We build target libraries only on Linux for two reasons:
    # 1. We only need to build them once.
    # 2. Linux is the fastest to build.
    # TODO(mcgrathr): In future set up some scheme whereby non-Linux
    # bots can build target libraries but not archive them, only verifying
    # that the results came out the same as the ones archived by the
    # official builder bot.  That will serve as a test of the host tools
    # on the other host platforms.
    if sys.platform.startswith('linux'):
      packages.update(TargetLibs(target))
  return packages


PACKAGES = CollectPackages(TARGET_LIST)


if __name__ == '__main__':
  tb = toolchain_main.PackageBuilder(PACKAGES, sys.argv[1:])
  # TODO(mcgrathr): The bot ought to run some native_client tests
  # using the new toolchain, like the old x86 toolchain bots do.
  tb.Main()
def FetchAndBuild_gcc_libs():
    tc_args = ['-y', '--no-use-remote-cache', 'gcc_libs_arm']
    toolchain_main.PackageBuilder(toolchain_build.PACKAGES, tc_args).Main()
Exemple #6
0
    else:
        hosts = [pynacl.platform.PlatformTriple()]
    if pynacl.platform.IsLinux() and BUILD_CROSS_MINGW:
        hosts.append('i686-w64-mingw32')
    for host in hosts:
        packages.update(HostLibs(host))
        packages.update(HostTools(host, args))
    # Don't build the target libs on Windows because of pathname issues.
    # Don't build the target libs on Mac because the gold plugin's rpaths
    # aren't right.
    # On linux use the 32-bit compiler to build the target libs since that's what
    # most developers will be using. (hosts[0] is i686-linux on linux64)
    # For now, don't build anything more than once.
    # TODO(dschuff): Figure out a better way to test things on toolchain bots.
    if pynacl.platform.IsLinux64():
        packages.update(
            pnacl_targetlibs.TargetLibsSrc(GetGitSyncCmdsCallback(revisions)))
        for bias in BITCODE_BIASES:
            packages.update(pnacl_targetlibs.BitcodeLibs(hosts[0], bias))
        for arch in ALL_ARCHES:
            packages.update(pnacl_targetlibs.NativeLibs(hosts[0], arch))
        packages.update(Metadata())
    if pynacl.platform.IsLinux() or pynacl.platform.IsMac():
        packages.update(
            pnacl_targetlibs.UnsandboxedIRT('x86-32-%s' %
                                            pynacl.platform.GetOS()))

    tb = toolchain_main.PackageBuilder(packages, GetUploadPackageTargets(),
                                       leftover_args)
    tb.Main()
  if pynacl.platform.Is64BitLinux():
    hosts = ['i686-linux']
    if args.build_64bit_host:
      hosts.append(NativeTriple())
  else:
    hosts = [NativeTriple()]
  if pynacl.platform.IsLinux() and BUILD_CROSS_MINGW:
    hosts.append('i686-w64-mingw32')
  for host in hosts:
    packages.update(HostLibs(host))
    packages.update(HostTools(host))
  # Don't build the target libs on Windows because of pathname issues.
  # Don't build the target libs on Mac because the gold plugin's rpaths
  # aren't right.
  # On linux use the 32-bit compiler to build the target libs since that's what
  # most developers will be using.
  if pynacl.platform.IsLinux():
    packages.update(pnacl_targetlibs.TargetLibsSrc(
      GetGitSyncCmdCallback(revisions)))
    for bias in BITCODE_BIASES:
      packages.update(pnacl_targetlibs.BitcodeLibs(hosts[0], bias))
    for arch in ALL_ARCHES:
      packages.update(pnacl_targetlibs.NativeLibs(hosts[0], arch))
    packages.update(pnacl_targetlibs.NativeLibsUnsandboxed('linux-x86-32'))
  packages.update(Metadata())

  tb = toolchain_main.PackageBuilder(packages,
                                     leftover_args)
  tb.Main()