-
Notifications
You must be signed in to change notification settings - Fork 9
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
Package identification & build tasks for colcon-ros-cargo #1
Conversation
52d68b7
to
25f139e
Compare
@nnmm thank you so much for working on this! One question, though, how does this compare to rust-lang/cargo#6100 ? It seems to me that I will test this later, but wanted to ask, does the Cargo plugin modify the source space of a package in any way? Or does everything happen in the build space? |
Yes,
It does not modify the source space of a package in any way. The colcon-ros-cargo plugin creates |
|
||
def add_arguments(self, *, parser): # noqa: D102 | ||
parser.add_argument( | ||
'--lookup-only-install', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I followed the decision made by the people in the chat: To resolve to the source space by default. However, I wanted to point out a few things I realized in working on colcon-ros-cargo:
- We need to copy sources to the install directory anyway, not only to make messages work, but also for depending on another workspace, like mentioned yesterday. But the performance impact of that is totally negligible. Even if we're worried, copying could be done in parallel to building.
- I can empirically confirm that scanning the source space takes upwards of 1 second for a workspace like AutowareAuto.
So the cost matrix looks like this (x is the use case, y is the design decision):
┌─────────────────────┬────────────────────────┐
│ build cargo │ generate a config.toml │
│ packages with │ and not use colcon │
│ colcon (frequency: │ afterwards (frequency: │
│ high) │ low) │
┌─────────────────────┼─────────────────────┼────────────────────────┤
│ Searching workspace │ Needless workspace │ No cost │
│ plus install space │ scan (1s+) or pass │ │
│ is the default │ in --no-search-ws │ │
├─────────────────────┼─────────────────────┼────────────────────────┤
│ Searching only the │ No cost │ Need to pass in │
│ install space is │ │ --search-ws │
│ the default │ │ │
└─────────────────────┴─────────────────────┴────────────────────────┘
Since generating a config.toml basically needs to be done only once, I think the left half should be weighted stronger. That's why I thought it would be better to switch the default around, so that it uses searches the install space by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm understanding this correctly. I think it should only search the install space, like what happens with every other package in a colcon workspace, that's why I asked in the chat if the source space was accessed in any way a few days ago. The source spaces of other packages are never accessed with the other build types, only the install spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I think this was a bit unfortunate: The two of us discussed this once in the past before some of the other people joined, and agreed that dependencies should point to the install space. Later, the topic was brought up again and people voted in favor of dependencies pointing to the source space by default, and I couldn't reach you for comment.
I changed the default now to searching only the install space. It's not a big deal since depending on the source space is still possible with the flag.
I also noticed that the README got lost at some point and added it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem! That's what PR are for 🙂
This includes cargo-ros-install, a wrapper around cargo build which installs files into the correct places for ROS 2 tools to find them.