Skip to content

Creating a standalone server executable #2932

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sauk2
Copy link
Contributor

@sauk2 sauk2 commented Jun 3, 2025

🎉 New feature

Related to gazebosim/gz-tools#7, gazebo-release/gz-sim8-release#8 and #2737

Summary

This PR extends on the recent migration of gz sim to use a standalone executable, gz-sim-main. This executable also launches a GUI executable when built using -DENABLE_GUI=ON. This change updates the CMake configuration to allow the gz-sim-main executable to be reused for building a standalone server executable, gz-sim-server irrespective of the -DENABLE_GUI=ON argument. Additionally, GUI-related CLI flags are now conditionally compiled using WITH_GUI, ensuring that GUI-specific options do not appear in gz-sim-server or in gz-sim-main when built without GUI support.

Test it

After compilation, check for a new executable named gz-sim-server-client inside libexec/gz/sim10. Calling it should launch the server without any GUI.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • 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
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

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

@sauk2 sauk2 requested a review from mjcarroll as a code owner June 3, 2025 17:24
@github-actions github-actions bot added the 🪵 jetty Gazebo Jetty label Jun 3, 2025
sauk2 added 2 commits June 4, 2025 01:31
@j-rivero
Copy link
Contributor

j-rivero commented Jun 6, 2025

to be reused for building a standalone server executable, gz-sim-server-client

I think that we can simply call it gz-sim-server

Before continue reviewing the code, note that the validation step that we need for the official docker images coming from our .deb packages is that a single build WITH_GUI produces a server binary that does not use any X / Qt / other Xorg related library. We are linking the new server against the Qt libraries:

gz-sim/build on  standalone-server-exe [?] via C v13.3.0-gcc via △ v3.28.3 ❯ ldd ./bin/gz-sim-server-client  | grep Qt
	libQt6Core.so.6 => /lib/x86_64-linux-gnu/libQt6Core.so.6 (0x000074d147e00000)
	libQt6Quick.so.6 => /lib/x86_64-linux-gnu/libQt6Quick.so.6 (0x000074d146e00000)
	libQt6Qml.so.6 => /lib/x86_64-linux-gnu/libQt6Qml.so.6 (0x000074d146800000)
	libQt6Widgets.so.6 => /lib/x86_64-linux-gnu/libQt6Widgets.so.6 (0x000074d146000000)
	libQt6Gui.so.6 => /lib/x86_64-linux-gnu/libQt6Gui.so.6 (0x000074d145800000)
	libQt6QmlModels.so.6 => /lib/x86_64-linux-gnu/libQt6QmlModels.so.6 (0x000074d146d40000)
	libQt6Network.so.6 => /lib/x86_64-linux-gnu/libQt6Network.so.6 (0x000074d144869000)
	libQt6OpenGL.so.6 => /lib/x86_64-linux-gnu/libQt6OpenGL.so.6 (0x000074d1474a4000)
	libQt6DBus.so.6 => /lib/x86_64-linux-gnu/libQt6DBus.so.6 (0x000074d145f4b000)

This probably comes from the fact of llnking it to gz.

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.

Let's try to fix the X / Qt issue

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Jun 6, 2025
@sauk2
Copy link
Contributor Author

sauk2 commented Jun 9, 2025

Let's try to fix the X / Qt issue

Thanks for catching this! I have made changes in CMake to not link the gz library to gz-sim-server. I think that should solve this issue.

@sauk2 sauk2 requested a review from j-rivero June 9, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪵 jetty Gazebo Jetty
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants