Skip to content

Conversation

@tdejager
Copy link

@tdejager tdejager commented Oct 24, 2025

Hey @facontidavide, this is one of the pixi maintainers here. This is my first attempt at using PlotJuggler as a use-case to build with RoboStack and standalone using pixi and the pixi build. Feature, more on this: https://pixi.sh/latest/ and specifically pixi build: https://pixi.sh/latest/build/ros/ and https://pixi.sh/latest/build/cpp/.

This gives users the ability to build and run PlotJuggler using a couple of different configurations, with just a pixi installation, no cmake or ROS needed. There are still some drawbacks, like the ROS plugins not being available for noetic on anything but linux-64, and for jazzy just missing on windows. As well as the project rebuilding too often, and needing a kind of weird configruration of multiple pixi.toml's for the different package configurations.

  PlotJuggler/
  ├── pixi.toml                    # Main workspace (defines 3 environments)
  │                                # - jazzy (default, ROS2)
  │                                # - noetic (ROS1, linux-64 only)
  │                                # - non-ros
  │
  ├── pixi_jazzy/
  │   └── pixi.toml                # ROS2 Jazzy build config
  │                                # Uses: pixi-build-ros backend
  │
  ├── pixi_noetic/
  │   └── pixi.toml                # ROS1 Noetic build config
  │                                # Uses: pixi-build-ros backend
  │
  └── pixi_non_ros/
      └── pixi.toml                # Standalone build config
                                   # Uses: pixi-build-cmake backend
                                   # Declares all deps: Qt, Lua, fmt, lz4, zstd, etc.

Note the ros backends use the package.xml for reading dependency information, while the cmake version has the dependencies specified.

However, I do feel its a promising start, so that's why I'm opening the PR in draft so you can take a quick look. To test it out you need a pixi installation: https://pixi.sh/latest/installation/

Some things I needed to do to get things compiling, I've mainly tested on macOS arm.

Main CMakeLists.txt

  • New options: PREFER_DYNAMIC_ZSTD and PREFER_DYNAMIC_LZ4 to control library linking preference
  • Fixed linking: Added Qt5::Xml to plotjuggler_base target (was missing)

LZ4 detection (cmake/find_or_download_lz4.cmake) & ZSTD detection (cmake/find_or_download_zstd.cmake)

  • Respects PREFER_DYNAMIC_LZ4 flag, needed this otherwise it would use the static library from my system.
  • Update target detection: Checks for existing LZ4 targets from system packages or toolchains (multiple naming conventions: LZ4::lz4, lz4::lz4, lz4, etc.)
  • Fallback with preference: If both shared and static exist, chooses based on PREFER_DYNAMIC_LZ4
  • ParserProtobuf:
    • Added missing absl_log_internal_message library for macOS

Pixi

To run with pixi there is basically a pixi run start task for the different environments and that should build and install it correctly into an isolated environment. Take a look at the pixi.toml to kind of get the gist.

Future work

  • There is a lua code-signing on OSX issue that needs a new pixi release (we've fixed this in main)
  • Need to test the ROS configurations on windows and linux better. And at least get a jazzy/rolling version of the ROS plotjuggler plugins on Windows.
  • I could set-up CI for this, but first wanted to see if this change is interesting at all.
  • We have a development feature that makes developing with the environment in the IDE easier: Development dependencies from Pixi packages. [dev] prefix-dev/pixi#4721. This will make this whole thing infinitely more useful I think.

Anyways, sorry for the long description, and would be great to hear your thoughts.

@tdejager tdejager changed the title feat: using pixi Introduce pixi for dependency management and build orchestration Oct 24, 2025
#ifndef ROS_PARSER_H
#define ROS_PARSER_H

#include <cstdlib>
Copy link
Author

Choose a reason for hiding this comment

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

Needed this because otherwise (somtimes), malloc and free could not be found in the fmt include.


[package.build.config]
# Prefer dynamic linking for zstd and lz4 to use conda-provided libraries
extra-args = ["-DPREFER_DYNAMIC_ZSTD=ON", "-DPREFER_DYNAMIC_LZ4=ON"]
Copy link
Author

Choose a reason for hiding this comment

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

Without this it would use the system static libraries instead.

@tdejager
Copy link
Author

tdejager commented Nov 3, 2025

Noticed some annoying things, with this still upstreaming some work to pixi to fix this :)

@facontidavide
Copy link
Owner

any progress? Looking forward to see this in action

@tdejager
Copy link
Author

Next release should fix some of the caching issues on pixi side of things, and then I'll ping you for a test drive :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants