Files
chromium_depot_tools/ninja_reclient.py
Ben Segall bb67064617 Enable racing for ninja+reclient developer builds
Bug: b/288564971
Change-Id: Ibae8f86b7c79b9fa218e0f04c75fe99414c4f48b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4844059
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Ben Segall <bentekkie@google.com>
2023-09-06 14:44:21 +00:00

30 lines
861 B
Python
Executable File

#!/usr/bin/env python3
# Copyright 2023 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script is a wrapper around the ninja.py script that also
handles the client lifecycle safely. It will automatically start
reproxy before running ninja and stop reproxy when ninja stops
for any reason eg. build completes, keyboard interupt etc."""
import os
import sys
import ninja
import reclient_helper
def main(argv):
os.environ.setdefault("RBE_exec_strategy", "racing")
with reclient_helper.build_context(argv, 'ninja_reclient') as ret_code:
if ret_code:
return ret_code
try:
return ninja.main(argv)
except KeyboardInterrupt:
return 1
if __name__ == '__main__':
sys.exit(main(sys.argv))