Skip to content

Auto-mark sibling ROS packages as source deps in pixi-build-ros #5946

Closed

Description

@baszalmstra

Problem

When a ROS package built by pixi-build-ros depends on a sibling package in the same workspace, the build currently fails at host-environment resolution.

Concretely: pixi-build-ros reads package.xml, maps each depend / build_depend / exec_depend through RoboStack to a conda name like ros-jazzy-foo, and emits it as a host/build/run dependency in the generated recipe. When Pixi then resolves the host environment to actually build the package, it treats ros-jazzy-foo as a binary dependency and looks it up in the configured channels. If foo is a sibling workspace package that has never been published as a binary, that lookup fails and the build can't even start.

The only way to tell Pixi "this is a source dependency, build it from the sibling directory instead of looking it up as a binary" is to manually write a pixi.toml next to every package's package.xml with explicit path deps per requirement class, e.g.:

[package.host-dependencies]
my-sibling-package = { path = "../my-sibling-package" }

[package.build-dependencies]
my-codegen-sibling = { path = "../my-codegen-sibling" }

[package.run-dependencies]
my-runtime-sibling = { path = "../my-runtime-sibling" }

This has to be kept in sync with package.xml by hand, per-package, across potentially dozens of packages in a real ROS workspace. Miss one and the host env won't resolve. The navigation2 / nav2_ros_common issue is a concrete instance: nav2_ros_common is a sibling, isn't in the distro, isn't in robostack.yaml, so there's no binary to resolve to.

Proposal

pixi-build-ros discovers sibling ROS packages by scanning the workspace root for package.xml files, and for every depend-family entry in the current package that matches the name of a discovered sibling, automatically emits it as a source dependency (path-based) in the appropriate requirement class, instead of mapping it through RoboStack as a binary.

In other words, the backend auto-infers the [package.host-dependencies] / [package.build-dependencies] / [package.run-dependencies] path entries that users would otherwise have to write by hand in each package's pixi.toml.

A package.xml is sufficient on its own: the backend treats every discovered ROS package as buildable by pixi-build-ros, auto-deriving the build type from the package's build_type export. A per-package pixi.toml is optional and only needed when overriding the backend version, adding extra config, or adjusting deps beyond what package.xml expresses. The typical workspace layout becomes a single workspace-root pixi.toml with distro/backend config, and every package.xml under it just works — matching the colcon UX.

Discovery follows colcon conventions:

  • Walk the workspace root looking for package.xml files.
  • Exclude build/, install/, log/.
  • Honor COLCON_IGNORE, AMENT_IGNORE, CATKIN_IGNORE markers.
  • Match on the name element of each discovered package.xml.

Matching is always against the package.xml name element, never against a pixi.toml-declared name — package.xml is the source of truth for ROS identity. The conda name used for the emitted source dep is ros-<distro>-<ros_name>.

Why the backend (not Pixi) does the discovery

package.xml is the real ROS workspace boundary. It's what colcon/ament/catkin already scan. It's independent of whether a package has pixi metadata yet, and the backend already parses it for the current package. Pushing this onto Pixi would mean teaching it ROS-specific conventions it otherwise doesn't care about. The backend asks Pixi for the workspace root, then does the ROS-specific scan itself.

Benefits

  • Fixes the actual host-env resolution failure, not just paperwork.
  • Closes the motivating case of the navigation2 / nav2_ros_common issue without any new config surface.
  • Single source of truth for workspace topology: package.xml.
  • Drops a vanilla colcon workspace into pixi with zero per-package configuration.

Escape hatch

Per-package opt-out via [package.build.config], following the usual ignore-* / default-false convention:

[package.build.config]
ignore-workspace-sources = false  # default

When set to true, the backend skips workspace discovery for this package entirely and falls back to mapping every dep through RoboStack as a binary. Useful for e.g. pinning a package against a stability baseline while iterating on other parts of the workspace.

Related

Activity

  1. changed the title [-]Auto-detect workspace-local ROS packages and inject source deps[/-] [+]Auto-mark sibling ROS packages as source deps in pixi-build-ros[/+] on Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions