Skip to content

Place doxygen (and its expanded graphviz) in build instead of host - #204

Open
gordon-n-stevenson wants to merge 1 commit into
RoboStack:masterfrom
gordon-n-stevenson:doxygen-build-requirement
Open

gordon-n-stevenson wants to merge 1 commit into
RoboStack:masterfrom
gordon-n-stevenson:doxygen-build-requirement

Conversation

@gordon-n-stevenson

Copy link
Copy Markdown

Summary

Route doxygen build/buildtool dependencies (and any companion packages it expands to via robostack.yaml, notably graphviz) into requirements.build instead of requirements.host, unconditionally for both native and cross builds.

Motivation

In RoboStack/robostack, shared/robostack.yaml maps:

doxygen:
  robostack: [doxygen, graphviz]

Previously, vinca resolved doxygen into requirements.host and only moved doxygen itself to build when cross-compiling (build_platform != target_platform). On native builds (and for graphviz on all builds), graphviz stayed in requirements.host.

Because conda-forge's graphviz defines run_exports: pin_subpackage('graphviz', max_pin='x') and runs GTK/gdk-pixbuf/glib/icon cache post-link hooks in $PREFIX:

  1. graphviz (along with GTK3, cairo, pango, librsvg, fonts) leaks into requirements.run of every ROS package declaring <build_depend>doxygen</build_depend> or <buildtool_depend>doxygen</buildtool_depend>.
  2. Stale gdk-pixbuf/gtk/glib/icon caches leak into $PREFIX and get packaged into the built .conda archive.

This currently affects 7–9 packages per distro in robostack-{humble,jazzy,lyrical,rolling} (e.g. ros2-rsl, ros2-coal, ros2-eigenpy, ros2-jrl-cmakemodules, ros2-pinocchio, ros2-proxsuite, ros2-visp, ros2-hpp-fcl).

doxygen and dot are purely build-machine CLI tools (already placed in build for cross-compilation); placing them unconditionally in requirements.build avoids both the run_exports leak and $PREFIX cache pollution while keeping direct graphviz dependencies in host/run untouched.

Testing

  • Updated vinca/test_recipes.py (SYSTEM_PACKAGES["doxygen"] = ["doxygen", "graphviz"]) and added tests covering build_depend/buildtool_depend on doxygen and direct build_depend on graphviz.
  • pytest vinca/: 355 passed, 4 skipped.

(Note: pixi-build-ros / vinca-rs has the same native/cross doxygen rule in crates/pixi_build_ros/src/requirements.rs and would benefit from the same change.)

robostack.yaml maps doxygen to [doxygen, graphviz]. Keeping them in
requirements.host on native builds triggers conda-forge graphviz'\''s
run_exports (leaking graphviz/GTK3/cairo/pango into requirements.run)
and runs graphviz'\''s post-link hooks inside $PREFIX (leaking cache
files into built packages).

Route build/buildtool dependencies resolving to doxygen directly to
requirements.build for both native and cross builds, while keeping
direct graphviz dependencies in host/run unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@traversaro

Copy link
Copy Markdown
Member

Wouldn't it better ro change build_depend and buildtool_depend to go in build instead of host, instead of having custom per-package logic?

@traversaro

Copy link
Copy Markdown
Member

Or actually, I did a quick check and it seems that build_depend is tipically used for header only deps so it should go in host, while indeed buildtool_depend seems to contain tipically actuall build toll dependencies.

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.

2 participants