I’ve started implementing nix builds for gazebo in the context of a PX4-Autopilot draft PR:
XRef:
I’ve started implementing nix builds for gazebo in the context of a PX4-Autopilot draft PR:
XRef:
Hello David:
This is are really great news ! It was on my plans to add the Nix support the Gazebo libraries at some point either via GSoC or other community participation effort, some model that can work like the one we have with the great conda-forge/robostack guys.
Feel free to contact me or the core team directly to support your efforts from the code base and/or infra as much as we can. The road is probably prepared after all the patches that @traversaro and co. sent while preparing conda-forge.
I add this for today PMC meeting so we the core team is aware of the efforts. Thanks for sharing.
I can run gz sim
but get a segfault. I just have one patch for some nasty relative paths.
Right now, I could need a matrix contact to iron out dependencies. Then everything might work already in PoC quality.
I’ll DM my matrix handle.
Are you enabling the the GZ_ENABLE_RELOCATABLE_INSTALL
CMake option in all gz projects? I am not familiar enough with Nix, but if relocatability is required you may want to check Relocatable Gazebo installation · Issue #626 · gazebosim/gz-sim · GitHub .
It doesn’t sound like a hot lead. Nix has a global stable namespace and address of everything. (/nix/store/...
)
They never mutate after the build.
GZ commands (as discovered by the gz
ruby dispatcher) need to be wrapped so that QT env variables are propperly set.
❯ QT_DEBUG_PLUGINS=1 gz sim &> log && head -n150 log
Library error: libgz-tools2-backward.so.2.0.2 not found. Improved backtrace generation will be disabled
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/nk427kbyf9l6fpfdxb8hmrq2nlkl8nfl-patchelf-0.15.0/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/8v6k283dpbc0qkdq81nb6mrxrgcb10i1-gcc-wrapper-14-20241116/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/2agih0y5ns3sgbviw2xhivdgg59b41g9-gcc-14-20241116/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/nq61v7a601gjndijq5nndprkzpwz4q9g-glibc-2.40-66-bin/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/yh6qg1nsi5h2xblcr67030pz58fsaxx3-coreutils-9.6/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/r8gajll0yb0c08hd734lyj3jmqav3p9a-binutils-wrapper-2.43.1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/s40y31bdn82sj6daaxid1bn3p7la03lv-binutils-2.43.1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/fnpzam4rbqlzq73r688l04sgafa4dnq2-astyle-3.6.7/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/bak2czmaxxryj9dbx64nbay86ivdkb4g-ccache-4.11.2/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/ciiwq1ymzac9m5azhf4higkynmy3f8f7-cmake-3.31.5/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/xabbzzgh7mlmzrxmcxwb8nnrp26358cy-cppcheck-2.17.1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/8mldw611f5mbgsl6fpz1khk4wjflvxb7-file-5.46/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/mmfmyi6fl8ggvhwd2nfc9ds1d71gkwz6-gdb-16.2/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/lqx2rv26sdndpa2vyy2vxsahj03km69z-git-2.48.1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/xplz1kpqy8cm3m9sbf2rw3hcgjhdsmaa-lcov-2.3/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/mk0bfbm0lawvgg84d6w6lyr2vl6cpjwh-libxml2-2.13.6-dev/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/awyaxlni0mfbj36qax305ymhjviyijiq-libxml2-2.13.6-bin/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/82swvr3wb8yg6jbbn7figik7ipsm42hx-ninja-1.12.1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/h0xyrc6895h2841zaajihmyz5ihjsz0z-python3-3.12.9-env/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/daqrajxb67wa7ja2bq1jxy5pavx7912k-rsync-3.4.1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/dhnqlishcv0v6i0909kymyrhmwpzq072-shellcheck-0.10.0-bin/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/ycli2afmijaqi9vmv6rwz4jbcrbly3x7-unzip-6.0/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/y2c2xz67ldvxh8d74vfq3716xmlz54nh-zip-3.0/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/yzi7fsg8zbpb2rhy6dc6bi1hmq3cqxdr-automake-1.16.5/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/n0cff4vzsp9dk7v7kk4c3f67kx3hgib0-bison-3.8.2/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/r9g33qd54b8z66jz25z6v71lpmmhng1c-gnum4-1.4.19/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/alnp7ki4l517wf6crdka0mn34y5f01q8-flex-2.6.4/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/sdjbn2872dpch112zns01288ckj9jrrp-gcc-arm-embedded-12.3.rel1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/n6sqj8irxvxzxsxk9gpbrj58qi2i2asy-genromfs-0.5.2/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/mhmgm739aagj4x7hr6ag2wjmxhmpy8mf-gettext-0.22.5/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/03rid3jm8czmmjwkwfiw9a157lin0ri5-gperf-3.1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/g98vb1d0zwi91vxxrx13fmy6bvzhv2ir-kconfig-frontends-4.11.0.1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/14rd6ah3l2my254rgbvnw2gf8rlmxa8r-expat-2.6.4-dev/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/k6p7j4dfvzhdb844vgqjsizbvlmprkzq-ncurses-6.5-dev/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/80l1sb3vcmrkcdd7ihlizkcnv19rq9fj-ncurses-6.5/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/c8gnrjnrif8wbq93laa6lfsnjaibg33m-gz/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/xq5f95pp297afc2xjgrmhmf9w631qp7m-findutils-4.10.0/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/wj1c3gsiajabnq50ifxqnlv60i5rhqj7-diffutils-3.10/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/xhql0ilzbiqwnmz4z8y0phk611wynxf2-gnused-4.9/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/40yifhx34v4g4llrdn3v2ag8w02j10fv-gnugrep-3.11/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/r66s4mjwqi7zkqqyry5yhhv0wm5rw96a-gawk-5.3.1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/hfkclq54gppdb9fshnkwfdph1safyvli-gnutar-1.35/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/4q2sv4sqb7y8y4pp3n9bf2aabmgqmwmy-gzip-1.13/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/pcf18502sz0b25qya2lzm5f7wy0pd7a6-bzip2-1.0.8-bin/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/zzgldw3dwyhzn7sw9cyq7d7k57h0yx46-gnumake-4.4.1/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/58br4vk3q5akf4g8lx0pqzfhn47k3j8d-bash-5.2p37/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/lf3ln60nya8xmkymabap9i7gqj60k9py-patch-2.7.6/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/f246qzchy7zy00z1f42dqz9jiwcf5n7f-xz-5.6.4-bin/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/hyp4b779nh5y4m48zvvhd4y3z1gm8hd5-file-5.46/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/home/dar/.nix-profile/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/home/dar/.local/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/run/wrappers/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/profile/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/home/dar/.local/state/nix/profile/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/etc/profiles/per-user/dar/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/var/nix/profiles/default/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/run/current-system/sw/lib/qt-5.15.16/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/xk96lh29cjq0ak8zf89as6yk3wj7zh0x-ruby-3.3.6/bin/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Escalating to SIGKILL on [Gazebo Sim Server]
Ok, that looks not bad:
# Default plugins (customize this list as needed)
gzPlugins = [
pkgs.gz-gui
# Add other plugins here
];
❯ result/bin/gz gui
gazebo-tooling/nix
(or gazebo-tooling/release-tools
?) / @jrivero can you create & give me temp (!) access?nix run github:gazebo-tooling/nix#gx -- gui
for example) & shorten the feedback loop as much as possible?
Cool! Just to clarify, gz gui
is not the GUI of the gz simulator, so a more interesting test would be gz sim
(or alternatively gz sim -s
and gz sim -g
in two different terminals). That would make sure that both rendering and physics plugins are correctly loaded.
Yay ! awesome !
We tried not to host package metadata inside the upstream source repositories (with maybe the exception of Bazel at this point). This is for two main reasons:
It would great if we start by hosting the NIX necessary metadata outside the gazebosim organization by now to give it time to evolve and mature as the community starts using it. The conda-forge approach is a good example of this.
From the core team we can help dealing with any change that it is required to be done to the library sources.
I see, in that case the next best plan would be to get fully behind:
github com/NixOS/nixpkgs/pull/394757 (can’t post the link)
I’ll pick up conversations with the author.
EDIT: I’m seeing my posts are getting flagged. Is there a venue where we can communicate undisturbed/undisturbing?