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

Fix test compilation with USE_INTERNAL_URDF #800

Merged
merged 5 commits into from
Dec 27, 2021

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Dec 23, 2021

🦟 Bug fix

Fixes compilation with USE_INTERNAL_URDF == True

Summary

I noticed that the 10.7.0~pre1 debbuilds failed to compile some tests with complaints about finding urdf headers:

src/parser_urdf.cc:30:10: fatal error: urdf_model/model.h: No such file or directory
 #include <urdf_model/model.h>
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
src/CMakeFiles/UNIT_ParamPassing_TEST.dir/build.make:257: recipe for target
 'src/CMakeFiles/UNIT_ParamPassing_TEST.dir/parser_urdf.cc.o' failed

It turns out the debbuilds are using USE_INTERNAL_URDF == TRUE since pkg-config is not listed as a build-depend in the debian metadata. I will resolve that shortly. In the meantime, this ensures that the USE_INTERNAL_URDF logic for include and windows compiler definitions used for libsdformat10 is repeated for tests that add parser_urdf.cc via target_sources.

Update: I've simplified the cmake logic using an interface library called using_parser_urdf.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

The USE_INTERNAL_URDF logic for include and
windows compiler definitions needs to be repeated
for tests that add parser_urdf.cc via target_sources.

Signed-off-by: Steve Peters <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2021

Codecov Report

Merging #800 (b50c3ce) into sdf10 (1a2c406) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##            sdf10     #800   +/-   ##
=======================================
  Coverage   88.30%   88.30%           
=======================================
  Files          66       66           
  Lines       10571    10571           
=======================================
  Hits         9335     9335           
  Misses       1236     1236           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a2c406...b50c3ce. Read the comment docs.

@@ -62,7 +62,13 @@ if (BUILD_TESTING)
endif()

if (TARGET UNIT_ParamPassing_TEST)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the nested ifs and the target_ commands, is this check now superfluous and can be removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

if that is the case we can probably join both instructions related to UNIT_parser_urdf_TEST and UNIT_ParamPassing_TEST after the same if (USE_INTERNAL_URDF) clause.

Copy link
Member Author

Choose a reason for hiding this comment

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

this block is inside if(BUILD_TESTING), but this test does not run on windows, so I think it is important to check that the test target exists. I think there is a more elegant way to express this; let me think about it...

Copy link
Member Author

Choose a reason for hiding this comment

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

ok I've simplified it quite a bit in 2ba37d8 by using a cmake interface library

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe I've addressed this comment and will merge so I can prepare another prerelease pull request

Copy link
Contributor

@j-rivero j-rivero left a comment

Choose a reason for hiding this comment

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

Minor comment, looks good.

@scpeters
Copy link
Member Author

@osrf-jenkins run tests please

@scpeters
Copy link
Member Author

@osrf-jenkins run tests please

@scpeters scpeters merged commit cf81994 into gazebosim:sdf10 Dec 27, 2021
@scpeters scpeters deleted the fix_build_with_internal_urdf branch December 27, 2021 08:30
@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-01-10/1228/1

@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-03-25-fortress-edifice-citadel/1343/1

@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-04-13-fortress-edifice/1367/1

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.

4 participants