-
Notifications
You must be signed in to change notification settings - Fork 31
What must be done to remove scripts/setenv? #5
Comments
If you want to remove it you have to address it's main use cases:
Use case by use case solutions:
Now back to original issue, how do you use IDEs? Just set the paths that scripts/setenv sets manually in the IDE. This is how I used pydev to do much of the original R@M python development. With something like Eclipse you would probably be able to automate this as well. |
Right now with CMake, it's already set up in a way where RAM_ROOT_DIR isn't used. scripts/setenv isn't needed for compilation at the current moment. It's only needed at runtime. There's a special job defined to run first in the build to test for scripts/setenv, which was only put there because the automatic running of tests needed it and everyone kept getting confused by the error messages when you forgot to run the script, so I removed the ability to compile without setting scripts/setenv. RAM_SVN_DIR is the important one (and the reason scripts/setenv needs to be run for unit tests), as certain code relies on its existence. Here's a quick grep looking for where it's used in the code.
Removing scripts/setenv is finding another solution to these tests. The two ways I've seen of doing this are:
rpath is already used for binaries. I forgot about this when I was originally talking with @jwonders. virtualenv doesn't work that way. It takes advantage of how Python itself find libraries. virtualenv automatically generates some scripts to make using it easier, but all that's required is you use the version of Python in the generated tree structure that virtualenv makes. Your bash environment does not need to be changed at all. |
Glad to see your better CMake build system mitigates most of the issues. I would go for the approach you listed of trying to find the root directory dynamically, but I would wrap it up in a function like "std::string ram::findTreeRoot()". As for virtualen, requiring the user to use a specially generated script to use your special environment is quite similar to have a script setup that envrionment in the first place. I use an extension called virtualenvwrapper which automatically switches which special python interp you are using, it does mess with shell variables. |
If I remember correctly, you can specify a working directory for tests within CMake / CTest. This would allow us to use relative paths where RAM_SVN_DIR is used in the tests. Finding the root dynamically is probably the easiest way to deal with the uses in python unless you want to have CMake generate a header file with a macro for the directory and then wrap a function for python. |
See this issue for the discussion that led to wanting to figure out what all will need to be done to remove scripts/setenv.
The text was updated successfully, but these errors were encountered: