Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Windows installer: fix installs when the temp path contains a space (#10765)

oobaboogab3d19409bac9
diff --git a/.github/workflows/cross-platform-parity-ci.yml b/.github/workflows/cross-platform-parity-ci.yml
index 4ed61ddbc76..867f642bf29 100644
--- a/.github/workflows/cross-platform-parity-ci.yml
+++ b/.github/workflows/cross-platform-parity-ci.yml
@@ -92,6 +92,7 @@ on:
- 'studio/setup.ps1'
- 'tests/studio/test_setup_xpu_runtime_prereport.ps1'
- 'tests/studio/test_xpu_arm64_torchaudio.ps1'
+ - 'tests/studio/test_torch_overrides_merge.ps1'
- 'tests/studio/test_amd_venv_repair_loop.ps1'
- 'tests/studio/test_amd_name_arch_r9700.ps1'
- 'tests/studio/test_application_control_cli_fallback.ps1'
@@ -168,6 +169,7 @@ on:
- 'studio/setup.ps1'
- 'tests/studio/test_setup_xpu_runtime_prereport.ps1'
- 'tests/studio/test_xpu_arm64_torchaudio.ps1'
+ - 'tests/studio/test_torch_overrides_merge.ps1'
- 'tests/studio/test_amd_venv_repair_loop.ps1'
- 'tests/studio/test_amd_name_arch_r9700.ps1'
- 'tests/studio/test_application_control_cli_fallback.ps1'
@@ -270,6 +272,10 @@ jobs:
- name: XPU arm64 torchaudio tests
shell: pwsh
run: pwsh -NoProfile -File tests/studio/test_xpu_arm64_torchaudio.ps1
+ # Same extraction; the spaced-path checks run only on Windows (#10722).
+ - name: Torch overrides merge tests
+ shell: pwsh
+ run: pwsh -NoProfile -File tests/studio/test_torch_overrides_merge.ps1
# Same again: mocked filesystem reads and one `python -c` child, so no venv, no AMD GPU and
# no Windows needed. Read the file header before adding cases -- pwsh 7 cannot reproduce the
# 5.1 half of #8335, so the checks covering it are deliberately source shapes.
diff --git a/install.ps1 b/install.ps1
index e65a6a03b5b..e4d358ed225 100644
--- a/install.ps1
+++ b/install.ps1
@@ -6369,6 +6369,19 @@ exit 0
$script:TorchOverridesFile = $null
throw
}
+ # uv splits --overrides on spaces (#10722); the 8.3 name keeps relative includes resolving.
+ if ($f.Contains(" ")) {
+ $short = $null
+ try { $short = (New-Object -ComObject Scripting.FileSystemObject).GetFile($f).ShortPath } catch { }
+ if (-not $short -or $short.Contains(" ")) {
+ # No short name: skip the freeze rather than fail.
+ substep "[WARN] the torch overrides path has a space and no 8.3 short name;" "Yellow"
+ substep "installing unsloth without freezing the installed PyTorch." "Yellow"
+ Remove-Item -LiteralPath $f -Force -ErrorAction SilentlyContinue
+ return $null
+ }
+ $f = $short
+ }
return $f
}
diff --git a/tests/studio/test_torch_overrides_merge.ps1 b/tests/studio/test_torch_overrides_merge.ps1
index ebb9e67f126..ffbb2e73572 100644
--- a/tests/studio/test_torch_overrides_merge.ps1
+++ b/tests/studio/test_torch_overrides_merge.ps1
@@ -35,12 +35,23 @@ $SkipTorch = $false
# Stand-in interpreter: the helper only runs `& $PythonExe -c` and reads `name==version` lines.
$work = Join-Path ([System.IO.Path]::GetTempPath()) ("unsloth-ovtest-" + [guid]::NewGuid().ToString("N"))
New-Item -ItemType Directory -Path $work -Force | Out-Null
-$fakePy = Join-Path $work "fakepython"
-Set-Content -LiteralPath $fakePy -Value @(
- "#!/usr/bin/env bash"
- "printf 'torch==2.11.0+cu130\ntorchvision==0.26.0+cu130\ntorchaudio==2.11.0+cu130\n'"
-) -Encoding ascii
-if ($IsLinux -or $IsMacOS) { & chmod +x $fakePy }
+$onWindows = -not ($IsLinux -or $IsMacOS)
+if ($onWindows) {
+ # Windows starts a stand-in only through an extension it can execute.
+ $fakePy = Join-Path $work "fakepython.cmd"
+ Set-Content -LiteralPath $fakePy -Value @(
+ "@echo torch==2.11.0+cu130"
+ "@echo torchvision==0.26.0+cu130"
+ "@echo torchaudio==2.11.0+cu130"
+ ) -Encoding ascii
+} else {
+ $fakePy = Join-Path $work "fakepython"
+ Set-Content -LiteralPath $fakePy -Value @(
+ "#!/usr/bin/env bash"
+ "printf 'torch==2.11.0+cu130\ntorchvision==0.26.0+cu130\ntorchaudio==2.11.0+cu130\n'"
+ ) -Encoding ascii
+ & chmod +x $fakePy
+}
$acute = [char]0x00E9 # e-acute, the cheapest non-ASCII requirement character
$savedOverride = $env:UV_OVERRIDE
@@ -96,6 +107,35 @@ try {
Check "returns null under --no-torch" ($null -eq (New-UnslothTorchOverridesFile -PythonExe $fakePy))
$SkipTorch = $false
+ # ── a temp path with a space never reaches uv (#10722) ────────────────────────
+ # UV_OVERRIDE is space-separated itself, so only %TEMP% can hand the helper a spaced path.
+ if ($onWindows) {
+ $spacedTemp = Join-Path $work "John Doe"
+ New-Item -ItemType Directory -Path $spacedTemp -Force | Out-Null
+ $dirShort = $null
+ try { $dirShort = (New-Object -ComObject Scripting.FileSystemObject).GetFolder($spacedTemp).ShortPath } catch { }
+ # Captures the no-8.3 warning.
+ $script:substepCalls = @()
+ function substep { param($Message, $Color) $script:substepCalls += $Message }
+ Remove-Item Env:UV_OVERRIDE -ErrorAction SilentlyContinue
+ $savedTmp = $env:TMP
+ $env:TMP = $spacedTemp # GetTempPath reads TMP first
+ try { $spaced = New-UnslothTorchOverridesFile -PythonExe $fakePy }
+ finally { $env:TMP = $savedTmp }
+ $made += $spaced
+ if ($dirShort -and -not $dirShort.Contains(" ")) {
+ Check "a spaced temp path comes back without a space" ($spaced -and -not $spaced.Contains(" "))
+ Check "the short path names a file in that same temp directory" (
+ $spaced -and (Test-Path -LiteralPath $spaced) -and ((Split-Path -Parent $spaced) -eq $dirShort))
+ } else {
+ Check "no 8.3 name: no overrides file is returned" ($null -eq $spaced)
+ Check "no 8.3 name: the file it created is removed" (@(Get-ChildItem -LiteralPath $spacedTemp).Count -eq 0)
+ Check "no 8.3 name: the fallback is announced" ($script:substepCalls.Count -gt 0)
+ }
+ } else {
+ Write-Host " SKIP spaced-path checks need Windows 8.3 names"
+ }
+
# ── the merged copy is tracked and locked down ────────────────────────────────
# The caller's non-torch lines land in this copy, one of which can be an authenticated URL.
# Three Windows-only hazards, so each is asserted behaviourally where it can be and