-
Notifications
You must be signed in to change notification settings - Fork 65
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
rospack depends should list all (un)resolved dependencies when it exits with non-zero #111
Comments
The dependencies in a package manifest must be valid rosdep keys. That can be either:
In general if any recursive dependency is not resolvable it makes sense to return with a non zero code to indicate that something is wrong. Relying on reading the So the behavior you are seeing is intentional and I don't think it should be changed. The question is why |
Yes, I didn't mean to say that you shouldn't return an error code. The reason why stderr should be used for error output is that it can be easily ignored and wouldn't require more complex filtering of the program output. In our use case, we would just route the error output to /dev/null, perhaps print a warning to run If you don't want such a behavior as default, I still don't see why it couldn't be an option such as |
That sounds good. I will reopen the issue and updated the title accordingly. Please consider contributing a pull request to implement the enhancement you would like to see. |
@dirk-thomas I have added the necessary changes. However, before I'll make a PR, I'd like to know if there is any (scripted) way of testing the functionality to make sure everything still behaves as expected? |
The tests of the |
I assume Regarding the additional unit test, I can only add a test that checks whether normal output is given despite an exit code != 0 without breaking ABI compatibility for all compilers because to test whether it also reports multiple errors the log function signature has to be changed to virtual to allow for a mock override. Changing the behavior from exiting after an error to continuing already requires changing the return type of some functions from void to bool which is not an issue with gcc but I believe breaks ABI compatibility for MSVC (because the latter encodes the return type in the name mangling). Would you prefer complete ABI compatibility or is ABI compatibility on most compilers for Unix/Mac systems sufficient? |
How about calling the not-mocked API on a test directory which actually reports more than one failure?
I would say first start with an ABI changing PR which targets the upcoming Noetic distro. And then we can discuss if it makes sense to go through the extra effort to make this available in an ABI stable fashion for already released distributions. |
That would just test whether the exit code is correct and it still generates normal output. |
I'm almost ready to submit a PR. There is no |
Just create the PR against the current default branch and add a note that the change should only be merged into a I can't recommend anything for the tests atm since I simply don't have enough context. Fell free to choose something and I will look at it when reviewing the PR. |
We have a debian package build script that uses
rospack depends
to gather the dependencies it has to build.However, some packages may have dependencies that are not ROS packages, e.g.,
moveit_planners_ompl
which depends on ompl.While
rosdep
can resolve ompl, it is not in the keys collection since it's not a ROS package.The current behavior is to exit prematurely with an error which is not really optimal.
I would suggest to either add an argument to ignore the errors (since there is already a parameter to do so in the relevant method) or improve the lookup to not fail in such cases.
I think it would also be better to print errors to the error stream and continue instead of throwing but that would be a significant change in behavior.
If you tell me which changes would be preferred, I would be happy to submit a PR.
Alternatively, I assume we would have to use
rosdep keys
and do the recursion on our own?The text was updated successfully, but these errors were encountered: