Skip to content
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

Issues preventing rosdoc2 from generating output (API docs) #424

Open
rkent opened this issue Nov 6, 2024 · 0 comments · May be fixed by #425
Open

Issues preventing rosdoc2 from generating output (API docs) #424

rkent opened this issue Nov 6, 2024 · 0 comments · May be fixed by #425

Comments

@rkent
Copy link

rkent commented Nov 6, 2024

Bug report

I've been investigating why launch_ros does not generate any usable python API. That is, why does a url like http://docs.ros.org/en/humble/p/launch_ros/launch_ros.actions.composable_node_container.html show nothing useful.

Required Info:

  • Operating System:
    • Ubuntu 24.04
  • Installation type:
    • NA, running from rosdoc2, either locally or from the official build farm.
  • Version or commit hash:
    • a13359b (which is current rolling)
  • DDS implementation:
    • NA
  • Client library (if applicable):
    • NA

Steps to reproduce issue

View http://docs.ros.org/en/humble/p/launch_ros/launch_ros.actions.node.html

Expected behavior

Useful docs

Actual behavior

Basically empty

Additional information

There are multiple reasons why this is failing, but all related to mocking of modules in sphinx autodoc. The failure with the stock code is:

  File "/home/kent/github/rkent/launch_ros/launch_ros/launch_ros/parameters_type.py", line 50, in <module>
    SomeSubstitutionsType_types_tuple +
TypeError: unsupported operand type(s) for +: 'SomeSubstitutionsType_types_tuple' and 'tuple'
 [autodoc.import_object]

SomeSubstitutionsType_types_tuple is a mocked object, and it does not like to be added.

If you fix that (for example, surrounding it with a try block) there is a new failure. The run hangs with the displayed message:

reading sources... [  6%] launch_ros.actions

I've investigated this issue, and AFAICT it is a sphinx bug with mocked objects. There are actually two levels of this problem. Any attempt to use a mocked object as a decorator seems to generate a delay, then an error about a wrapped loop. But in node it generates an irrecoverable hang. I've developed a minimum test case to demonstrate this, and the offending code is:

@expose_action('node')
class Node():
    """Action that executes a ROS node."""

    UNSPECIFIED_NODE_NAME = '<node_name_unspecified>'

where expose_action is a sphinx mocked object. Without the line UNSPECIFIED_NODE_NAME ... you get the delay and error, but with that line you get a hang. This is reproducible running sphinx directly without rosdoc2.

I'll probably be doing a PR that manually inserts appropriate mocked objects that work correctly, but I wanted to let anyone who cares see that I am investigating.

@rkent rkent linked a pull request Nov 7, 2024 that will close this issue
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 a pull request may close this issue.

1 participant