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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

- **Fixed** Vite+ diagnostics now display individual paths and working directories without Rust debug formatting such as quoted paths or escaped Windows backslashes ([#534](https://github.com/voidzero-dev/vite-task/pull/534)).
- **Improved** Windows file-access tracking now uses sparse temporary backing files where supported, avoiding upfront allocation of the full backing file on disk ([#524](https://github.com/voidzero-dev/vite-task/pull/524)).
- **Fixed** Automatic file-access tracking on Linux now works in containers and Kubernetes runners with limited `/dev/shm` space ([#353](https://github.com/voidzero-dev/vite-task/issues/353), [#523](https://github.com/voidzero-dev/vite-task/pull/523)).
- **Fixed** Windows automatic input tracking now records executable image reads when process creation performs the lookup inside `NtCreateUserProcess` ([#518](https://github.com/voidzero-dev/vite-task/pull/518)).
Expand Down
5 changes: 4 additions & 1 deletion crates/fspy/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ use std::{ffi::OsString, path::PathBuf};
#[derive(thiserror::Error, Debug)]
pub enum SpawnError {
#[error(
"could not resolve the full path of program '{program:?}' with PATH={path:?} under cwd({cwd:?})"
"could not resolve the full path of program '{}' with PATH={} under cwd({})",
.program.display(),
.path.as_deref().unwrap_or_else(|| std::ffi::OsStr::new("<not set>")).display(),
.cwd.display()
)]
Which {
program: OsString,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "invalid-package-json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name":
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- packages/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[[e2e]]
name = "invalid_package_json_error"
comment = """
Tests that package parse errors display paths without Rust debug formatting
"""
steps = [
[
"vtt",
"cp",
"packages/broken/package.invalid",
"packages/broken/package.json",
],
[
"vt",
"run",
"build",
],
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# invalid_package_json_error

Tests that package parse errors display paths without Rust debug formatting

## `vtt cp packages/broken/package.invalid packages/broken/package.json`

```
```

## `vt run build`

**Exit code:** 1

```
error: Failed to load task graph
* Failed to load package graph
* Failed to parse JSON file at <workspace>/packages/broken/package.json
* expected value at line 3 column 1
```
2 changes: 1 addition & 1 deletion crates/vite_task_graph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pub enum TaskGraphLoadError {
#[error("Failed to load package graph")]
PackageGraphLoadError(#[from] vite_workspace::Error),

#[error("Failed to load task config file for package at {package_path:?}")]
#[error("Failed to load task config file for package at {}", .package_path.as_path().display())]
ConfigLoadError {
package_path: Arc<AbsolutePath>,
#[source]
Expand Down
11 changes: 9 additions & 2 deletions crates/vite_task_plan/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ impl std::fmt::Display for WhichError {

#[derive(Debug, thiserror::Error)]
pub enum PathFingerprintErrorKind {
#[error("Path {path:?} is outside of the workspace {workspace_path:?}")]
#[error(
"Path {} is outside of the workspace {}",
.path.as_path().display(),
.workspace_path.as_path().display()
)]
PathOutsideWorkspace { path: Arc<AbsolutePath>, workspace_path: Arc<AbsolutePath> },
#[error("Path {path:?} contains characters that make it non-portable")]
NonPortableRelativePath {
Expand Down Expand Up @@ -119,7 +123,10 @@ pub enum Error {
#[error(transparent)]
TaskRecursionDetected(#[from] TaskRecursionError),

#[error("Invalid vite task command: {program} with args {args:?} under cwd {cwd:?}")]
#[error(
"Invalid vite task command: {program} with args {args:?} under cwd {}",
.cwd.as_path().display()
)]
ParsePlanRequest {
program: Str,
args: Arc<[Str]>,
Expand Down
2 changes: 1 addition & 1 deletion crates/vite_task_server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub enum Error {
#[error("invalid message from the task")]
InvalidRequest(#[source] wincode::ReadError),

#[error("non-absolute path from the task: {path:?}")]
#[error("non-absolute path from the task: {}", .path.display())]
NonAbsolutePath { path: OsString },

#[error("invalid glob pattern from the task: {:?}", .0.pattern)]
Expand Down
2 changes: 2 additions & 0 deletions crates/vite_task_server/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ fn server_returns_error_on_non_absolute_path() {
})
.expect_err("driver should surface the protocol error");

assert_eq!(err.to_string(), "non-absolute path from the task: relative/path");

match err {
Error::NonAbsolutePath { path } => {
assert_eq!(path, OsStr::new("relative/path"));
Expand Down
12 changes: 8 additions & 4 deletions crates/vite_workspace/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ pub enum Error {
#[error("Duplicate package name `{name}` found at `{path1}` and `{path2}`")]
DuplicatedPackageName { name: Str, path1: RelativePathBuf, path2: RelativePathBuf },

#[error("Package not found in workspace: `{0:?}`")]
#[error("Package not found in workspace: `{}`", .0.as_path().display())]
PackageJsonNotFound(AbsolutePathBuf),

#[error("Package at `{package_path:?}` is outside workspace root `{workspace_root:?}`")]
#[error(
"Package at `{}` is outside workspace root `{}`",
.package_path.as_path().display(),
.workspace_root.as_path().display()
)]
PackageOutsideWorkspace { package_path: Arc<AbsolutePath>, workspace_root: Arc<AbsolutePath> },

#[error(
Expand All @@ -35,14 +39,14 @@ pub enum Error {
#[error(transparent)]
Io(#[from] io::Error),

#[error("Failed to parse JSON file at {file_path:?}")]
#[error("Failed to parse JSON file at {}", .file_path.as_path().display())]
SerdeJson {
file_path: Arc<AbsolutePath>,
#[source]
serde_json_error: serde_json::Error,
},

#[error("Failed to parse YAML file at {file_path:?}")]
#[error("Failed to parse YAML file at {}", .file_path.as_path().display())]
SerdeYaml {
file_path: Arc<AbsolutePath>,
#[source]
Expand Down