-
Notifications
You must be signed in to change notification settings - Fork 148
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
Non-path envvars with colons get mangled #448
Comments
A couple paths forward on this:
The whitelist seems the safest— only perform mutations on things you really do understand, but it seems a little scary as well to ensure everything's covered. For example, what about LD_LIBRARY_PATH vs. DYLD_LIBRARY_PATH, ROSLISP_PACKAGE_DIRECTORIES, etc. |
To be clear, I'm assuming this only matters if you're using I now realize that your new logic (from #443) assumes that these paths can be reorder, which is probably not what contributors of the path extensions (catkin or individual packages) intended. Even if you preserve some of the order by avoiding a Also, I think the only "perfect" way to know what should be blacklisted or whitelisted is to get that information from the packages which contributed the env hooks. For any reasonable group of variables I do not think you assume any of these things without information from the packages modifying them:
Only the first one listed is what you've run into here. Since some of these things are set implicitly by catkin itself (i.e. the packages don't explicitly ask to set these variables) I think you could possibly whitelist those env variables. Things like For other variables like W.r.t. the order in which hooks are sourced (topological or alphabetical or by workspace or unspecified), I can talk a bit about what we did in ament to try to clarify this. In ament, env hooks are sourced in topological order, even across workspaces. I think this makes sense, because it allows packages later in the topological order to override dependent packages through manipulation of paths, like the PYTHONPATH, for example. Though I'm not sure how they ought to be handled in catkin when doing an isolated build like you're doing here. I think, but I'm not certain, that this is simply not specified in catkin. Within a single workspace I believe it is the alphabetical order of the env hook files themselves, which are sourced after caktin does its default setting of variables. In fact the environment hooks are done last, see: https://github.com/ros/catkin/blob/kinetic-devel/cmake/templates/setup.sh.in#L78 And they are ordered (alphabetically and some other rules) in the Python script that's run during But once you cross the workspace threshold, then it is done by workspace (older first). ament's design is slightly cleaner, imo, in another way too because the ament tool itself doesn't set environment variables itself. For example, an But as you can see in that example, it uses these common functions like I can imagine a system where the packages which cause these changes declare what they want to do in a DSL-ish thing, something like "prepend X to PYTHONPATH" or "set ROS_MASTER_URI to Y", rather than expressing it in each shell language. From this DSL, shell scripts could be generated, and a tool like Ultimately you loose information when you stop calling the env hooks each time. This is something I brought up at the time, and is why env cache defaults to off (see #249), and now we're trying to recover the missing logic which happens when you just take a snapshot of the env after each package so that we can avoid weird issues when trying to combine paths. |
The code as written is a problem even without the cache (I'm working on a fix; a PR will be up later this evening or tomorrow). I see the issue with not evaluating hooks each time in terms of how it limits what the hooks are capable of doing, but I think there are other more fundamental limits which arise from the "isolated" mode of building when one also attempts to build packages in parallel, specifically:
As far as a plan forward, I'm reworking this logic:
At the end of the day, isolated installspaces with this logic do appear to work well for the env hooks used in the desktop_full package tree, and that's mostly what I care about for my particular use case. |
I like the idea of this merge logic always running, even in the non isolated case, however I see the argument that this breaks the ability of a hook to do something like, for example, remove a directory from a path var. If you'd like, I can add a condition that skips calling |
This is a regression introduced by the changes in #443. Specifically, @tspicer01 and I are seeing issues with
$ROS_MASTER_URI
, because the logic splits on:
and can end up reordering the pieces within a given workspace, so we get crazy stuff in our environments like:I'll have a fix and some proper tests up shortly.
The text was updated successfully, but these errors were encountered: