blob: 902bf97052480d43267b84806d82dbc3852b15fe [file] [log] [blame]
# Copyright 2021 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Ninja `restat` can lead to on-the-fly pruning of the overall action graph,
# when intermediate files are unchanged as a result of re-running an action.
# This script transforms any command to be restat-friendly by redirecting
# outputs to a temporary location, followed by move-if-changed.
# re-client supports this behavior directly with
# --preserve_unchanged_output_mtime (which suppresses downloading over
# unchanged files), so this script is only needed for non-RBE build actions.
restat_wrapper = "//build/tracer/"
declare_args() {
# Set to true to make Rust compiles preserve timestamps of unchanged outputs.
restat_rust = true
# Set to true to make C++ compiles preserve timestamps of unchanged outputs.
# re-client provides this feature out-of-the-box with
# --preserve_unchanged_output_mtime, so it makes sense to default to true
# when using `cxx_rbe_enable`. When not using re-client, you can still
# get write-if-change behavior through the `restat_wrapper` script,
# but at the cost of the wrapper overhead (tradeoff vs. action pruning).
restat_cc = cxx_rbe_enable