Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ament_cmake_core/doc/versioning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Express Version Compatibility in the Installation

Add a COMPATIBILITY argument to `ament_package`. Default to AnyNewerVersion if not supplied which matches current behavior.

User call in `foo's` `CMakeLists.txt`:
```cmake
ament_package(COMPATIBILITY SameMajorVersion)
```

The compatibility would be forwarded to `write_basic_package_version_file`.

Then, you can use it in `bar`
```cmake
find_package(foo_core 4 CONFIG REQUIRED)
```

If you forgot to update `foo_core` from 3 to 4 and rebuild your workspace, then colcon
will fail at the configure stage of `bar` with a nice error message.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Express Version Compatibility in Dependencies

`ament_export_dependencies` shall propagate the version requested of dependencies to a call to `find_dependency <version>`.

For example:
`find_package(foo_core CONFIG 4)` results in
`add_dependency(foo_core CONFIG 4)`.

`find_package(foo_core CONFIG 4.8.3-dev2)` results in
`add_dependency(foo_core CONFIG 4.8.3-dev2)`.

`find_package(foo_core MODULE)` results in
`add_dependency(foo_core MODULE)`.

I think this can be done automatically with the use of `foo_core_FIND_VERSION`.

Adding in the find method of MODULE/CONFIG may be out of scope for this discussion.

I want to avoid a user manually maintaining versions in multiple places.
It's hard enough as it is to remember when you add a find_package call to also add it to `ament_export_dependencies`.