---
name: "rosbuilder"
section: "1"
platform: "linux"
package: "dh-ros"
version: "0.14.2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rosbuilder"
---

# rosbuilder(1)

execute appropriate build commands for ROS packages

## NAME

rosbuilder - execute appropriate build commands for ROS packages

## SYNOPSIS

**rosbuilder** \[***options***\]

## DESCRIPTION

**rosbuilder** is invoked internally by the **ros** buildsystem. You can use this in your *debian/rules* with **dh** **--buildsystem=ros**.

## OPTIONS

- **-h**, **--help**

  show this help message and exit

- **--sourcedir** ***DIR***

  root directory of the source package

- **--search-depth** ***N***

  limit maximum depth to *N* directory levels when searching for packages recursively (default: 2)

- **--unlimited-search-depth**

  do not limit maximum depth when searching for packages

- **--builddir** ***DIR***

  build directory

- **--destdir** ***DIR***

  install staging directory (default: **debian/tmp**)

- **--install-prefix** ***DIR***

  install prefix (default: **/usr**)

- **--verbose**

  make verbose output

- **--detect**

  detect if ROS packages are to be built

- **--build-types**

  list detected build types

- **--build-order**

  list packages in build order

## ENVIRONMENT

The **rosbuilder** behavior can be customized by setting various environment variables in *debian/rules*.

Remember to prefix the declarations with the **export** keyword, or the variables will not propagate to the environment properly.

### General behavior

- **ROS\_DESTDIR**

  override the location for the staged installation

- **ROS\_INSTALL\_PREFIX**

  override the install prefix

- **ROS\_IGNORE\_TEST\_RESULTS**

  do not fail the build if the **dh\_auto\_test** step fails for the listed packages. If set to the special value **1**, test failures for all packages will be ignored.

- **ROS\_PYTHON\_VERSION**

  set to **2** or **3** to force the respective Python version for the build

- **ROS\_SKIP\_PACKAGES**

  do not build the listed packages at all

- **ROS\_SKIP\_TESTS**

  skip tests for the listed packages. If set to the special value **1**, all package tests will be skipped. This is equivalent to passing **nocheck** via **DEB\_BUILD\_OPTIONS**.

### Customizing dh\_auto\_\*

For the **clean**, **configure**, **build**, **test**, and **install** steps, there are hooks to run additional commands before and after each step. Also, either additional arguments can be passed to the **dh\_auto\_\*** helpers or the whole step can be replaced by a different command.

- **ROS\_***step***\_ARGS**

  pass additional arguments to a dh step. The placeholder *step* stands for one of CONFIGURE, BUILD, TEST, INSTALL, or CLEAN, all in upper-case.

- **ROS\_***step***\_***type***\_ARGS**

  pass additional arguments to a dh step, but only for packages with a particular build type. Known build types are AMENT\_CMAKE, AMENT\_PYTHON, CATKIN, and CMAKE.

- **ROS\_***step***\_WRAPPER**

  wrap a dh step with another command, i.e., prepend the command line with the given command and its arguments. The wrapper command is expected to execute the remainder of its arguments. An example for a wrapper is **xvfb-run**, which can be used to run tests in a virtual X server.

- **ROS\_***step***\_***type***\_WRAPPER**

  wrap a dh step with another command, but only for a particular build type.

- **ROS\_EXECUTE\_BEFORE\_***step*

  execute additional commands before a dh step. The value is subject to some variable expansion (see below) and treated as shell command line.

- **ROS\_EXECUTE\_AFTER\_***step*

  execute additional commands before a dh step

- **ROS\_EXECUTE\_BEFORE\_***step***\_***type*

  execute additional commands before a dh step for packages of build type *type*.

- **ROS\_EXECUTE\_AFTER\_***step***\_***type*

  execute additional commands after a dh step for packages of build type *type*.

- **ROS\_EXECUTE\_CUSTOM\_***step*

  replace the dh step by a custom shell command line. This will replace the entire command line, so any **COMMAND\_PREFIX** will be ignored as well.

- **ROS\_EXECUTE\_CUSTOM\_***step***\_***type*

  replace the dh step for packages of build type *type* by a custom shell command line. This will replace the entire command line, so any **WRAPPER** will be ignored as well.

### Variable expansions for shell command lines

**rosbuilder** supports a few placeholders in custom command lines. All values will be quoted as required to prevent spurious shell expansions.

- **{dir}**

  the source directory of the currently processed ROS package

- **{build\_dir}**

  the temporary build directory of the currently processed ROS package

- **{destdir}**

  the location for the staged installation

- **{homedir}**

  the temporary directory that is used for **ROS\_HOME** during building and testing

- **{package}**

  the name of the currently processed ROS package

- **{package!id}**

  the sanitized package name, suitable for use as variable identifier

- **{version}**

  the version number of the currently procssed ROS package

- **{build\_type}**

  the build type of the currently processed ROS package

- **{prefix}**

  the install prefix

## AUTHOR

The **dh-ros** helper and **rosbuilder** was written by Timo Röhling ⟨roehling@debian.org⟩ for Debian.

## SEE ALSO

[**debhelper**(7)](/debhelper/7.md)
