{"record":{"id":"91a0f8d066aacb5f","repo":"astral-sh/ruff","slug":"running-commands-is-not-supported-by-this-system-91a0f8","errorCode":null,"errorMessage":"running commands is not supported by this system","messagePattern":"running commands is not supported by this system","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/ty_project/src/uv/command.rs","lineNumber":125,"sourceCode":"    Workspace(&'path SystemPath),\n    /// A standalone Python script.\n    Script {\n        /// The script file passed to `--script`.\n        path: &'path SystemPath,\n        /// The optional `--python` argument.\n        python: Option<&'path SystemPath>,\n    },\n}\n\npub(crate) fn uv_executable_error(error: WhichError) -> std::io::Error {\n    std::io::Error::new(\n        std::io::ErrorKind::NotFound,\n        format!(\"failed to resolve uv executable: {error}\"),\n    )\n}\n\npub(super) fn unsupported_command_execution() -> std::io::Error {\n    std::io::Error::new(\n        std::io::ErrorKind::Unsupported,\n        \"running commands is not supported by this system\",\n    )\n}\n\n#[cfg(test)]\nmod tests {\n    use ruff_db::system::TestSystem;\n    use ty_static::EnvVars;\n\n    use super::Uv;\n\n    #[test]\n    fn explicit_uv_override_skips_path_lookup() -> anyhow::Result<()> {\n        let system = TestSystem::default();\n        system.set_env_var(EnvVars::UV, \"custom-uv\");\n\n        let uv = Uv::new(&system)?;","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ty_project/src/uv/command.rs#L107-L143","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Detect spawn support before relying on uv-backed flows:\n// in wasm/web contexts, assume subprocess execution is unavailable and skip uv features upfront.\nconst canSpawn = typeof process !== 'undefined' && typeof process.spawn === 'function'","typeGuard":null,"tryCatchPattern":"match uv_command(...) {\n  Err(e) if e.kind() == std::io::ErrorKind::Unsupported => {\n    // fall back to static project metadata without uv\n    fallback_metadata()\n  }\n  other => other?,\n}","preventionTips":["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."],"tags":["uv","platform","subprocess","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"26f38c119cac42e4d320ba08f09224fdec74af2c","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}