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

[abi_check] Pass quoted cflags to colcon #776

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aprotyas
Copy link

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
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
Author

Friendly ping for thoughts/review @mathias-luedtke

Copy link
Member

@mathias-luedtke mathias-luedtke left a comment

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?

industrial_ci/src/tests/abi_check.sh Outdated Show resolved Hide resolved
Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
@aprotyas
Copy link
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
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.

None yet

2 participants