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 problems on IgnOGRE when version is not found #175

Merged
merged 5 commits into from
Aug 26, 2021

Conversation

j-rivero
Copy link
Contributor

🦟 Bug fix

Summary

When Ogre is not found (looking for 1.10 in a 1.9 environment), the builds fail with:

CMake Error at /usr/share/cmake/ignition-cmake2/cmake2/FindIgnOGRE.cmake:214 (if):
  if given arguments:

    "VERSION_LESS" "1.11.0"

  Unknown arguments specified
Call Stack (most recent call first):
  /usr/share/cmake/ignition-cmake2/cmake2/IgnUtils.cmake:189 (find_package)
  CMakeLists.txt:69 (ign_find_package)


-- Configuring incomplete, errors occurred!

There is a final block starting at line 240 that is not protected by the check of OGRE_FOUND leaving OGRE_VERSION empty and making the whole thing to crash. I did not find any reason not to include it under OGRE_FOUND.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • 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

Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
list(APPEND OGRE_INCLUDE_DIRS ${dir_include})
endforeach()
list(APPEND OGRE_INCLUDE_DIRS ${dir_include})
endforeach()
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like this block of code is now moved to to the Windows section (instead of if (OGRE_FOUND))? When building ign-rendering with this branch, I get error about not being able to find an ogre include header during compilation. How about just protecting it with a separate if (OGRE_FOUND) check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ouch, good catch! 0b05939

Copy link
Contributor

@adlarkin adlarkin left a comment

Choose a reason for hiding this comment

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

I'm trying to test this locally. Any tips for what setup to use to re-produce this behavior?

Changelog.md Show resolved Hide resolved
@iche033
Copy link
Contributor

iche033 commented Aug 11, 2021

@adlarkin, I'm testing it with this PR: gazebosim/gz-rendering#376

Without these changes, I get the VERSION_LESS cmake error

@adlarkin
Copy link
Contributor

I'm testing it with this PR: ignitionrobotics/ign-rendering#376

Without these changes, I get the VERSION_LESS cmake error

I'm not able to reproduce the error without these changes 🤔 I built a workspace with the ign-cmake2 branch and gazebosim/gz-rendering#376. are there certain ogre packages I should/should not have installed? I installed all of the dependencies listed in https://github.com/ignitionrobotics/ign-rendering/blob/ign-rendering3/.github/ci/packages.apt, which includes libogre-1.9-dev and libogre-2.1-dev.

@iche033
Copy link
Contributor

iche033 commented Aug 12, 2021

I'm not able to reproduce the error without these changes

hmm I just rebuilt my workspace and I can't reproduce it now too..

But I think we may run into this error with no ogre debs installed in the system though.

@adlarkin
Copy link
Contributor

I think that the changes in the PR make sense. I'd just like to be able to test locally if possible in order to avoid new breaks that we might not be aware of. But, maybe it's difficult to create a scenario to test this, I'm not sure.

Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

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

I think the changes make sense. We can get this in

@@ -1,6 +1,9 @@
## Ignition CMake 2.x

### Ignition CMake 2.X.X (20XX-XX-XX)
### Ignition CMake 2.X.X (2021-08-23)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we planning to make an ign-cmake release once this PR is merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might need to since seems to be causing problems on current CI. See gazebosim/gz-rendering#376 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

leaving here by now. Going to merge to solve problems on CI.

@j-rivero j-rivero merged commit ac80fa9 into ign-cmake2 Aug 26, 2021
@j-rivero j-rivero deleted the jrivero/fix_ogre_not_found branch August 26, 2021 17:06
srmainwaring pushed a commit to srmainwaring/gz-cmake that referenced this pull request Mar 1, 2022
* Fix problems on IgnOGRE when version is not found

Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel 🔮 dome Ignition Dome 🏢 edifice Ignition Edifice 🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants