Skip to content

[abi_check] Pass quoted cflags to colcon#776

Open
aprotyas wants to merge 2 commits into
ros-industrial:masterfrom
aprotyas:fix_abicheck_cxx_flags
Open

[abi_check] Pass quoted cflags to colcon#776
aprotyas wants to merge 2 commits into
ros-industrial:masterfrom
aprotyas:fix_abicheck_cxx_flags

Conversation

@aprotyas

Copy link
Copy Markdown

The colcon invocation in abi_process_workspace was only providing
the first of the two cflags, hence omitting -Og. To work around
this, the flags must be enclosed by literal quotation marks.

This commit escapes the flag specification to insert these literal
quotes around the flags.

Signed-off-by: Abrar Rahman Protyasha aprotyas@u.rochester.edu

The `colcon` invocation in `abi_process_workspace` was only providing
the first of the two `cflags`, hence omitting `-Og`. To work around
this, the flags must be enclosed by literal quotation marks.

This commit escapes the flag specification to insert these literal
quotes around the flags.

Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
@aprotyas

Copy link
Copy Markdown
Author

For reviewers: to verify, please run both colcon -DCMAKE_CXX_FLAGS=-g -Og and colcon -DCMAKE_CXX_FLAGS="-g -Og" for any package with the -DCMAKE_EXPORT_COMPILE_COMMANDS=ON option. This should generate a compile_commands.json containing the exact compiler calls for all translation units of the project in ros2_ws/build/pkg_name, where you can see what flags are being passed to the compiler.

@aprotyas

Copy link
Copy Markdown
Author

Friendly ping for thoughts/review @mathias-luedtke

@mathias-luedtke mathias-luedtke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!
Your patch seems to fix it.
Could you add a test as well, so that it will stay this way in the future?

Comment thread industrial_ci/src/tests/abi_check.sh Outdated
Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
@aprotyas

Copy link
Copy Markdown
Author

@mathias-luedtke thanks for the review. I'm not sure how to test for this behavior though since its difficult to observe the abi_check interface behavior without parsing compiler command logs. Thoughts?

@mathias-luedtke

Copy link
Copy Markdown
Member

I'm not sure how to test for this behavior though since its difficult to observe the abi_check interface behavior without parsing compiler command logs. Thoughts?

You wrote:

This should generate a compile_commands.json containing the exact compiler calls for all translation units of the project in ros2_ws/build/pkg_name

So why not just check the compile_commands.json? For example with ' grep -q`. I might add this later.

@mathias-luedtke mathias-luedtke self-assigned this Jul 2, 2022
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 this pull request may close these issues.

2 participants