Repository navigation
feat(pixi-build-ros): RoboStack's build scripts, requirement rules and package names - #7535
Closed
Tobias-Fischer wants to merge 9 commits into
Closed
Tobias-Fischer wants to merge 9 commits into
Tobias-Fischer wants to merge 9 commits into
Conversation
…ne lookup shared with RoboStack Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tic baseline Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replacing each identifier's text in the expression also hit it inside a longer identifier: "LGPL-2.0 OR GPL-2.0" became "LGPL-2.0-only-only OR GPL-2.0". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nothing `osx:` without a value made the whole mapping file fail to parse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tack does RoboStack's canonical names are now `ros2-<name>` for ROS 2 and `ros-<name>` for ROS 1 (`ros-<distro>-<name>` are only compatibility aliases). The backend now uses them for the package it builds, for unmapped and `ros:`-mapped dependencies, and for workspace siblings (`Distro::conda_name`). The names no longer say which distribution a package belongs to, so the distro mutex in host and run is pinned to it: `ros2-distro-mutex * <distro>_*` (`Distro::mutex_spec`; RoboStack builds the mutex with the build string `<distro>_<build number>`). Merging that with a mutex the user declares (e.g. `0.5.*`) needs merged specs to keep a build string: `merge_specs` now merges the versions and keeps the build string of either side (conflicting build strings are an error). Snapshot changes: - the jazzy inline snapshots (generate_recipe, condition_evaluation_*) name everything `ros2-<name>` instead of `ros-jazzy-<name>`, and the mutex is `ros2-distro-mutex * jazzy_*` - every `ros-noetic-<name>` in the noetic fixtures is now `ros-<name>`, the package name `ros-noetic-custom-ros` is `ros-custom-ros` - in the noetic .snap files `ros-distro-mutex` is `ros-distro-mutex * noetic_*` in host and run, and in generate_recipe_with_mutex_version the user's `0.5.*` merges into `ros-distro-mutex 0.5.* noetic_*` - insta no longer writes `assertion_line` into the rewritten .snap files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The backend's templates were an old copy of RoboStack's, which have since been fixed while building every package of RoboStack's distributions on five platforms. Adopt those (they live here now, and RoboStack's recipe generator renders them through this crate): among others the cross-compilation fixups, the real `ROS_PYTHON_VERSION` (the old script exported `PY_VER=3`), conda's macOS deployment target instead of a hardcoded 11.0, a `PYTHON_INSTALL_DIR` that works without GNU realpath, the Visual Studio generator and short object paths on Windows, and the ROS 2 `cmake` template (ROS 2 cmake/catkin packages used the ROS 1 catkin template). What differs between `pixi build` and a RoboStack recipe is a parameter: - `ScriptVars::source_dir`: the manifest directory here, the checked-out source in a recipe (the templates no longer set `SRC_DIR`) - `BuildMode::Incremental` keeps the build directory (the configure step is incremental too, so the `build.ninja` guard is gone) and lists what the build installed in `$RATTLER_BUILD_PACKAGE_FILES`, as before; `BuildMode::Clean` is RoboStack's fresh build The catkin templates stay for ROS 1, with `@(package_prefix)-` instead of the hardcoded `ros-noetic-` names. `BuildType::of` decides the template (no build type plus an ament_cmake build tool is ament_cmake; catkin/cmake is the cmake template in ROS 2 and the catkin one in ROS 1), and `ACTIVATION_SCRIPTS` are ros_workspace's environment activation scripts. New snapshots: the eight scripts `pixi build` runs (the incremental mode of every template, for Unix and Windows). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`requirements::Rules` holds RoboStack's requirement rules, which this backend
and RoboStack's recipe generator now share:
- `Rules::requirements`: what every package builds with (compilers, the C
stdlib, cython, the build tools, pkg-config/python/numpy and cross-python only
when cross-compiling, clang-tools on macOS), Python in host and run, the
pinned distro mutex, ros_environment/ros_workspace (except for the packages
they are built from), and the package.xml dependencies: ROS and system
dependencies in host (a format 1 `run_depend` too), build tools in host except
git, which goes to build; run dependencies in run. How a dependency becomes
conda specs is the caller's: here the package map, keeping package.xml's
versions
- `Rules::finish`: build-time-only Python for a package without Python
(RoboStack's opt-in conditional Python; off here), the cross-compiling and
Emscripten rules (cmake, mimick_vendor, rosidl generators, pybind11, qt-main,
build-machine tools native/cross), host and run sorted
- `Reqs`/`Req`: the requirement lists, with `if: build_platform != ...`
entries; `package_xml_to_conda_requirements` turns them into the recipe's
Behaviour changes for `pixi build`: ROS and system dependencies are no longer
also in `build` (they are host dependencies; this is what makes cross-compiling
work), `stdlib('c')` is added when the variants have `c_stdlib`, `cpython` was
a typo for `cython`, setuptools only for ament_python, pkg-config/python/numpy
in build only when cross-compiling, and ros_workspace is a run dependency.
Snapshot changes, all from the above:
- build: only the base requirements (compilers first, `cython` instead of
`cpython`, the cross-only pkg-config/python/numpy); no package.xml dependencies
- host: sorted; python/numpy/pip, `pkg-config` only when native, no
setuptools, ros2-ros-environment for ROS 2
- run: sorted; python, and ros2-ros-workspace for ROS 2
- the package_xml_to_recipe_config tests and the condition-evaluation and
workspace-discovery tests look at host instead of build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uild scripts name their generator - robostack-noetic only publishes ros-noetic-* (no ros-*): ROS 1 packages and their unmapped dependencies stay ros-<distro>-<name>, so that `pixi build` of a noetic workspace resolves. ROS 2 keeps ros2-<name>. - The build scripts' first line names what wrote them (ScriptVars::generator): pixi-build-ros for `pixi build`, vinca-rs for RoboStack's recipes. Snapshots: the noetic names (ros-noetic-*), and the scripts' first line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 13, 2026
Contributor
Author
|
Split into three drafts for easier review, as offered in the description: #7539 (names), #7540 (build scripts) and #7541 (requirement rules), stacked in that order. Two cuts along the way:
The ROS 1 naming fix from the last commit here is folded into #7539. Closing this one in their favour. — Claude (on behalf of @Tobias-Fischer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stacked on #7533 and #7534; the four commits from 34a65ac onwards are this PR. Follow-up to #7526.
pixi-build-ros and RoboStack's recipe generator (vinca-rs) each had their own build scripts and rules for turning a package.xml into conda requirements, and they had drifted apart. As a result,
pixi buildbuilt a ROS package differently from RoboStack's binaries. This PR makes pixi-build-ros the single place for both. RoboStack generates its ~2,500 recipes per distribution with these functions, and gets byte-identical recipes for all four distributions and five platforms.What changes for
pixi buildusersNames: ROS 2 packages are
ros2-<name>, as RoboStack publishes them (ros-<distro>-*remain as compatibility packages). The distribution comes from the mutex, which is now pinned:ros2-distro-mutex * <distro>_*. ROS 1 keepsros-<distro>-<name>, because robostack-noetic only has those names.Build scripts: RoboStack's. The ones here were behind:
PY_VER=3, overriding rattler-build's;ROS_PYTHON_VERSION=3and macOS 11.0 instead of conda-forge's deployment target;pixi buildkeeps its incremental mode: the build directory is kept and installed files are recorded in$RATTLER_BUILD_PACKAGE_FILES. CMake now reconfigures on every build, which is fast on a kept directory. ROS 2cmakepackages get the cmake script; ROS 1 keeps the catkin scripts.Requirements:
hostonly, no longer also tobuild, which is right for cross-compiling.buildholds compilers, cmake, ninja,cython(it saidcpython), and the cross-compilation tools when cross-compiling.ros_workspaceandros_environmentare handled as in RoboStack.Library API for RoboStack's generator:
distro:package_prefix,conda_name,mutex_spec;build_script:BuildType,BuildMode,ScriptVars,render_build_script;requirements:Rules,Reqs,python_needed.Not changed here: the docs' example ROS workspace still uses
ros-jazzy-*names in itspixi.toml/pixi.lock. It needs a released backend to re-lock, so it should follow in a separate PR.AI-generated details (Claude Opus 5.5)
build= base list;host/runsorted, with ros_environment, ros_workspace and python).cargo test -p pixi-build-ros(79 + 23),cargo clippy -p pixi-build-ros --all-targets -- -D warnings,pixi run typos,dprint check,check-into-diagnostic.pixi build: special cases for three WebAssembly packages' source folders, and opt-inVINCA_*environment variables. The build scripts' first line names whichever tool wrote them.Checklist:
🤖 Generated with Claude Code