当前位置: 首页>>代码示例>>Python>>正文


Python OPTIONS.is_debug_info_enabled方法代码示例

本文整理汇总了Python中src.build.build_options.OPTIONS.is_debug_info_enabled方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.is_debug_info_enabled方法的具体用法?Python OPTIONS.is_debug_info_enabled怎么用?Python OPTIONS.is_debug_info_enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在src.build.build_options.OPTIONS的用法示例。


在下文中一共展示了OPTIONS.is_debug_info_enabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: generate_binaries_depending_ninjas

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_debug_info_enabled [as 别名]
def generate_binaries_depending_ninjas(_):
  if (not OPTIONS.is_bare_metal_i686() or
      not OPTIONS.is_optimized_build() or
      # None of the targets analyzed are currently built in the open source
      # repository.
      open_source.is_open_source_repo() or
      # Run the checker only when --disable-debug-code is specified. Locations
      # of static initializers differ depending on the debug-code option.
      OPTIONS.is_debug_code_enabled() or
      # The checker only works with debug symbols.
      not OPTIONS.is_debug_info_enabled()):
    # The static analysis tool's output varies between debug and non-debug
    # builds, so we pick non-debug as the default.
    return
  n = ninja_generator.NinjaGenerator('analyze_static_initializers')
  script = staging.as_staging(
      'android/external/chromium_org/tools/linux/dump-static-initializers.py')
  n.rule('analyze_static_initializers',
         command=('python src/build/run_python %s -d $in | head --lines=-1 | '
                  'egrep -ve \'^# .*\.cpp \' |'
                  'sed -e \'s/ T\.[0-9]*/ T.XXXXX/\' |'
                  'diff -u $expect - && touch $out' %
                  script),
         description='analyze_static_initializers $in')
  libraries = build_common.CHECKED_LIBRARIES
  libraries_fullpath = [
      os.path.join(build_common.get_load_library_path(), lib)
      for lib in libraries]
  for library in zip(libraries, libraries_fullpath):
    # You can manually update the text files by running
    #   src/build/update_static_initializer_expectations.py.
    expect = 'src/build/dump-static-initializers-%s-expected.txt' % library[0]
    result_path = os.path.join(build_common.get_build_dir(),
                               'dump_static_initializers',
                               'dump_static_initializers.%s.result' %
                               library[0])
    n.build(result_path, 'analyze_static_initializers', library[1],
            variables={'out': result_path, 'expect': expect},
            # Add |libraries_fullpath| to implicit= not to run the analyzer
            # script until all libraries in |libraries_fullpath| become ready.
            # This makes it easy to use
            # update_static_initializer_expectations.py especially when you
            # remove global variables from two or more libraries at the same
            # time.
            implicit=[script, expect] + libraries_fullpath)
开发者ID:epowers,项目名称:arc,代码行数:47,代码来源:config.py

示例2: get_dex2oat_target_dependent_flags_map

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_debug_info_enabled [as 别名]
def get_dex2oat_target_dependent_flags_map():
    # New flags added here might need to be accounted for in
    # src/build/generate_build_prop.py for runtime dex2oat to work properly.
    flags = {}
    if not OPTIONS.is_debug_info_enabled():
        flags["no-include-debug-symbols"] = ""

    if OPTIONS.is_i686():
        flags["instruction-set-features"] = "default"
        flags["instruction-set"] = "x86"
        flags["compiler-filter"] = "speed"
    elif OPTIONS.is_x86_64():
        flags["instruction-set-features"] = "default"
        flags["instruction-set"] = "x86_64"
        flags["compiler-filter"] = "space"
        flags["small-method-max"] = "30"
        flags["tiny-method-max"] = "10"
    elif OPTIONS.is_arm():
        flags["instruction-set-features"] = "div"
        flags["instruction-set"] = "arm"
        flags["compiler-filter"] = "everything"
    return flags
开发者ID:nehz,项目名称:google-arc,代码行数:24,代码来源:build_common.py

