Repository navigation
generate all ament index markers into <build>/ament_index_preinstall - #65
Conversation
|
|
||
| # register package name with the resource type 'packages' | ||
| ament_index_register_resource("packages" ${ARGN}) | ||
| ament_index_register_resource("packages" ${ARG_PACKAGE_NAME}) |
There was a problem hiding this comment.
Why did you change this? This is not how the API is supposed to be used. See
There was a problem hiding this comment.
A few lines above it errors out if there is anything in ARGN. I don't see how this could ever pass something along. You're right that it won't work as is though. Should I just add the PACKAGE_NAME keyword argument or should I remove the check about ARGN?
There was a problem hiding this comment.
The check above is wrong. The CMake function currently doesn't allow to pass a package name. Instead the check should test for "unused arguments".
The call to ament_index_register_resource can either just pass ${ARGN} as before or explicitly "PACKAGE_NAME" "${ARG_PACKAGE_NAME}".
|
I don't think extending the ament index into the build space ("preinstalled") is a good way. I think sticking to the single responsibility principle here is better. Since all this information is only available within one CMake context of a single package the information can easily be passed within CMake without the need of the file system. |
That makes testing something that uses the ament index impossible (you instead have to have a second, side channel for relaying the information). If you want to veto this approach, please look at ros2/rclpy#13 and suggest an alternative. I'll implement it if it is a better idea, but I cannot think of a better way to do it. I don't see how the "single responsibility" principle applies here. Can you explain why you think that is the case? |
|
Maybe "single responsibility" wasn't a good term. The problem I see is that the concept of having an index in the build space e.g. doesn't apply to Python. Also the fact that the current ament index files are being generated into the build space is an implementation detail. They could very well be generated during the install step. Also none of the other CMake API is currently returning results including the files from the build space. But I do see the use case for this. The first thing to clarify is that this will be a CMake-only thing. E.g. Python won't have that kind of use case. If we then guarantee that the resources are actually created at configure (or build ?) time then I would expect that all CMake API returns information including that source (actually all functions should take an optional prefix path which has a reasonable default). Then CMake code can use the index the same way as the proposed Python test. Otherwise it looks kind of inconsistent to me. I can work on a pull request for that if we have a consensus on this. |
|
Sounds good. |
|
I have created the following branch with the patch: https://github.com/ament/ament_cmake/tree/import_rmw_that_have_python_only2 If it looks good you could move the changes over to this branch in order to test it together with the rclpy patch. |
34913b0 to
03510cb
Compare
|
I merged your branch in (or reset to your branch) and fixed a small thing. I had to make some changes in rclpy, but they've been pushed as well. I think they are both ready for review. I'll start CI and post on the other PR. |
|
The custom prefix path parameter has been added in ab1397b |
|
Ok I now have ros2/rclpy@0f1c31e and 6c84658 that work for me locally. I'm going to kick off a Windows CI to test those out as the short term solution. |
|
It fails still, I think because CMake is still somehow converting it into a list at some point: I'll have to spin up a build on my Windows VM to test and iterate locally. |
|
I'm still unable to use multi item "PATH"'s when passing arguments. So I've just fallen back to sending one item until we can figure out a good way to do that. |
|
I created #66 to track the issue of not being able to pass multiple elements. |
The benefit to this approach is that the location can be used before install for tests which need the ament_index to be in place.
The "preinstall prefix" is exposed through a new cmake function.
Connects to ros2/rclpy#13