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 CMake warning and error message types #41

Merged
merged 1 commit into from
Feb 25, 2021

Conversation

mabelzhang
Copy link
Contributor

@mabelzhang mabelzhang commented Feb 25, 2021

🦟 Bug fix

Fix CMake warning and error message types, so that they're printed to the terminal during the build.

Summary

In a fresh build when I don't have all the dependencies, I'm getting a line that tells me to see BUILD ERRORS above, but there's nothing printed "above."
It's a dependency error, and it's only printed in stdout and not stderr.
So unless I have convenient access to the log directory (which I don't when building from a Dockerfile), I wouldn't know what package was missing without digging.

Step 15/15 : RUN cd ${IGN_WS}  && colcon build --merge-install --cmake-args -DBUILD_TESTING=OFF
 ---> Running in 623c9c1ecab6
Starting >>> ignition-cmake2
Starting >>> ignition-tools
Finished <<< ignition-cmake2 [1.23s]
Starting >>> ignition-math6
--- stderr: ignition-tools
CMake Error at CMakeLists.txt:231 (message):
  Errors encountered in build.  Please see the BUILD ERRORS above.


---
Failed   <<< ignition-tools [1.27s, exited with code 1]
Aborted  <<< ignition-math6 [1.72s]

Summary: 1 package finished [3.30s]
  1 package failed: ignition-tools
  1 package aborted: ignition-math6
  2 packages had stderr output: ignition-math6 ignition-tools
  12 packages not processed
The command '/bin/sh -c cd ${IGN_WS}  && colcon build --merge-install --cmake-args -DBUILD_TESTING=OFF' returned a non-zero code: 1

Upon entering the container and checking, log/latest/ignition-tools/stderr.log only has two lines:

CMake Error at CMakeLists.txt:231 (message):
  Errors encountered in build.  Please see the BUILD ERRORS above.

whereas stdout.log has these lines:

-- BUILD WARNINGS
--  ronn not found, manpages won't be generated
-- END BUILD WARNINGS

-- BUILD ERRORS: These must be resolved before compiling.
--  Missing: ruby (ruby)
-- END BUILD ERRORS

-- Configuring incomplete, errors occurred!
See also "/home/developer/ign_ws/build/ignition-tools/CMakeFiles/CMakeOutput.log".

After the fix, the output looks like:

$ colcon build --merge-install --cmake-args -DBUILD_TESTING=OFF
Starting >>> ignition-cmake2
Starting >>> ignition-tools
--- stderr: ignition-tools
CMake Warning at CMakeLists.txt:209 (message):
  BUILD WARNINGS


CMake Warning at CMakeLists.txt:211 (message):
    ronn not found, manpages won't be generated


CMake Warning at CMakeLists.txt:213 (message):
  END BUILD WARNINGS



CMake Error at CMakeLists.txt:226 (message):
  BUILD ERRORS: These must be resolved before compiling.


CMake Error at CMakeLists.txt:228 (message):
    Missing: ruby (ruby)


CMake Error at CMakeLists.txt:230 (message):
  END BUILD ERRORS



CMake Error at CMakeLists.txt:231 (message):
  Errors encountered in build.  Please see the BUILD ERRORS above.


---
Failed   <<< ignition-tools [0.13s, exited with code 1]
Aborted  <<< ignition-cmake2 [0.46s]

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

@github-actions github-actions bot added 🏢 edifice Ignition Edifice 🏰 citadel Ignition Citadel 🔮 dome Ignition Dome labels Feb 25, 2021
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Nice catch, this looks reasonable to me.

I wonder if ign-cmake could use the same fix here.

@mabelzhang mabelzhang merged commit 746eb85 into ign-tools1 Feb 25, 2021
@mabelzhang mabelzhang deleted the mabelzhang/fix_cmake_message branch February 25, 2021 22:37
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants