Skip to content

The agent that grows with you

fix(desktop): the short uv cache junction creates its parent

Tekniuma4072ce7e673
diff --git a/scripts/bundles/desktop_toolchain.py b/scripts/bundles/desktop_toolchain.py
index 974c43f427f..8517b496530 100644
--- a/scripts/bundles/desktop_toolchain.py
+++ b/scripts/bundles/desktop_toolchain.py
@@ -145,6 +145,7 @@ def short_alias(directory: Path, link: Path) -> Path:
from pm.filesystem import is_junction
directory.mkdir(parents=True, exist_ok=True)
+ link.parent.mkdir(parents=True, exist_ok=True)
if is_junction(link):
os.rmdir(link) # Removes only the reparse point, never the cache behind it.
_winapi.CreateJunction(str(directory), str(link))
diff --git a/tests/scripts/test_desktop_toolchain.py b/tests/scripts/test_desktop_toolchain.py
index 22e44bb2448..87a4b8862a2 100644
--- a/tests/scripts/test_desktop_toolchain.py
+++ b/tests/scripts/test_desktop_toolchain.py
@@ -236,7 +236,10 @@ def test_prepare_tools_uses_pm_native_pins_and_separate_cache(tmp_path, monkeypa
assert prepared["HERMES_PYTHON"] == str(python)
assert prepared["HERMES_NODE"] == str(node)
assert prepared["PATH"] == "pm-tools"
- assert Path(prepared["UV_CACHE_DIR"]) == cache / "python/runtime/native-identity"
+ uv_cache = Path(prepared["UV_CACHE_DIR"])
+ assert uv_cache.resolve() == (cache / "python/runtime/native-identity").resolve()
+ if os.name == "nt": # builds run under the short job-local junction (MAX_PATH)
+ assert uv_cache == work.resolve() / "uv"
assert dict(os.environ) == before
if pm.current_target() == "win32-arm64":
assert len(native_calls) == 1