-
Notifications
You must be signed in to change notification settings - Fork 46
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
Warn user that they are wrong if they colcon build
after source install/setup
#194
Comments
Unfortunately yes.
I do understand the "possibly incorrect" part (since other packages are available to a package without depending on them). Can you elaborate how the second build is slower - and quantify what level of slower you are experiencing with what kind of workspace?
If the |
In Linux builds, I haven't measured it being slower. The main point I'm trying to make is that both you and @mjcarroll have told me now that this workflow should not be done. But, it's not documented anywhere that I know of and is a subtle detail, so we should have colcon warn the user that they're doing something incorrectly. If |
Well, "incorrectly" is a strong word 😉 There are probably numerous cases where it won't harm you at all. On the other hand there are also various other cases not related to sourcing the install space which would still result in possibly incorrect results:
Anyway, we can try adding the warning and see if it helps. It would be great if you could create a pull request for this. |
@emersonknapp Are you still interested in adding this warning? |
I am interested - just haven't found the time to get up to speed on the relevant code. I can try to carve out a bit of time this week or next |
This is a bit of an aside but I think pertinent to this issue... Unfortunate/incorrect/or otherwise, the series of events described above (sourcing an install/setup file interleaved with building) happen a lot and get quite nasty when working on multiple projects with different workspaces. Removing this (sometimes hidden) statefulness was one of the strengths of catkin-tools and I’ve been struggling to figure out how it could be integrated into colcon as we start to migrate. @dirk-thomas Are there any plans to support storing this kind of meta-data in the workspace? Or thoughts on how this would fit into the extension system of colcon? |
This seems to be an orthogonal topic to the one described in this ticket. Please consider to fill a separate ticket for this
Please be more precise what exact meta data you are referring to. The parent workspaces are known when building in a workspace based on the current environment atm.
When creating a separate ticket for this please include more information what exact behavior you are envisioning (not just referring to "what catkin_tools does"). I simply don't have enough context to give you any feedback on this without. In general "rolling back" the environment changes a setup file causes are imo technically almost impossible. The setup files generated by |
I actually think this ticket is a symptom of statefulness in the build process that limits reproducibility. However, happy to open a new ticket.
Sorry, more precisely I mean the profile concept of catkin_tools: collecting the workspace you want to extend, extra build arguments, extra cmake arguments, install destination, etc and storing in the For my team, that was a major breakthrough in terms of usability and working with many different workspaces so I'm interested in figuring out how to implement a similar concept as we migrate to ROS2 and need to use colcon.
|
@jonfink I don't understand your comment. Can you please elaborate what you mean with this. The build itself doesn't affect the environment at all. The only part which changes the environment is sourcing the setup file which sets up variables necessary to run / use the artifacts of the packages after they have been built and installed. While those variables are required to use the artifacts (e.g. extending
All of these configuration would be covered by the concept of a profile as described in #168 which would indeed be very useful to have.
Maybe I am not aware of some functionality in In ROS 2 we simply choose not to offer an incomplete rollback feature since we don't see any technical way to achieve a correct / complete rollback (beside of course using a subshell and closing that as mentioned above). |
It seems that many users will invoke
colcon build
in a shell after sourcing the setup files.The thought process is "I am building - now I want to test run one of the binaries - now I want to rebuild".
However, this workflow leads to slow (and possibly incorrect?) results.
We could perhaps set a canary variable in the setup.bash file, and check for it in
colcon build
, then at least warn the user that it's not advised.The text was updated successfully, but these errors were encountered: