Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcing env.sh multiple times #24

Open
mmunoz-gmv opened this issue Apr 20, 2018 · 3 comments
Open

Sourcing env.sh multiple times #24

mmunoz-gmv opened this issue Apr 20, 2018 · 3 comments

Comments

@mmunoz-gmv
Copy link
Contributor

The variables generated by the init.rb script in env.sh are set like this:

if test -z "$CMAKE_PREFIX_PATH"; then
  CMAKE_PREFIX_PATH="/home/esrocos/esrocos_workspace/install"
else
  CMAKE_PREFIX_PATH="/home/esrocos/esrocos_workspace/install:$CMAKE_PREFIX_PATH"
fi
export CMAKE_PREFIX_PATH

This causes that, when env.sh is sourced more than once, paths are appended to the environment variables several times.

~/esrocos_workspace$ printenv PYTHONPATH
/home/esrocos/.local/lib/python3.5/site-packages:/home/esrocos/.local/lib/python3.5/site-packages:/home/esrocos/.local/lib/python3.5/site-packages:/home/esrocos/.local/lib/python3.5/site-packages:/home/esrocos/tool-inst/include/ocarina/runtime/python:/home/esrocos/tool-inst/lib:

If a variable is expected to contain a list of paths, for instance PATH, this is harmless. But if it is expected to contain a single path, for instance CMAKE_PREFIX_PATH, it causes problems.
There should be a way to define the variables in init.rb so that the path is not appended, but I couldn't find it. Any suggestions?

@Kynneb
Copy link
Collaborator

Kynneb commented Apr 20, 2018

Good question - this is really an autoproj issue I think.

@mmunoz-gmv
Copy link
Contributor Author

Reported in the autoproj repo.

@mmunoz-gmv
Copy link
Contributor Author

Actually, this comes from the init.rb in the package set. It's probably not an autoproj issue, but we're using a wrong autoproj command (env_inherit).

@mmunoz-gmv mmunoz-gmv reopened this Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants