Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Development and release

The development environment is defined by pixi.toml and pixi.lock. All commands below run from the repository root through pixi run.

Everyday tasks

TaskPurpose
fmt / fmt-fixCheck or apply rustfmt to the workspace, fuzz crate and standalone ROS 2 example.
clippyLint every workspace target and the ROS 2 codec example with -D warnings.
test / testsRun the full Rust workspace test suite.
buildBuild all workspace crates.
docsBuild the book, API references and site, run doctests and check local links.
schema-checkValidate schema sets and print the message-ID table.
schema-buildGenerate a Rust wrapper module from schema sets without a build.rs.
rust-targetsInstall the pinned embedded std targets into the pixi Rust sysroot.
examplesBuild and run all deterministic example self-tests, including the ROS 2 codec.
examples-ros2-buildBuild the r2r nodes; requires a sourced ROS 2 installation.
checkEvery local check, including docs and examples.
cicheck plus the 60-second fuzz stage.
wheelsClean dist/, build the sdist and the x86_64/aarch64 manylinux wheels.
c-release-archiveBuild the C header/static/shared-library release tarball.
release-checkVerify the exact tag, workspace version, changelog and artefacts.
publish-dry-runPackage all publishable crates and verify the wheel and sdist.

Specialised tasks cover golden vectors, the Python reference model, C ABI, Python bindings, embedded cross-builds, QEMU determinism and fuzzing. The Testing chapter lists them in the order used by CI.

CI requirements

GitHub Actions uses prefix-dev/setup-pixi with the committed pixi.lock, so the pinned Rust toolchain, rustfmt, clippy, C++ compiler, Python, maturin and documentation tools are installed automatically. The rust-targets task downloads the matching Rust 1.100.0 standard libraries for thumbv7em-none-eabi, thumbv7em-none-eabihf and aarch64-unknown-linux-gnu into the pixi sysroot. qemu-system-arm is installed in the workflow before the QEMU task. The README build badge links to the GitHub Actions CI workflow.

Documentation build

pixi run docs performs these steps:

  1. docs-doctests compiles and runs public Rust examples.
  2. docs-book builds the mdBook into docs/book/book/.
  3. docs-rust runs rustdoc with warnings denied into target/doc/.
  4. docs-python uses pdoc on the installed extension into docs/site/api/python/.
  5. docs-c runs Doxygen over the generated C header into docs/site/api/c/html/ and fails if the generated pages omit public C symbols.
  6. docs-site copies the book and rustdoc output into docs/site/ and writes the landing page.
  7. docs-links runs lychee --offline --include-fragments over the sources and generated site.

All generated documentation is gitignored. Link checking is local: a docs build never requires network access. External URL checks are deferred to a stage on the 12-hour timer.

On every v* tag push, the documentation workflow runs pixi run docs and publishes the generated docs/site/ to https://predsync.tgodfrey.com/ with GitHub Pages, so the live site matches the released version. The github-pages environment must allow v* tag deployments; configure that in the repository’s environment protection rules. Cloudflare redirects the exact root path to https://predsync.tgodfrey.com/book/index.html with a 301. The generated root page also carries a client-side redirect and direct links to the Rust API, the Python API and the C API as a fallback. The canonical documentation URL remains the book.

The Cloudflare rule is configured outside the generated site. With CLOUDFLARE_API_TOKEN (Zone > Single Redirect > Edit) and CLOUDFLARE_ZONE_ID set, run pixi run docs-cloudflare-redirect to create or update it. The rule matches http.host eq "predsync.tgodfrey.com" and http.request.uri.path eq "/", then redirects to https://predsync.tgodfrey.com/book/index.html with status 301 and query strings not preserved. Matching only / avoids a loop with the book and API paths. The equivalent dashboard rule is a Redirect Rule with the same expression and target.

Release metadata

The root README.md, LICENSE and CHANGELOG.md are the public release front door. The crates.io set is predsync-schema, predsync-core, predsync-compiler and the predsync facade. Those four crates pin each other with exact versions so a facade release cannot resolve against an incompatible compiler or core. predsync-ffi, predsync-py, the test crates and the example crates are publish = false.

