Contributing
Many thanks for taking the time to read this and for contributing to RoboStack!
This project is in early stages and we are looking for contributors to help it grow.
The developers are on the robotics
channel on prefix.dev
's discord where we discuss steps forward.
We welcome all kinds of contribution -- code or non-code -- and value them highly. We pledge to treat everyones contribution fairly and with respect and we are here to help awesome pull requests over the finish line.
Please note we have a code of conduct, and follow it in all your interactions with the project.
We follow the NumFOCUS code of conduct.
Adding new packages via pull requests
You can open a pull request that will get build automatically in our CI.
An example can be found here. Simply add the required packages to the vinca_*.yaml
files, where the *
indicates the desired platform (linux_64
, linux_aarch64
(for ARM processors), osx_64
(old Intel Macs), osx_arm64
(Apple Silicon), or win
). Ideally, try to add packages to all of these platforms. The name of the package is accepted both with underscores and dashes as word separators, but it is suggested to type the name of the package exactly as https://index.ros.org knows it.
Creating a new patch file
Sometimes, it may be required to patch the packages. An example of how to do so can be found in this PR. Generating the patch can be done as follows:
- Modify the
vinca_*.yaml
file, but just adding the package you want to create the patch for - Run
pixi run build
. This will either succeded it the package can be built without any patch, or fail if a patch is required to actually build the package. - Start a shell and go inside the repository to be edited. It should be located in
<robostack folder>/output/src_cache/<repo_name>
, where<robostack folder>
is the folder where you runpixi run build
and<repo_name>
is the name of the repository associated to the package in theurl:
attribute of the repo in therosdistro_snapshot.yaml
- Apply the changes that you would like to store into the patch
- Create a patch file with
git diff > changes.patch
- Check that the patch contains the intended changes
- Move the file into the
patches
directory of this repository, renaming it according to the naming convention. If the changes are portable across all supported operating system, the file should be called<package name>.patch
; otherwise,<package name>.<win/linux/osx>.patch
- Rerun
pixi run build
to ensure that the patching succeeds and the package builds without errors - Commit the new file, push to your fork and create a PR
Extending an existing patch file
The procedure to create a new patch file still applies, with a caveat.
The git repository of the package cloned by rattler-build
will be in a dirty state. The changes of the working tree should amount to the patches already existing for the package. Running git diff
will result in a patch which intermingles the new changes to the old ones. This would allow to just swap the new resulting patch file for the old one, but this may make code review difficult if the order of the hunks changes.
To make code review easier, please consider manually porting the new hunks into the existing patch file. This can be made easier by running git reset --hard
before applying the new changes to the source code.
Testing changes locally
Clone the relevant repo:
git clone https://github.com/RoboStack/ros-humble.git # or: git clone https://github.com/RoboStack/ros-noetic.git or git clone https://github.com/RoboStack/ros-jazzy.git
```bash
Then move in the newly cloned repo, and if necessary do any change to the `vinca_*.yaml` file for your platform:
```bash
cd ros-humble # or: cd ros-noetic or cd ros-jazzy
```bash
then you can build the packages that need to be built after the `vinca_***.yaml` changes with:
```bash
pixi run build
How does it work?
- The
vinca_*.yaml
files specify which packages should be built. - Add the desired package under
packages_select_by_deps
. This will automatically pull in all dependencies of that package, too. - Note that all packages that are already build in one of the channels listed under
skip_existing
will be skipped. - The
packages_remove_from_deps
list allows you to never build packages, even if they are listed as dependencies of other packages, by removing them from the dependencies of other packages. We use it for e.g. the stage simulator which is not available in conda-forge, but is listed as one of the dependencies of the ros-simulator metapackage. - If you want to rebuild a package (for example because it had a problem for which you added a patch), set it build number explicitly in the
pkg_additional_info.yaml
file. Note that this will not update the package, unless therosdistro_snapshot.yaml
file is also updated (and that typically happens only for full rebuild) - The
robostack.yaml
andpackages-ignore.yaml
files are the equivalent of the rosdep.yaml and translate ROS dependencies into conda package names (or in the case of the dependencies listed inpackages-ignore.yaml
the dependencies are ignored by specifying an empty list).