Problem with PATH variable setting

181 views
Skip to first unread message

Emmanuel

unread,
Apr 2, 2012, 3:32:10 PM4/2/12
to rez-c...@googlegroups.com
Hi

After a successful install and demo run, I've been able to build and install a little package of my own, but I've noticed that the PATH variable was not set as specified by the rez context file.
And now I find that this problem is present even for the default rez packages. For instance:

edumont@nbws19 ~ $ rez env python
You are now in a new environment.

running rez-config v1.0.0

requested packages (mode=latest, time=1333394713):
Linux
python

resolved packages:
Linux               /data/rez/packages/Linux
python-2.5.4        /data/rez/packages/python/2.5.4/Linux

number of failed attempts: 0

context file:
/tmp/.rez-context.ipvDd14457

> edumont@nbws19 ~ $ cat /tmp/.rez-context.ipvDd14457
export PATH=
export REZ_WRAPPER_PATH=
export REZ_RESOLVE='Linux python-2.5.4'
export REZ_LINUX_VERSION=
export REZ_LINUX_BASE=/data/rez/packages/Linux
export REZ_LINUX_ROOT=/data/rez/packages/Linux
export CMAKE_MODULE_PATH=/data/rez/packages/Linux/cmake
export REZ_PYTHON_VERSION=2.5.4
export REZ_PYTHON_BASE=/data/rez/packages/python/2.5.4
export REZ_PYTHON_ROOT=/data/rez/packages/python/2.5.4/Linux
export PATH=$PATH:/data/rez/packages/python/2.5.4/Linux/bin
export REZ_RESOLVE_MODE=latest
export REZ_USED=/data/rez/1.0.0
export REZ_REQUEST='Linux python'
export REZ_FAILED_ATTEMPTS=0
export REZ_REQUEST_TIME=1333394713
export PATH=$PATH:/bin:/usr/bin:/data/rez/1.0.0/bin
> edumont@nbws19 ~ $
> edumont@nbws19 ~ $
> edumont@nbws19 ~ $ echo $PATH
/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/bin:/usr/bin::/data/rez/1.0.0/bin

I wonder why the python path is not in the PATH (which prevent to use rezpy). Also where does the qt and kerberos stuff comes from?
And there's a '::' in that path which looks suspicious.

Thanks for any hint on that one.

emmanuel dumont @ NewBreed  VFX


Allan Johns

unread,
Apr 2, 2012, 7:43:45 PM4/2/12
to rez-c...@googlegroups.com
Hi Emmanuel, see below.



Hmm ok, the appropriate export to add it to PATH is there. If you try sourcing the context file directly, does it work then? Someone else had a problem like this... it turned out to have something to do with rez itself being installed in the packages path iirc. Check your install... rez should be installed in a directory that does not appear in REZ_PACKAGES_PATH. If it's not that, then I'd work backwards... start with sourcing the context file directly, then hack up the rez-env tool (it's just a bit of bash) until you see what's going wrong. It should be something fairly simple.

Here's the structure of my install:

~/workspace/rez]$ ll
drwxrwx--- 2 allanjohns Domain Users 4096 Mar 21 19:21 local_pkgs
drwxrwx--- 7 allanjohns Domain Users 4096 Mar 21 19:24 packages
drwxrwx--- 3 allanjohns Domain Users 4096 Mar 21 19:24 rez_install

I only have rez installed locally... typically the packages and rez_install path wouldn't be in my home directory, they'd be somewhere central (however, local_pkgs should always be local).


 
Also where does the qt and kerberos stuff comes from?

If you open a shell and don't use rez at all, is kerberos in your PATH anyway? I'm betting it is. Rez is just making sure that these system paths are kept in PATH.
 
And there's a '::' in that path which looks suspicious.

Don't worry about that. I know why it's there, it's a minor annoyance and doesn't actually cause any problems. I could fix it but it's never been a priority.
 

Thanks for any hint on that one.

emmanuel dumont @ NewBreed  VFX


nw. hth,
A

 

--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rez-config/-/8fn361gO83gJ.
To post to this group, send email to rez-c...@googlegroups.com.
To unsubscribe from this group, send email to rez-config+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rez-config?hl=en.

Allan Johns

