astral-sh/ruff · error · std::io::Error
running commands is not supported by this system
Error message
running commands is not supported by this system
What it means
This error is returned when ty's uv command layer is asked to spawn a subprocess on a platform/configuration where process execution is unsupported (the `unsupported_command_execution` helper in `crates/ty_project/src/uv/command.rs`). It produces a `std::io::Error` with kind `Unsupported` and a fixed message; it signals an environmental limitation, not a user mistake in the Python project.
Source
Thrown at crates/ty_project/src/uv/command.rs:125
Workspace(&'path SystemPath),
/// A standalone Python script.
Script {
/// The script file passed to `--script`.
path: &'path SystemPath,
/// The optional `--python` argument.
python: Option<&'path SystemPath>,
},
}
pub(crate) fn uv_executable_error(error: WhichError) -> std::io::Error {
std::io::Error::new(
std::io::ErrorKind::NotFound,
format!("failed to resolve uv executable: {error}"),
)
}
pub(super) fn unsupported_command_execution() -> std::io::Error {
std::io::Error::new(
std::io::ErrorKind::Unsupported,
"running commands is not supported by this system",
)
}
#[cfg(test)]
mod tests {
use ruff_db::system::TestSystem;
use ty_static::EnvVars;
use super::Uv;
#[test]
fn explicit_uv_override_skips_path_lookup() -> anyhow::Result<()> {
let system = TestSystem::default();
system.set_env_var(EnvVars::UV, "custom-uv");
let uv = Uv::new(&system)?;View on GitHub (pinned to 26f38c119c)
Solutions
- Run ty in a native environment where subprocess spawning is available.
- Avoid project configurations that require uv synchronization in the restricted environment (use a pre-built environment / non-uv interpreter).
- If embedding ty, provide an alternative command-execution backend or feature flag that disables uv commands.
Defensive patterns
Strategy: fallback
Validate before calling
// Detect spawn support before relying on uv-backed flows: // in wasm/web contexts, assume subprocess execution is unavailable and skip uv features upfront. const canSpawn = typeof process !== 'undefined' && typeof process.spawn === 'function'
Try / catch
match uv_command(...) {
Err(e) if e.kind() == std::io::ErrorKind::Unsupported => {
// fall back to static project metadata without uv
fallback_metadata()
}
other => other?,
} Prevention
- Do not enable uv sync features in WASM/web or spawn-restricted sandboxes.
- Provide pre-built environments so ty never needs to execute uv.
- Feature-gate uv usage by target platform when embedding ty.
When it happens
Trigger: Any code path that resolves uv metadata or synchronizes environments calls into command execution on a target where the spawn capability is compiled out or unavailable (e.g. wasm targets, sandboxes without process-spawn support). Raised by `unsupported_command_execution()` at command.rs:125.
Common situations: Running ty inside a WASM/VS Code-web environment where spawning `uv` is impossible; sandboxed runtimes that deny process creation; embedding ty as a library on an unusual target.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- InternalError
- Failed to format document: {stderr}
- `uv sync` failed to run with exit code `{code}`, stderr: {st
- `uv sync` failed to run with exit code `{code}`, stderr: {st
- PermissionDenied
AI-assisted analysis of astral-sh/ruff@26f38c119c (2026-09-05).
Data as JSON: /api/errors/91a0f8d066aacb5f.
Report an issue: GitHub.