Skip to content
Merged
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
20 changes: 9 additions & 11 deletions crates/vite_task/src/session/execute/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,15 @@ where
let path_writes = &mut track_result.path_writes;

for access in termination.path_accesses.iter() {
let relative_path = access
.path
.strip_path_prefix(workspace_root, |strip_result| {
let Ok(stripped_path) = strip_result else {
return None;
};
Some(RelativePathBuf::new(stripped_path).map_err(|err| {
anyhow::anyhow!("Invalid relative path '{}': {}", stripped_path.display(), err)
}))
})
.transpose()?;
let relative_path = access.path.strip_path_prefix(workspace_root, |strip_result| {
let Ok(stripped_path) = strip_result else {
return None;
};
// On Windows, paths are possible to be still absolute after stripping the workspace root.
// For example: c:\workspace\subdir\c:\workspace\subdir
// Just ignore those accesses.
RelativePathBuf::new(stripped_path).ok()
});

let Some(relative_path) = relative_path else {
// Ignore accesses outside the workspace
Expand Down