Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions app/buck2_action_impl/src/actions/impls/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1076,9 +1076,14 @@ impl RunAction {
// First, check in the local dep file cache if an identical action can be found there.
// Do this before checking the action cache as we can avoid a potentially large download.
// Once the action cache lookup misses, we will do the full dep file cache look up.
let (outputs, should_fully_check_dep_file_cache) = dep_file_bundle
.check_local_dep_file_cache_for_identical_action(ctx, self.outputs.as_slice())
.await?;
let should_bypass_action_cache = ctx.should_bypass_action_cache();
let (outputs, should_fully_check_dep_file_cache) = if should_bypass_action_cache {
(None, false)
} else {
dep_file_bundle
.check_local_dep_file_cache_for_identical_action(ctx, self.outputs.as_slice())
.await?
};
if let Some((outputs, metadata)) = outputs {
return Ok(ExecuteResult::LocalDepFileHit(outputs, metadata));
}
Expand Down Expand Up @@ -1541,7 +1546,8 @@ impl Action for RunAction {
waiting_data: WaitingData,
) -> Result<(ActionOutputs, ActionExecutionMetadata), ExecuteError> {
// Check offline cache first if parameter enabled
if self.inner.allow_offline_output_cache
if !ctx.should_bypass_action_cache()
&& self.inner.allow_offline_output_cache
&& ctx.run_action_knobs().use_network_action_output_cache
{
if let Some((outputs, metadata)) = self.execute_for_offline(ctx).await? {
Expand Down
5 changes: 5 additions & 0 deletions app/buck2_build_api/src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ pub mod execute;
pub mod impls;
pub mod query;
pub mod registry;
pub mod rewind;

/// Represents an unregistered 'Action' that will be registered into the 'Actions' module.
/// The 'UnregisteredAction' is not executable until it is registered, upon which it becomes an
Expand Down Expand Up @@ -286,6 +287,10 @@ pub trait ActionExecutionCtx: Send + Sync {
prepared_action: &PreparedAction,
) -> ControlFlow<CommandExecutionResult, CommandExecutionManager>;

fn should_bypass_action_cache(&self) -> bool {
false
}

async fn cache_upload(
&mut self,
action: &ActionDigestAndBlobs,
Expand Down
Loading
Loading