ros-industrial / industrial_ci

Easy continuous integration repository for ROS repositories
Apache License 2.0
248 stars 129 forks source link

[`abi_check`] Pass quoted `cflags` to colcon #776

Open aprotyas opened 2 years ago

aprotyas commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Friendly ping for thoughts/review @mathias-luedtke

aprotyas commented 2 years ago

@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 commented 2 years ago

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.