Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Android/tools/tools/treble/build/sandbox/   (Android Betriebssystem Version 17©)  Datei vom 26.5.2026 mit Größe 2 kB image not shown  

Quelle  rbe_action.py

  Sprache: Python
 

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Runs a single action remotely with RBE."""

import argparse
import os
import rbe
import subprocess
import sys


def main():
  parser = argparse.ArgumentParser(
      description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
  parser.add_argument(
      '--command',
      default='echo RBE check successful.',
      help='Command to run remotely with RBE.')
  parser.add_argument(
      '--print''-p',
      action='store_true',
      help='Prints the executed commands')
  args = parser.parse_args()

  env = []
  cleanup = rbe.setup(env, sys.stdout if args.print else subprocess.DEVNULL)
  src_root = os.path.normpath(
      os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../..'))
  env = rbe.env_array_to_dict(rbe.prepare_env(env))
  env['PATH'] = os.getenv('PATH')
  env['HOME'] = os.getenv('HOME')
  for d in ['FLAG_log_dir''RBE_output_dir''RBE_proxy_log_dir']:
    env[d] = '/tmp'  # We want the logs in /tmp instead of out.
  try:
    # Bootstrap the RBE proxy.
    bootstrap_cmd = rbe.get_nsjail_bin_wrapper() + \
      [os.path.join(rbe.TOOLS_DIR, 'bootstrap')]
    shell_env = ' '.join(['%s=%s' % (k,v) for k, v in env.items()])
    if args.print:
      print('Bootstrap RBE reproxy:')
      print('cd ' + src_root)
      print('%s %s' % (shell_env, ' '.join(bootstrap_cmd)))
    subprocess.check_call(
        bootstrap_cmd, env=env, cwd=src_root, stdout=subprocess.DEVNULL)
    # Execute the remote command.
    rewrapper_cmd = rbe.get_nsjail_bin_wrapper() + [
        os.path.join(rbe.TOOLS_DIR, 'rewrapper'),
        '--platform=container-image=docker://gcr.io/androidbuild-re-dockerimage/android-build-remoteexec-image@sha256:582efb38f0c229ea39952fff9e132ccbe183e14869b39888010dacf56b360d62', \
        '--labels=type=tool',
        '--exec_strategy=remote',
        '--dial_timeout=5s',
        '--exec_root=' + src_root,
        '--',
    ] + args.command.split()
    if args.print:
      print('Run remote command with RBE:')
      print('%s %s' % (shell_env, ' '.join(rewrapper_cmd)))
    subprocess.check_call(rewrapper_cmd, env=env, cwd=src_root)
  finally:
    # Shut down the RBE proxy.
    if args.print:
      print('RBE proxy shutdown:')
      print('killall reproxy')
    subprocess.call(
        ['killall''reproxy'],
        stdout=subprocess.DEVNULL,
        stderr=subprocess.DEVNULL)
    cleanup()


if __name__ == '__main__':
  main()

Messung V0.5 in Prozent
C=91 H=91 G=90

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.