Skip to content

extend rational why support for a single CMake context was dropped#116

Merged
dirk-thomas merged 1 commit intogh-pagesfrom
extend_single_cmake_context_rational
Mar 10, 2017
Merged

extend rational why support for a single CMake context was dropped#116
dirk-thomas merged 1 commit intogh-pagesfrom
extend_single_cmake_context_rational

Conversation

@dirk-thomas
Copy link
Copy Markdown
Member

Elaborate why support for a single CMake context was dropped from ament based on this comment: #115 (comment)

@dirk-thomas dirk-thomas added the in review Waiting for review (Kanban column) label Mar 7, 2017
@dirk-thomas dirk-thomas self-assigned this Mar 7, 2017
Copy link
Copy Markdown
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I would add is that if you add target level dependencies across packages then you need to make that conditional, otherwise you code may not compile with an isolated build (since the target won't exist in the second package anymore). With that the non-isolated tool now only works with packages that correctly handle intra-package target dependencies and all-catkin workspaces (no plain cmake and no pure python or other things).

@dirk-thomas
Copy link
Copy Markdown
Member Author

The catkin variable <pkgname>_EXPORTED_TARGETS already takes care of that. Therefore I didn't mention it. I consider that an "implementation detail".

If you think strongly about it please add a sentence to clarify this.

@wjwwood
Copy link
Copy Markdown
Member

wjwwood commented Mar 7, 2017

My point is that people have to know to use that or their packages will likely fail at some point with the non-isolated tool due to a race condition. So that puts pressure to support the non-isolated case on package maintainers who may not use that tool.

I don't feel strongly about it, and I agree it's probably too detailed to be mentioned in that article without a lot of supporting material (so people can understand it without a lot of context).

While this significantly speeds up the process it has several drawbacks.
Since all packages within a workspace share the same CMake context all targets are within the same namespace and must therefore be unique across all packages.
The same applies to global variables, functions, macros, tests, etc.
Furthermore a package might need to declare target level dependencies to targets in other packages to avoid CMake targets to be parallelized which need to be sequential.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjwwood Maybe appending the following will clarify enough without adding to much additional information about how it works?

which need to be sequential (but only when being built in the same CMake context).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and if I can suggest a rewording, I think this might be clearer:

... declare target level dependencies to targets in other packages to avoid CMake targets being parallelized when they ought to be sequential (but only when being built in the same CMake context).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 2184a75

@dirk-thomas dirk-thomas force-pushed the extend_single_cmake_context_rational branch from c55ea4f to 2184a75 Compare March 8, 2017 00:02
@dirk-thomas dirk-thomas merged commit 889b8e1 into gh-pages Mar 10, 2017
@dirk-thomas dirk-thomas deleted the extend_single_cmake_context_rational branch March 10, 2017 15:38
@dirk-thomas dirk-thomas removed the in review Waiting for review (Kanban column) label Mar 10, 2017
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

Successfully merging this pull request may close these issues.

2 participants