AcademySoftwareFoundation / AcademySoftwareFoundation/rez

"&" character in environment manipulation definitions yields error on Windows upon requiring the package.

Open
#592 4 comments 0 reactions 0 assignees View on GitHub
bug os:windows shell
Dominant language
Python
Stars
1.1k
Forks
369
Avg merge
12d 3h
Merged PRs (30d)
5

Description

Hi,

This is related to #432: I'm trying to push Houdini a bit more nicely into our pipeline and I have been having a lot of pain. The trigger for my recent stack of issues is actually this current one that I thought was fixed by #432.

At any point if I put a `&` character in a `env.MY_VARIABLE.append` or `env.MY_VARIABLE.prepend` call I get an error upon requiring the package. `&` is used by Houdini [to make its own content available](http://www.sidefx.com/docs/houdini/basics/config_env.html#special-characters-in-path-variables), if you don't do so it simply errors on startup.

Assuming that my `commands` definition is expressed as follows:

```python
def commands():
import os

env.HOUDINI_PATH.append('&')
env.HOUDINI_PATH.append(
os.path.join('{root}', 'bootstrap', 'houdini'))
```

If I `rez-env my_package`, I get:

```batch
'C:\Users\thomas\Packages\my_package\1.0.0\bootstrap\houdini' is not recognized as an internal or external command,
operable program or batch file.
resolved by thomas@..., on Thu Apr 04 16:44:28 2019, using Rez v2.28.0
```

I tried many variants with hat and everything but not dice and I cannot find any workaround so far.

For reference this stuff works in `cmd`:

```batch
C:\Users\thomas>set HOUDINI_PATH=^&

C:\Users\thomas>set HOUDINI_PATH
HOUDINI_PATH=&
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the commands() example with rez-env on Windows using Rez v2.28.0, focusing on env.HOUDINI_PATH.append and prepend values containing '&'. Trace how environment manipulation becomes the generated command and verify that requiring the package succeeds and preserves '&' in the resulting environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.