-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(turbo): Port Run Cache (#5707)
### Description Ports runcache along with the required dependencies like `PrefixWriter`, `LogWriter`, etc. ### Testing Instructions Unfortunately there aren't many tests to port for runcache. I'll work on writing some tests for the dependencies --------- Co-authored-by: nicholaslyang <Nicholas Yang>
- Loading branch information
1 parent
4389640
commit c8b9439
Showing
26 changed files
with
783 additions
and
171 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use turbopath::AbsoluteSystemPathBuf; | ||
|
||
use crate::{ | ||
cli::EnvMode, | ||
package_json::PackageJson, | ||
task_graph::{TaskDefinition, TaskOutputs}, | ||
}; | ||
|
||
pub struct PackageTask { | ||
pub task_id: TaskId<'static>, | ||
pkg: PackageJson, | ||
env_mode: EnvMode, | ||
pub(crate) task_definition: TaskDefinition, | ||
pub dir: AbsoluteSystemPathBuf, | ||
command: String, | ||
outputs: Vec<String>, | ||
excluded_outputs: Vec<String>, | ||
pub(crate) log_file: String, | ||
hash: String, | ||
} | ||
|
||
impl PackageTask { | ||
pub fn hashable_outputs(&self) -> TaskOutputs { | ||
let mut inclusion_outputs = vec![format!(".turbo/turbo-{}.log", self.task)]; | ||
inclusion_outputs.extend_from_slice(&self.task_definition.outputs.inclusions[..]); | ||
|
||
let mut hashable = TaskOutputs { | ||
inclusions: inclusion_outputs, | ||
exclusions: self.task_definition.outputs.exclusions.clone(), | ||
}; | ||
|
||
hashable.inclusions.sort(); | ||
hashable.exclusions.sort(); | ||
|
||
hashable | ||
} | ||
} |
Oops, something went wrong.