Skip to main content

Spadix, a friendly wrapper for colcon

Copyright 2021-2024 SafeAI

Copyright 2025 Pronto.AI

Why?

Our company uses colcon (from collective construction build manager) as our main build management tool for many years.

While we like this package, it has its problem areas, in our opinion, especially when used by unexperienced engineers.

  • Default build is not a merged one, and this disables Doxygen build
  • It is allowed to run from any directory in the project tree, making the tree contaminated with build artifacts
  • By default console output is switched off and switching it back on requires an additional parameter
  • It requires few additional parameters to run gtest alone

We decided to fix these deficiencies and created a wrapper spadix around colcon. Catkin, ament, colcon, spadix... Got it?

How

spadix accepts all colcon commands and options plus it adds and modifies few commands on its own.

For build, rebuild, and test (including package-selection variants), spadix uses a merged install by default on all platforms, including Linux, macOS, and Windows. It reads .colcon_install_layout in the directory selected by --install-base (install by default). It adds --merge-install when that file is missing, contains invalid UTF-8, or contains an unrecognized layout. A merged or isolated value in that file is respected: merged adds --merge-install, while isolated omits it.

rebuild reads the layout before cleaning, so it preserves an existing workspace's layout unless --no-merge is set. If cleanup fails, rebuild returns the cleanup exit status without starting the build. To switch an isolated workspace to the merged default, run spadix clean followed by spadix build. Use the same custom base directories for both commands when applicable.

Run commands that share build, install, or log directories sequentially, including direct colcon commands. Spadix does not coordinate concurrent access to these directories.

To create an isolated install in a fresh workspace, run spadix build --no-merge or spadix --no-merge build. The option works before or after the command and disables automatic --merge-install insertion, even when the layout marker says merged. To switch an existing merged workspace to isolated, run spadix --no-merge rebuild; this full rebuild removes the install directory first. Changing layout with build or a package-specific rebuild requires a full spadix clean first. Build the isolated install before running spadix --no-merge test.

Cleanup uses the final values of --build-base, --install-base, and --log-base. --build-base and --install-base must follow the spadix command; placing them before it is rejected. All three options accept --option path and --option=path forms. Missing, empty, or dash-prefixed paths are rejected; prefix directory names beginning with - with ./. For example, spadix rebuild --install-base custom cleans and rebuilds the custom install directory. --log-base can appear before or after the spadix command. For commands forwarded to colcon, including build, rebuild, and test, spadix puts it before the colcon verb. It also selects the log directory removed by a full clean or rebuild, but has no effect on uncrustify or gtest. For example, spadix rebuild --log-base=custom-log --install-base custom uses custom-log for both cleanup and colcon logging. On Windows, cleanup treats directory names literally, including shell metacharacters, and ignores directories that are already absent.

Use one spadix command per invocation; spadix rebuild cleans and builds in one invocation. After build, rebuild, or test (including package-selection variants), bare build and test tokens are forwarded as colcon arguments. For example, spadix build --packages-select test and spadix test --pytest-args -k test are accepted. Other recognized command tokens, including package-selection forms such as test:pkg, are rejected before any command runs. After clean, uncrustify, or gtest, every additional recognized command token is rejected.

The .spadixrc file in the current directory supplies arguments, one per nonempty line, before the command-line arguments. Use one command across both sources. If .spadixrc already supplies the command, omit it from the command line.

The wrapper options --no-merge, --no-console, --no-root-check, --dry-run, --ninja, and --non-ninja can still be supplied at the start of the command line when .spadixrc provides the command. Except for --no-merge, put them before any command options, or before the command when supplying it explicitly. A command-line --ninja or --non-ninja choice overrides the choice in .spadixrc. Other arguments, including log-base options, retain their original order. For example, with a .spadixrc containing only build, run spadix --no-merge to create an isolated install in a fresh workspace.

Usage:

spadix [Global options] [command] [command options] ...

[Global options]
--no-console  : Do not use the default console mode: `--event-handlers console_cohesion+`
--no-merge  : Do not automatically add `--merge-install`; use before or after the command
--no-root-check  : Do not check that spadix being started from the root of a git project
--ninja  : Explicitly enable Ninja during the build (overrides platform defaults or `--non-ninja`). Ignored if it is not a build
--non-ninja  : Explicitly disable Ninja during the build, even on platforms where Ninja is the default. Ignored if it is not a build

Commands:
clean  :Clean all packages (`rm -rf log install build`)
clean:<package1>[,<package2>...]  :Clean selected, comma separated packages. Spaces not supported

build  :Build all packages
build:<package list>  Build selected, comma separated packages. Spaces not supported
    Build options:
        --release   : RelWithDebInfo (default in Linux)
        --debug   : Debug build (default in windows)
        --no-fif    : disable Failure Injection Framework (FIF enabled by default)

Package list: comma separated list of packages like package1,package2,...
The package list can contain sublists separated by
package selection prefixes `.eq.`, `.le.`, and `.ge.`

rebuild  :Re-build all packages: clean all, then build all.
rebuild:<simple package list>  Re-build selected packages: clean packages, then build them.
Simple package list: comma separated list of packages like package1,package2,...
Simple package list cannot have selection prefixes.

uncrustify  :Uncrustify all packages
uncrustify:<simple package list>  Uncrustify selected packages.

test  :Test all packages
test[:[<package list>][:test]]  :Test selected, comma separated packages,
possibly running `test1` only

Package list: comma separated list of packages like package1,package2,...
The package list can contain sublists separated by
package selection prefixes `.eq.`, `.le.`, and `.ge.`

gtest:<package> [gtest parameters]  :Run gtest only ('<build base>/test_<package name>')

File `.spadixrc` in the current folder contains commands (one per line) that will be added to the
actual command line.

Metadata

Release files for spadix-cli 0.7.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spadix-cli 0.7.9
File Size Uploaded Provenance Actions
spadix_cli-0.7.9.tar.gz 27.2 kB Without provenance Details for spadix_cli-0.7.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spadix-cli 0.7.9
File Interpreter ABI Platform Actions
spadix_cli-0.7.9-py3-none-any.whl Python 3 none any Details for spadix_cli-0.7.9-py3-none-any.whl

Total release size: 41.1 kB

Release files / spadix_cli-0.7.9.tar.gz

Download URL spadix_cli-0.7.9.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
11a22a5674969abe02d2b80c869d6a35e24f80ab9ef1ae06d9dede796eb17e0d
BLAKE2b-256 checksum
How to use checksums
8369835535f6486666ca24a3c0ce9c207ac9aa5f252a3e03b8ef08fff281cfab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / spadix_cli-0.7.9-py3-none-any.whl

Download URL spadix_cli-0.7.9-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1df31185c8d0eaf27312e58b193628a50a8001226d20ba9736d429e33b1d5ab3
BLAKE2b-256 checksum
How to use checksums
f7d63f7f39baa8b0d24ed57a29866fd5d7b72591b9ff9d199c4849ccef444e83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for spadix-cli 0.7.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page