Unverified Commit 4ca8d6f4 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Turbopack: "connect" tasks in turbo_tasks::run too (#83975)

### What?

Calling turbo tasks functions in `turbo_tasks::run` leads to a minimal connect, which schedules the task when it has not yet been computed.

Connecting OperationVc should lead to the same behavior.
parent c4a800fe
...@@ -3044,10 +3044,10 @@ impl<B: BackingStorage> Backend for TurboTasksBackend<B> { ...@@ -3044,10 +3044,10 @@ impl<B: BackingStorage> Backend for TurboTasksBackend<B> {
fn connect_task( fn connect_task(
&self, &self,
task: TaskId, task: TaskId,
parent_task: TaskId, parent_task: Option<TaskId>,
turbo_tasks: &dyn TurboTasksBackendApi<Self>, turbo_tasks: &dyn TurboTasksBackendApi<Self>,
) { ) {
self.0.connect_task(task, Some(parent_task), turbo_tasks); self.0.connect_task(task, parent_task, turbo_tasks);
} }
fn create_transient_task( fn create_transient_task(
......
...@@ -652,7 +652,7 @@ pub trait Backend: Sync + Send { ...@@ -652,7 +652,7 @@ pub trait Backend: Sync + Send {
fn connect_task( fn connect_task(
&self, &self,
task: TaskId, task: TaskId,
parent_task: TaskId, parent_task: Option<TaskId>,
turbo_tasks: &dyn TurboTasksBackendApi<Self>, turbo_tasks: &dyn TurboTasksBackendApi<Self>,
); );
......
...@@ -1345,9 +1345,8 @@ impl<B: Backend + 'static> TurboTasksApi for TurboTasks<B> { ...@@ -1345,9 +1345,8 @@ impl<B: Backend + 'static> TurboTasksApi for TurboTasks<B> {
} }
fn connect_task(&self, task: TaskId) { fn connect_task(&self, task: TaskId) {
if let Some(current_task) = current_task_if_available("connecting task") { self.backend
self.backend.connect_task(task, current_task, self); .connect_task(task, current_task_if_available("connecting task"), self);
}
} }
fn mark_own_task_as_finished(&self, task: TaskId) { fn mark_own_task_as_finished(&self, task: TaskId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment