Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

rez-windows-platform

БесплатноБез исполняемых скриптовНе проверен

Running rez on Windows — why only cmd, gitbash, powershell and pwsh are registered there and how the default is picked, the path-separator trap where cmd and…

loonghaoот loonghao349 установок в других каталогах

Об этом скилле

Rez on Windows

One-sentence summary: on Windows rez registers only cmd, gitbash, powershell and pwsh as shells, and those shells disagree about the path separator — cmd and pwsh join lists with ; while gitbash joins them with : — which is why the same package.py can produce a working PATH in one shell and a broken one in another.

Skill scope: the Windows-specific differences. For the commands() body and the rex API in general see rez-package-commands; for package.py attributes see rez-package-definition; for config layering and plugin discovery see rez-config-plugins; for a resolve that fails on any platform see rez-resolve-troubleshooting.

Platform note. Every fenced block in this skill is tagged with the shell it belongs to (powershell, bat, ```bash). Commands tagged powershell or bat are Windows-only and will fail on Linux or macOS, where those shells are not registered. The rez-interpret examples are safe to run anywhere — it only prints text, never launches a shell.

Which shells exist on Windows

Rez ships shell plugins for bash, sh, csh, tcsh, zsh, cmd, gitbash, powershell and pwsh, but only the ones valid for the current platform are registered. On Windows:

cmd, gitbash, powershell, pwsh

The POSIX shells are not registered there, so rez-env --shell bash is not a valid value on Windows and vice versa. Ask rez rather than assuming, because the answer is platform-dependent:

from rez.shells import get_shell_types

print(get_shell_types())   # ['cmd', 'gitbash', 'powershell', 'pwsh'] on Windows

How the default shell is chosen

The order is default_shell, then system.shell:

rez-config default_shell

default_shell is empty ('') out of the box, in which case rez falls back to detecting the current shell — on Windows that is typically powershell. There is no default_windows_shell setting in rez 3.4.0; default_shell is the only knob, and it applies on every platform.

To target a shell for one invocation:

# Windows only — 'cmd' is not a registered shell on Linux or macOS
rez-env foo --shell cmd
REM Windows only
rez-env foo --shell cmd

The path separator trap

This is the difference that breaks real packages. The same rex produces different text per shell:

rez-interpret -c 'env.MY_PATH.prepend("C:/pkgs/foo/bin")' -f cmd --pv MY_PATH
rez-interpret -c 'env.MY_PATH.prepend("C:/pkgs/foo/bin")' -f pwsh --pv MY_PATH
rez-interpret -c 'env.MY_PATH.prepend("C:/pkgs/foo/bin")' -f gitbash --pv MY_PATH

With MY_PATH already set, the generated code is:

Shell Generated line Separator
cmd set MY_PATH=C:\pkgs\foo\bin;C:\Program Files\Git\usr\bin;... ;
pwsh Set-Item -Path "Env:MY_PATH" -Value ("C:\pkgs\foo\bin;" + ...) ;
gitbash export MY_PATH="C:/pkgs/foo/bin:${MY_PATH}" :

Two things to take from it:

  • The list separator is ; under cmd and pwsh, and : under gitbash. A package.py that builds a list by hand — joining with : because it was written on Linux — produces a single unreadable entry on Windows. Use the rex list operations (append, prepend, set) and let rez pick the separator.
  • cmd and pwsh emit backslashes; gitbash keeps forward slashes. Both work in their own shell, so the difference only bites when you compare or string-match paths.

The separator applies to every list-valued variable, not just PATH — PYTHONPATH, LD_LIBRARY_PATH-style variables and any custom list behave the same way.

Backslashes, drive letters and path separators

  • os.sep is a backslash and os.pathsep is a semicolon on Windows, versus a forward slash and a colon on POSIX.
  • packages_path is a Python list, so it is immune to the separator problem — do not build a ;-joined string for it.
  • Flags that do take a joined path list use os.pathsep, so they take ; on Windows. This includes rez-env --paths and rez-search --paths:
# Windows only — the separator is ';' here, not ':'
rez-env --paths "C:/studio/packages;C:/studio/local" foo -o context.rxt
  • Paths inside a package.py should be written with forward slashes or with {root}, and joined with the rex API. A hard-coded backslash will not survive a move to Linux, and a hard-coded colon will not survive a move to Windows.

Path length: the 260-character limit

Win32 caps a path at 260 characters (MAX_PATH) unless long paths are enabled. Rez paths are deep by construction, so this is a real failure mode and not a theoretical one.

The depth comes from how a variant is laid out. For the filesystem repository the install path is <repo>/<name>/<version>/<variant subpath>/, and the variant subpath nests one directory per variant requirement. A package with variants = &quot;python-3.11&quot;, &quot;pytest-7&quot;, &quot;six&quot; installs under:

Полный SKILL.md на ClawHub

Установить rez-windows-platform в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл rez-windows-platform?

Running rez on Windows — why only cmd, gitbash, powershell and pwsh are registered there and how the default is picked, the path-separator trap where cmd and pwsh join with ';' while gitbash joins with ':', backslash versus forward slash in generated shell code, the 260-character MAX_PATH limit and why variant install paths exceed it, the platform/arch/os implicit packages, using rez-interpret as a cross-shell oracle without launching a shell, install and config-file layout, and CI differences. Use when a package or resolve behaves differently on Windows, when porting a package across operating systems, when a deep path fails to read or write, or when a one-liner works in bash and fails in cmd. Covers Rez 3.4.0.

Как установить скилл rez-windows-platform?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл rez-windows-platform запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить rez-windows-platform с