Skip to content
Merged
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** Windows cached tasks can now run package shims rewritten through PowerShell; default env passthrough now preserves `PATHEXT` ([#366](https://github.com/voidzero-dev/vite-task/pull/366))
- **Added** Platform support for targets without `input` auto-inference (e.g. Android). Tasks still run; those relying on auto-inference run uncached, with the summary noting that `input` must be configured manually to enable caching ([#352](https://github.com/voidzero-dev/vite-task/pull/352))
- **Fixed** `vp run` no longer aborts with `failed to prepare the command for injection: Invalid argument` when the user environment already has `LD_PRELOAD` (Linux) or `DYLD_INSERT_LIBRARIES` (macOS) set. The tracer shim is now appended to any existing value and placed last, so user preloads keep their symbol-interposition precedence ([#340](https://github.com/voidzero-dev/vite-task/issues/340))
- **Changed** Arguments passed after a task name (e.g. `vp run test some-filter`) are now forwarded only to that task. Tasks pulled in via `dependsOn` no longer receive them ([#324](https://github.com/voidzero-dev/vite-task/issues/324))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This fixture intentionally tracks package-shim files under node_modules/.bin.
!node_modules
!node_modules/**

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "windows-powershell-shim-pathext"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[[e2e]]
name = "powershell_package_shim_keeps_pathext"
platform = "windows"
comment = """
Cached Windows tasks run with a sanitized environment, and pnpm-style package
`.cmd` shims in `node_modules/.bin` are rewritten at plan time to invoke their
`.ps1` sibling via `powershell.exe -File`. PowerShell needs `PATHEXT` in that
environment to launch native executables — even when the executable name is
written out with a `.exe` extension — so `PATHEXT` must be preserved in the
default untracked env passthrough.
"""
steps = [
{ argv = [
"vt",
"run",
"probe",
], comment = "rewritten to `powershell.exe -File probe-cli.ps1`; the shim launches `vtt.exe write-file` to write `marker.txt`" },
{ argv = [
"vtt",
"print-file",
"marker.txt",
], comment = "marker is present only if the shim's `vtt.exe` launch succeeded" },
]
Comment thread
SegaraRai marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# powershell_package_shim_keeps_pathext

Cached Windows tasks run with a sanitized environment, and pnpm-style package
`.cmd` shims in `node_modules/.bin` are rewritten at plan time to invoke their
`.ps1` sibling via `powershell.exe -File`. PowerShell needs `PATHEXT` in that
environment to launch native executables — even when the executable name is
written out with a `.exe` extension — so `PATHEXT` must be preserved in the
default untracked env passthrough.

## `vt run probe`

rewritten to `powershell.exe -File probe-cli.ps1`; the shim launches `vtt.exe write-file` to write `marker.txt`

```
$ probe-cli
shim-ran
```

## `vtt print-file marker.txt`

marker is present only if the shim's `vtt.exe` launch succeeded

```
shim-ran
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"cache": true,
"tasks": {
"probe": {
"command": "probe-cli",
"cache": true,
"input": []
}
}
}
1 change: 1 addition & 0 deletions crates/vite_task_graph/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ pub const DEFAULT_UNTRACKED_ENV: &[&str] = &[
"HOMEDRIVE",
"HOMEPATH",
"WINDIR",
"PATHEXT",
"ProgramFiles",
"ProgramFiles[(]x86[)]", // Parens escaped for glob syntax (Turborepo uses literal `ProgramFiles(x86)`)
// IDE specific (exact matches)
Expand Down
Loading