fix: use `remove_virtualenv` in `InstalledTools::create_environment`
Replace direct `fs_err::remove_dir_all` call with the `remove_virtualenv`
helper when removing an existing tool environment. This ensures safe
removal behavior, including deferred `pyvenv.cfg` deletion and proper
handling of Windows self-deletion and Docker-mounted filesystems.
Closes #14985.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add `uv clean --background` for async cache deletion
This adds a `--background` flag to `uv cache clean` that moves the cache
to a temporary directory and spawns a daemon process to handle deletion.
The main process exits immediately while deletion continues in the
background, significantly reducing perceived latency for large caches.
Implementation details:
- When `--background` is used, the cache is atomically renamed to a
temporary directory in the same parent folder (ensuring same filesystem)
- A detached daemon process is spawned to delete the temp directory
- On Unix, uses `setsid` to create a new session and detach from terminal
- On Windows, uses `DETACHED_PROCESS` and `CREATE_NO_WINDOW` flags
- The `--background` flag is only supported for full cache clearing (not
for removing specific packages)