You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(vite_task): gate fspy behind cfg for non-supported OSes (#352)
## Motivation
`vite_task` was hard-wired to the `fspy` (file-access tracing) crate, which only builds on Windows, macOS, and Linux. That made the whole task-runner crate uncompilable on other targets (Android, FreeBSD, etc.) — a blocker for anyone embedding `vite_task` elsewhere, and for cross-compilation sanity checks. This PR lets `vite_task` compile on any target: fspy is present on the three supported OSes as before, and absent on others. On the latter, tasks still execute; only `input` auto-inference is unavailable, and the summary tells the user how to re-enable caching explicitly.
## Summary
- New `cfg(fspy)` set by `vite_task`'s `build.rs` when `target_os` is windows/macos/linux, with a matching `[target.'cfg(any(...))'.dependencies]` block for the `fspy` dep (target cfgs and build-script cfgs must stay in sync — documented in `build.rs`).
- On `cfg(not(fspy))`: `spawn(cmd, fspy: true, ...)` silently takes the tokio path; `ChildOutcome.path_accesses` and the whole `tracked_accesses` module are cfg-gated out.
- `spawn()` now always builds `tokio::process::Command` directly; `fspy::Command` is only constructed inside `spawn_fspy`. `fspy::Command::into_tokio_command` became `pub(crate)`.
- New `CacheNotUpdatedReason::FspyUnsupported` surfaced in the summary as: `→ Not cached: \`input\` auto-inference isn't supported on this OS. Configure \`input\` manually to enable caching.` Cache lookups and post-run fingerprint validation of existing entries still work on unsupported OSes — only cache *creation* requiring auto-inferred inputs is refused.
- `PathRead` moves from the fspy-gated `tracked_accesses.rs` to `fingerprint.rs` (usable on both builds).
## Test plan
- [x] On-path: `cargo test -p vite_task`, `cargo test -p vite_task_bin --test e2e_snapshots`, `cargo test -p vite_task_plan --test plan_snapshots`
- [x] On-path cross-OS: `just lint-linux`, `just lint-windows`
- [x] Off-path: `mise check-android` (cross-compiles `vite_task` to `aarch64-linux-android`, clippy-checks with `--all-targets --all-features -- -D warnings`)
- [x] Off-path dep graph: `cargo ndk -t arm64-v8a tree -p vite_task | grep fspy` returns nothing
- [x] `just lint`, `cargo fmt --check`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# Changelog
2
2
3
+
-**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))
3
4
-**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))
4
5
-**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))
5
6
-**Fixed** Windows file access tracking no longer panics when a task touches malformed paths that cannot be represented as workspace-relative inputs ([#330](https://github.com/voidzero-dev/vite-task/pull/330))
0 commit comments