The Python distribution is also called predsync. Its version is dynamic and comes from [workspace.package] version; Cargo’s 0.1.0-rc.1 becomes PyPI’s 0.1.0rc1. Each publishable crate carries a copy of LICENSE so the licence text appears in the crate archive and on crates.io.

Local version bumps

Install the release helper once:

cargo install cargo-release --locked

release.toml makes cargo-release update versions and the changelog, create one commit and one vX.Y.Z tag, and push them. It never publishes to a registry. The current development version is lower than the first release candidate, so the first tag is explicit:

cargo release 0.1.0-rc.1 -x --no-publish

After the release candidate has been smoke-tested, promote it with:

cargo release release -x --no-publish

cargo release rc is deliberately not used: from 0.1.0-alpha.1 it would produce 0.1.1-rc.1, not 0.1.0-rc.1. The facade crate owns the single workspace tag and the CHANGELOG.md replacement, so a workspace release has one tag rather than one tag per crate.

Publishing dry runs

pixi run publish-dry-run

The dry-run tool:

  • lists each publishable Cargo crate with cargo package --list and requires Cargo.toml, README.md and LICENSE;
  • runs cargo publish --workspace --dry-run;
  • builds a Python wheel and sdist into a temporary directory;
  • installs the sdist in a clean virtualenv from a directory containing no repository checkout, proving the path-dependent workspace crates are in it;
  • never uploads anything.

The scheduled GitHub Actions workflow runs publish-dry-run every 12 hours. Tag builds run the same checks in release-verify before any upload.

Tag-driven release

The release workflow is .github/workflows/release.yml. It runs only on v* tag pushes, so ordinary branch and pull-request builds can never publish.

The workflow performs:

  1. verify — release-check requires an exact tag at HEAD, a clean tree, TAG_NAME == v$(workspace version) and a matching changelog heading. It then runs ci and publish-dry-run.
  2. build-wheels — builds the sdist plus the x86_64 and aarch64 manylinux2014 wheels in clean containers.
  3. build-c-archive — builds the C header, static library and shared library tarball.
  4. publish — waits at the protected GitHub release environment for manual approval. Credentials are bound only inside this job. publish_crates.py checks crates.io for each crate/version, waits for dependencies to become indexed, skips versions already published and publishes the rest in dependency order. publish_pypi.py uploads only the expected wheels and sdist with maturin upload --skip-existing.

Configure the repository before the first release:

  • add repository secrets CARGO_REGISTRY_TOKEN and MATURIN_PYPI_TOKEN;
  • create a GitHub Environment named release;
  • add required reviewers to that environment;
  • optionally protect v* tags.

The first upload needs temporary broad tokens because project-scoped tokens cannot be created before the crate or project exists. Rotate to scoped tokens after the release candidate is live. Duplicate crate versions fail loudly; PyPI uploads can be retried safely.

Scheduled maintenance

.github/workflows/scheduled.yml runs the 30-minute fuzz acceptance stage, the full differential trace set and the publishing dry run every 12 hours.

C release archive and documentation

Every tag build archives predsync.h, the static library, the shared library, the README and the licence as predsync-c-X.Y.Z.tar.gz. The GitHub Actions documentation workflow publishes on v* tags only, so the book and API pages match the released version. The docs task fails if Doxygen output omits public C symbols.

Before tagging a release

  1. Run pixi run ci and confirm the 60-second fuzz stage is clean.
  2. Run the timer-only stages if the change affects the wire format or predictors.
  3. Run pixi run docs and inspect docs/site/index.html.
  4. Confirm CHANGELOG.md names every user-visible change under Unreleased.
  5. Confirm generated files are current: pixi run c-header-check.
  6. Run pixi run publish-dry-run and pixi run wheels.
  7. Create the tag with cargo release, push it, and wait for the GitHub Actions release environment approval gate. Smoke-test the release candidate wheels before approving the final 0.1.0 release.