unread,
Apr 2, 2012, 7:47:33 PM4/2/12
to rez-c...@googlegroups.com
ps, please let me know if problem #1 is to do with the rez install path - I'll bump up the priority on fixing this (ie disallowing it in install.sh) if so (it's already on the list).

A

Emmanuel Dumont

unread,
Apr 3, 2012, 9:31:39 AM4/3/12
to rez-c...@googlegroups.com
Hi Allan

Thanks for your feedback (and for rez too btw :)
Sourcing the context file does the trick

> edumont@nbws19 ~ $ echo $PATH
:/data/rez/packages/python/2.5.4/Linux/bin:/bin:/usr/bin:/data/rez/1.0.0/bin

We can see that the qt and kerberos stuff is not there anymore, as expected. I wonder only those two items do appear when rez-env is called, because there's a lot of other stuff in our PATH when rez-env is called (including qt and kerberos). In some way it should relate to our issue.
I thought that rez was resetting the PATH anew, just putting package stuff into it? (and there's indeed the first command in contex file which does just that: export PATH= )

As for the rez install:

edumont@nbws19 ~ $ env | grep REZ
REZ_RELEASE_PACKAGES_PATH=/data/rez/packages
REZ_PATH=/data/rez/1.0.0
REZ_PLATFORM=Linux
REZ_DOT_IMAGE_VIEWER=firefox
REZ_PACKAGES_PATH=/home/edumont/packages:/data/rez/packages
REZ_VERSION=1.0.0
REZ_RELEASE_EDITOR=kate

Rez is installed in /data/rez/1.0.0 and the packages: /home/edumont/packages:/data/rez/packages, so I don't think that's the issue.

I'm going to to try playing with rez-env as you suggested now. I'll let you know.

emmanuel

Emmanuel Dumont

unread,
Apr 3, 2012, 1:29:04 PM4/3/12
to rez-c...@googlegroups.com
Ok, so my mistake, I thought the install path was fine, but it was not...
REZ_PATH (/data/rez/1.0.0) does not appear in REZ_PACKAGES_PATH (/data/rez/packages), but /data/rez (REZ_BASE_PATH) does, so the PATH tweaking in the sourced init.sh was removing binaries under that path (just re adding rez binaries):

    # expose rez binaries, replacing existing rez paths if they have been set already
    PATH=`echo $PATH | /usr/bin/tr ':' '\n' | grep -v '^$' | grep -v '!REZ_BASE_PATH!' | /usr/bin/tr '\n' ':'`
    export PATH=$PATH:$REZ_PATH/bin

I've just re installed with separate dirs, and all seems fine now.

emmanuel

Allan Johns

unread,
Apr 3, 2012, 7:51:59 PM4/3/12
to rez-c...@googlegroups.com
Thanks for that info Emmanuel, I'll make fixing this top priority.

As for kerberos etc in your path, I can't recall exactly what's going on there, but a grep through rez doesn't show kerberos anywhere so it must be getting pulled from your system's $PATH at some stage. Iirc rez can't just blat over PATH completely since then you'd lose system paths which would cause problems. When I get a chance I'll look more into this.

Emmanuel Dumont

unread,
Apr 4, 2012, 9:29:16 AM4/4/12
to rez-c...@googlegroups.com
Yep, I've tracked down the qt/kerberos stuff, it's some /etc/init.d scritps sourced in our .bashrc when the new rez shell is spawned. I think the remaining of our path is not set because the rez shell is not a login shell but an interactive shell (and our env is set only for login shell)
I wonder if at some point, every environement setting could/should come only from packages? But I can see that it would make it harder to customize for end user

Another glitch I'd like to report, is the setting of REZ_PACKAGES_PATH and REZ_RELEASE_PACKAGES_PATH in the init.sh:

    # where rez searches for packages
    if [ "$REZ_PACKAGES_PATH" == "" ]; then
        export REZ_PACKAGES_PATH=$HOME/packages:/data/packages
    fi


    # where rez will publish packages to (ie those released with rez-release)
    if [ "$REZ_RELEASE_PACKAGES_PATH" == "" ]; then
        export REZ_RELEASE_PACKAGES_PATH=/data/packages
    fi

if those were already set then they're not set properly, which  occur when re-install for instance, or when you switch from the rez demo to an actual install. In this case you have to specifically unset those (or I guess a logout/login would do it). I'm not sure, maybe that could be a feature btw.

emmanuel

Reply all
Reply to author
Forward
0 new messages