Skip to content

Commit d681ea8

Browse files
committed
Auto merge of #621 - Mark-Simulacrum:opt, r=Mark-Simulacrum
Drop stub needs_exec Runners did not keep track of any state (or support querying upstream) for completion; we expect individual tasks to only be sent to runners if they should attempt to run them, and if duplicate work is done that's OK (each individual task is cheap). This function already always returned 'true' so just delete it and propagate the effects of that.
2 parents 59689eb + d58645f commit d681ea8

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

src/runner/graph.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,22 +137,6 @@ impl TasksGraph {
137137
node,
138138
self.graph[node]
139139
);
140-
// Ensure tasks are only executed if needed
141-
let mut already_executed = false;
142-
if let Node::Task {
143-
ref task,
144-
running: None,
145-
} = self.graph[node]
146-
{
147-
if !task.needs_exec(ex, db) {
148-
already_executed = true;
149-
}
150-
}
151-
if already_executed {
152-
self.mark_as_completed(node);
153-
return WalkResult::NotBlocked;
154-
}
155-
156140
// Try to check for the dependencies of this node
157141
// The list is collected to make the borrowchecker happy
158142
let neighbors = self.graph.neighbors(node).collect::<Vec<_>>();

src/runner/tasks.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -97,28 +97,6 @@ impl fmt::Debug for Task {
9797
}
9898

9999
impl Task {
100-
pub(super) fn needs_exec<DB: WriteResults>(&self, ex: &Experiment, db: &DB) -> bool {
101-
// If an error happens while checking if the task should be executed, the error is ignored
102-
// and the function returns true.
103-
match self.step {
104-
TaskStep::Cleanup => true,
105-
// The prepare step should always be executed.
106-
// It will not be executed if all the dependent tasks are already executed, since the
107-
// runner will not reach the prepare task in that case.
108-
TaskStep::Prepare => true,
109-
// Build tasks should only be executed if there are no results for them
110-
TaskStep::Skip { ref tc }
111-
| TaskStep::BuildAndTest { ref tc, .. }
112-
| TaskStep::BuildOnly { ref tc, .. }
113-
| TaskStep::CheckOnly { ref tc, .. }
114-
| TaskStep::Clippy { ref tc, .. }
115-
| TaskStep::Rustdoc { ref tc, .. }
116-
| TaskStep::UnstableFeatures { ref tc } => {
117-
db.get_result(ex, tc, &self.krate).unwrap_or(None).is_none()
118-
}
119-
}
120-
}
121-
122100
pub(super) fn mark_as_failed<DB: WriteResults>(
123101
&self,
124102
ex: &Experiment,

0 commit comments

Comments
 (0)