示例3: rsync

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_debug_info_enabled [as 别名]
  def rsync(self, source_paths, remote_dest_root, exclude_paths=None):
    """Runs rsync command to copy files to remote host.

    Sends |source_paths| to |remote_dest_root| directory in the remote machine.
    |exclude_paths| can be used to exclude files or directories from the
    sending list.
    The files which are under |remote_dest_root| but not in the sending list
    will be deleted.

    Note:
    - Known editor temporary files would never be sent.
    - .pyc files in remote machine will *not* be deleted.
    - If debug info is enabled and therer is a corresponding stripped binary,
      the stripped binary will be sent, instead of original (unstripped)
      binary.
    - Files newly created in the remote machine will be deleted. Specifically,
      if a file in the host machine is deleted, the corresponding file in the
      remote machine is also deleted after the rsync.

    Args:
        source_paths: a list of paths to be sent. Each path can be a file or
            a directory. If the path is directory, all files under the
            directory will be sent.
        remote_dest_root: the path to the destination directory in the
            remote machine.
        exclude_paths: an optional list of paths to be excluded from the
            sending path list. Similar to |source_paths|, if a path is
            directory, all paths under the directory will be excluded.
    """
    filter_list = (
        self._build_rsync_filter_list(source_paths, exclude_paths or []))
    rsync_options = [
        # The remote files need to be writable and executable by chronos. This
        # option sets read, write, and execute permissions to all users.
        '--chmod=a=rwx',
        '--compress',
        '--copy-links',
        '--delete',
        '--delete-excluded',
        '--inplace',
        '--perms',
        '--progress',
        '--recursive',
        '--rsh=' + ' '.join(['ssh'] + self._build_shared_ssh_command_options()),
        '--times',
    ]
    dest = '%[email protected]%s:%s' % (self._user, self._remote, remote_dest_root)
    # Checks both whether to enable debug info and the existence of the stripped
    # directory because build bots using test bundle may use the configure
    # option with debug info enabled but binaries are not available in the
    # stripped directory.
    unstripped_paths = None
    if (OPTIONS.is_debug_info_enabled() and
        os.path.exists(build_common.get_stripped_dir())):
      # When debug info is enabled, copy the corresponding stripped binaries if
      # available to save the disk space on ChromeOS.
      list_output = _run_command(
          subprocess.check_output,
          ['rsync'] + filter_list + ['.', dest] + rsync_options +
          ['--list-only'])
      paths = [
          line.rsplit(' ', 1)[-1] for line in list_output.splitlines()[1:]]
      unstripped_paths = [
          path for path in paths if self._has_stripped_binary(path)]

      # here, prepend filter rules to "protect" and "exclude" the files which
      # have the corresponding stripped binary.
      # Note: the stripped binraies will be sync'ed by the second rsync
      # command, so it is necessary to "protect" here, too. Otherwise, the
      # files will be deleted at the first rsync.
      filter_list = list(itertools.chain.from_iterable(
          (('--filter', 'P /' + path, '--exclude', '/' + path)
           for path in unstripped_paths))) + filter_list

    # Copy files to remote machine.
    _run_command(subprocess.check_call,
                 ['rsync'] + filter_list + ['.', dest] + rsync_options)

    if unstripped_paths:
      # Copy strippted binaries to the build/ directory in the remote machine
      # directly.
      stripped_binary_relative_paths = [
          os.path.relpath(path, build_common.get_build_dir())
          for path in unstripped_paths]

      logging.debug('rsync stripped_binaries: %s', ', '.join(unstripped_paths))
      dest_build = os.path.join(dest, build_common.get_build_dir())
      # rsync results in error if the parent directory of the destination
      # directory does not exist, so ensure it exists.
      self.run('mkdir -p ' + dest_build.rsplit(':', 1)[-1])
      _run_command(_check_call_with_input,
                   ['rsync', '--files-from=-', build_common.get_stripped_dir(),
                    dest_build] + rsync_options,
                   input='\n'.join(stripped_binary_relative_paths))
开发者ID:epowers,项目名称:arc,代码行数:96,代码来源:remote_executor_util.py

示例4: _parse_args

# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_debug_info_enabled [as 别名]
                      default=build_common.get_test_bundle_name(),
                      help=('The name of the test bundle to be created.'))
  return parser.parse_args()


if __name__ == '__main__':
  OPTIONS.parse_configure_file()

  # Prepare all the files needed to run integration tests.
  parsed_args = _parse_args()
  # Build arc runtime.
  if parsed_args.run_ninja:
    build_common.run_ninja()

  logging.basicConfig(level=logging.WARNING)
  integration_tests_args = _get_integration_tests_args(parsed_args.jobs)
  assert run_integration_tests.prepare_suites(integration_tests_args)

  # Prepare art.901-perf for perf vm tests. The test is marked as a LARGE test.
  integration_tests_args.include_patterns = ['art.901-perf:*']
  integration_tests_args.include_large = True
  assert run_integration_tests.prepare_suites(integration_tests_args)

  # Archive all the files needed to run integration tests into a zip file.
  paths = _get_archived_file_paths()
  if OPTIONS.is_debug_info_enabled():
    paths = _convert_to_stripped_paths(paths)
  print 'Creating %s' % parsed_args.output
  _zip_files(parsed_args.output, paths)
  print 'Done'
开发者ID:epowers,项目名称:arc,代码行数:32,代码来源:archive_test_bundle.py


注:本文中的src.build.build_options.OPTIONS.is_debug_info_enabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。