Repository navigation
Add testcase and fix for include order of generated code with stdint.h - #263
mathias-luedtke wants to merge 2 commits into
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
|
@adbidwai to take a look |
|
Hi, I can take a look at this. Thanks! |
fujitatomoya
left a comment
There was a problem hiding this comment.
I do not think we can take this without fixes, because this generates intentionally red test.
Signed-off-by: Mathias Lüdtke <[email protected]>
26b66a6 to
6222bb3
Compare
I can add the fix as well, but I need to know which option you do prefer (see #264) |
|
@fujitatomoya: Which fix would you prefer?
|
|
I'd say that the best option we got here is to hoist the include to the top-of-file system-header block, conditionally at the interface level with checking that interface requires the header. but i guess that perfectly acceptable fallback: always include <stdint.h> in the top block if that makes the complicatoin. I was thinking about the compile-time concern but stdint.h is one of the smallest headers in the standard library. what do you think? |
Signed-off-by: Mathias Lüdtke <[email protected]>
fb9dcee to
9dbae59
Compare
I came up with mathias-luedtke@620a026
It turns out that Python.h already includes it, so it should not affect compile time. Furthermore - depending on the message type - the generated code already uses the types from stdint.h without including them explicitly. IMHO always including |
|
For whatever it is worth for the re-review: I checked 9dbae59 against a real downstream failure and it resolves it.
(https://github.com/tue-robotics/ed_gui_server/actions/runs/33599833100) I have no rolling environment at hand, so I checked it two ways:
The second is on a reconstruction of the rolling output rather than the real thing, so please read it as corroboration of the first rather than an independent result. The middle case is the control — without it a clean run would not mean much. The same argument covers the |
|
@fujitatomoya: Is there anything else blocking this? |
On Rolling, rosidl_generator_py puts <stdint.h> after the other headers in the generated C code of a service that has buffers only in its response. GetEntityInfo has that shape, so cpplint_rosidl_generated_py fails with build/include_order. The generated file is not ours to fix. Disable only that test, and only on Rolling, until ros2/rosidl_python#263 (fixing ros2/rosidl_python#264) is released. Jazzy still runs it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Follow-up to my earlier comment: I have now tested this in a real build, not a reconstruction. Setup: the released Rolling packages for Ubuntu 24.04 (
With this PR, Not covered: I did not build the PR head on 0.28.1, and did not run this package's own test suite, so the new |
|
This covers the gap from my last comment: the PR head as-is, on current Rolling. Setup: the
So the new |
Description
This PR add a test case that shows that cpplint checks fail for generated code for services that have buffers in their response, but not in the request.
The same issue should happen for actions.
The tests will fail with:
Is this user-facing behavior change?
No
Did you use Generative AI?
No
Additional Information
This issue was introduced by #250