The --extend
option is define within catkin which generates the setup files (not catkin_tools
).
The chaining of workspaces basically works as follows:
- If you build a workspace A without sourcing any setup file before the workspace A is not chained (so it can't use anything from other workspaces)
- When you source the setup file of workspace A and then build a workspace B that workspace B will overlay the sourced workspace A).
- When you then source the setup file of workspace B and then build a workspace C that workspace C will overlay the sourced workspace B and the workspace A).
What you can commonly not do is source two setup files. At least you won't get the result you might expect. Lets consider the following example:
After describing all this for ROS 1 finally getting to the difference in ROS 2:
The setup files in ROS 2 / ament do not contain any logic to undo changes of previously sourced workspaces. Simply because that logic is very fragile and likely to be incomplete in non-trivial cases. As such they also don't provide the --extend
logic since you can simply source two setup files from independent workspaces and the result will be an environment containing both.