AcademySoftwareFoundation / AcademySoftwareFoundation/rez

Leftover / Orphaned environment variables in child shells

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

Description

the problem is simple:

``` bash
$ echo $MAYA_LOCATION

$ rez-env maya
> $ echo $MAYA_LOCATION
/usr/autodesk/maya2014.51-x64
> $ rez-env nuke
>> $ echo $MAYA_LOCATION
/usr/autodesk/maya2014.51-x64
```

rez makes no effort whatsoever to remove old variables.

This is a pretty big problem. what if you drop into a shell with a resolve that sets `LD_LIBRARY_PATH`, then drop into another shell below that which does not. `LD_LIBRARY_PATH` is still set, potentially along with dozens of other variables which are not relevant and potentially harmful to the current resolve.

I believe if we can keep track of which variables rez sets, then we can unset all of those before the next resolve. This is one of the reasons that I'm not a fan of the `source` command, since it can wreak total havok on the environment in ways that rez cannot easily track (aside from the fact that it breaks promise of parity between various shells).

Contributor guide

Open the contributing guide

Research direction

Start at the rez-env entry point and inspect how child-shell environments are assembled, especially the handling of variables set by a previous resolve. Done means variables from an outer resolve do not remain when a nested resolve does not define them, while behavior remains consistent across supported shells.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.