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

Don't use ignition/msgs.hh #315

Merged
merged 8 commits into from
Aug 31, 2022
Merged

Don't use ignition/msgs.hh #315

merged 8 commits into from
Aug 31, 2022

Conversation

mjcarroll
Copy link
Contributor

Using narrowly scoped <gz/msgs/foo> headers cuts compilation time on my computer:

Before:

**** Time summary:
Compilation (181 times):
  Parsing (frontend):          379.8 s
  Codegen & opts (backend):    164.9 s

After:

**** Time summary:
Compilation (180 times):
  Parsing (frontend):          110.9 s
  Codegen & opts (backend):     87.7 s

Signed-off-by: Michael Carroll <michael@openrobotics.org>
@mjcarroll mjcarroll requested a review from caguero as a code owner May 27, 2022 02:01
@github-actions github-actions bot added the 🌱 garden Ignition Garden label May 27, 2022
@codecov
Copy link

codecov bot commented May 27, 2022

Codecov Report

Merging #315 (33eae91) into gz-transport12 (1956422) will not change coverage.
The diff coverage is n/a.

@@               Coverage Diff               @@
##           gz-transport12     #315   +/-   ##
===============================================
  Coverage           88.11%   88.11%           
===============================================
  Files                  52       52           
  Lines                4848     4848           
===============================================
  Hits                 4272     4272           
  Misses                576      576           
Impacted Files Coverage Δ
include/gz/transport/detail/Node.hh 92.42% <ø> (ø)
src/Clock.cc 100.00% <ø> (ø)
src/NodeShared.cc 77.76% <ø> (ø)
src/cmd/gz.cc 95.31% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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.

Yes! Thanks! We should almost never use the library_name.hh headers.

I believe we need to wrap those includes in warning suppressions though, for Windows.

src/cmd/ign.cc Outdated Show resolved Hide resolved
Copy link
Collaborator

@caguero caguero 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 there are extra warnings on Windows.

@mjcarroll
Copy link
Contributor Author

I believe we need to wrap those includes in warning suppressions though, for Windows.

I have a fix coming for ign-msgs that should fix all 🤞

@mjcarroll
Copy link
Contributor Author

Quick note, this will have downstream impacts. Node.hh was previously including <ignition/msgs/msgs.hh>, so anyone who was depending on message definitions being transitively included will be broken.

My preference would be to at least fix it in all of our libraries before merging this. I don't know if this could be considered an API/ABI break as it is depending on bad behavior to work?

@chapulina
Copy link
Contributor

My preference would be to at least fix it in all of our libraries before merging this. I don't know if this could be considered an API/ABI break as it is depending on bad behavior to work?

It's bad practice to rely on indirect includes, so technically we don't have an obligation to keep the includes. It would be nice to add a note to the migration guide. We don't want to break our users knowingly though, and I'm pretty sure this will break people, so I'm in favor of targeting this at main for the public headers. It looks like the whole PR is targeting main anyway, so I no changes needed. +1 for fixing downstream libraries first.

Signed-off-by: Michael Carroll <michael@openrobotics.org>
@chapulina chapulina changed the title Don't use ignition/msgs Don't use ignition/msgs.hh Jun 14, 2022
@scpeters
Copy link
Member

draft pull request to fix the missing includes in gz-sensors with homebrew and windows CI that builds against this branch: gazebosim/gz-sensors#242

@chapulina chapulina added the bug Something isn't working label Jul 23, 2022
@chapulina chapulina added the Breaking change Breaks API, ABI or behavior. Must target unstable version. label Jul 25, 2022
@chapulina chapulina changed the base branch from main to gz-transport12 August 5, 2022 19:06
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking change Breaks API, ABI or behavior. Must target unstable version. bug Something isn't working 🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants