ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Switching catkin workspaces carries old env vars

asked 2013-01-29 13:30:57 -0500

130s gravatar image

updated 2013-01-30 06:52:57 -0500

Often I want to switch from my main catkin workspace oldws to sandbox workspace newws. But sourcing setup.bash in newws keeps adding oldws into some environment variables. As shown below, unsetting those and sourcing again doesn't help. Is there any other possible flaws??

rosman@rosmachine:~/oldws$ rm -fR build devel
rosman@rosmachine:~/newws$ rm -fR build devel
(on a new terminal)
rosman@rosmachine:~/newws$ catkin_make
rosman@rosmachine:~/newws$ source devel/setup.bash
rosman@rosmachine:~/newws$ env |grep oldws
LD_LIBRARY_PATH=~/newws/devel/lib:~/oldws/devel/lib:/opt/ros/groovy/lib
CPATH=~/newws/devel/include:~/oldws/devel/include:/opt/ros/groovy/include
PATH=~/newws/devel/bin:~/oldws/devel/bin:/opt/ros/groovy/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PYTHONPATH=~/newws/devel/lib/python2.7/dist-packages:~/oldws/devel/lib/python2.7/dist-packages:/opt/ros/groovy/lib/python2.7/dist-packages
PKG_CONFIG_PATH=~/newws/devel/lib/pkgconfig:~/oldws/devel/lib/pkgconfig:/opt/ros/groovy/lib/pkgconfig
CMAKE_PREFIX_PATH=~/newws/devel:~/oldws/devel:/opt/ros/groovy
rosman@rosmachine:~/newws$ 
rosman@rosmachine:~/newws$ unset CMAKE_PREFIX_PATH 
rosman@rosmachine:~/newws$ unset ROS_PACKAGE_PATH 
rosman@rosmachine:~/newws$ unset CPATH 
rosman@rosmachine:~/newws$ unset LD_LIBRARY_PATH 
rosman@rosmachine:~/newws$ unset PYTHONPATH 
rosman@rosmachine:~/newws$ unset PKG_CONFIG_PATH 
rosman@rosmachine:~/newws$ env |grep oldws
PATH=~/newws/devel/bin:~/oldws/devel/bin:/opt/ros/groovy/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
rosman@rosmachine:~/newws$ source devel/setup.bash 
rosman@rosmachine:~/newws$ env |grep oldws
ROS_PACKAGE_PATH=~/newws/src:~/oldws/src:/opt/ros/groovy/share:/opt/ros/groovy/stacks
LD_LIBRARY_PATH=~/newws/devel/lib:~/oldws/devel/lib:/opt/ros/groovy/lib
CPATH=~/newws/devel/include:~/oldws/devel/include:/opt/ros/groovy/include
PATH=~/newws/devel/bin:~/oldws/devel/bin:/opt/ros/groovy/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PYTHONPATH=~/newws/devel/lib/python2.7/dist-packages:~/oldws/devel/lib/python2.7/dist-packages:/opt/ros/groovy/lib/python2.7/dist-packages
PKG_CONFIG_PATH=~/newws/devel/lib/pkgconfig:~/oldws/devel/lib/pkgconfig:/opt/ros/groovy/lib/pkgconfig
CMAKE_PREFIX_PATH=~/newws/devel:~/oldws/devel:/opt/ros/groovy

Using Groovy on Quantal.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-01-29 22:31:11 -0500

KruseT gravatar image

Catkin uses env caching when you create your devel space first (some people don't like that it does). This means when you create an initial build, e.g. using catkin_make, then what is in your env goes into a file that is used to create the same env next time you source the setup.*sh.

The solution for you is to delete newws/devel, then start a clean terminal (one in which oldws is not in env), and catkin_make (or cmake) new_ws.

If you don't like env caching after playing with it, give feedback.

edit flag offensive delete link more

Comments

Thx. Yes I like to at least give out my opinions. I'll look for the corresponding tickets from github http://goo.gl/QQFtU but if someone can point out the right place for me that's great.

130s gravatar image 130s  ( 2013-01-30 05:08:37 -0500 )edit

Question Tools

Stats

Asked: 2013-01-29 13:30:57 -0500

Seen: 378 times

Last updated: Jan 30 '13