From abb99d52ca281c540806442320ffa7e10cdbf9c0 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 3 Jun 2026 04:38:21 -0700 Subject: [PATCH] install.ps1: UNSLOTH_INSTALL_REF also drives the WSL unsloth install So a branch can be tested end-to-end pre-merge: when UNSLOTH_INSTALL_REF is set (not main), pass install.sh `--package git+https://github.com/unslothai/unsloth@` so the WSL studio venv carries THAT ref's studio/setup.sh + unsloth Python patches (otherwise install.sh installs released PyPI unsloth and the branch's setup.sh -- e.g. the WSL CPU-build skip -- never runs). Default (ref = main) is byte-identical to before. The git URL has no spaces, so it survives PowerShell -> wsl.exe -> bash -lc. Co-Authored-By: Claude Opus 4.8 --- install.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index 064b32ea3c..cd98f56064 100644 --- a/install.ps1 +++ b/install.ps1 @@ -1541,7 +1541,15 @@ shell.Run cmd, 0, False try { & wsl.exe --install -d $distro --no-launch } catch {} } substep "installing Unsloth Studio inside WSL '$distro' with full GPU (this downloads PyTorch)..." "Cyan" - $wslInstall = 'export DEBIAN_FRONTEND=noninteractive; apt-get update -y >/dev/null 2>&1; apt-get install -y build-essential cmake git curl pciutils >/dev/null 2>&1; curl -fsSL https://unsloth.ai/install.sh | sh' + # When UNSLOTH_INSTALL_REF is a branch/tag/sha (not "main"), install unsloth FROM that + # ref via install.sh's --package, so the WSL studio package carries THIS ref's + # studio/setup.sh + unsloth Python patches. Otherwise install.sh pulls released PyPI + # unsloth and the branch's setup.sh (e.g. the WSL CPU-build skip) would not run + # pre-merge. Default (ref = main) is byte-identical to before: plain `... | sh`. + # The git URL has no spaces, so it passes cleanly PowerShell -> wsl.exe -> bash -lc. + $_instRef = Get-UnslothInstallRef + $_pkgArg = if ($_instRef -eq 'main') { '' } else { ' -s -- --package git+https://github.com/unslothai/unsloth@' + $_instRef } + $wslInstall = 'export DEBIAN_FRONTEND=noninteractive; apt-get update -y >/dev/null 2>&1; apt-get install -y build-essential cmake git curl pciutils >/dev/null 2>&1; curl -fsSL https://unsloth.ai/install.sh | sh' + $_pkgArg # install.sh writes diagnostics to stderr and may exit non-zero on the optional llama.cpp # prebuilt step (no aarch64 prebuilt exists) -- that must NOT abort us under -ErrorAction Stop, # since torch + unsloth + Studio still install. Lower EAP around the call (same idiom as above).