← Otto Developer GuideVersioning & Releases
Otto ships as one thing: the compositor plus the components around it
(otto-kit, otto-bar, otto-files, the portal, …). They are versioned
together: a component’s version is the Otto release it belongs to, not an
independent number.
One number, one place
The version lives in [workspace.package] in the root Cargo.toml:
[workspace.package]
version = "1.4.0"
Every workspace member inherits it:
[package]
name = "otto-kit"
version.workspace = true
So env!("CARGO_PKG_VERSION") reports the same string from any crate — the
compositor’s otto --version, a component’s log banner, a D-Bus property.
authors, edition, license and repository are inherited the same way;
add new members with those four plus version.workspace = true and they join
the scheme automatically.
The sample-clients/ crates are throwaway protocol test clients and stay
outside this; they are never shipped.
Bumping
scripts/set-version.sh 1.4.1 # edit the version
scripts/set-version.sh 1.4.1 --tag # …and commit + tag v1.4.1
The script validates that the argument is semver, then rewrites three places
and refreshes Cargo.lock. Run with no argument to print the current version.
[workspace.package].versionin the rootCargo.toml, the one number every crate inherits.[package.metadata.generate-rpm].version, with-replaced by~: RPM forbids a hyphen inVersion, and1.0.0~rc.2sorts below1.0.0where1.0.0-rc.2would not.- PKGBUILD, the binary package:
_ver(Cargo’s version, which names the release tarball),_tag(v$version) andpkgver(the version with hyphens dropped, sincepkgvermay not contain one). Itssha256sumsstaysSKIPin the repository:scripts/packaging/make-arch-tarball.shwrites a copy pinned to the tarball it builds, and the release publishes that copy.
Two more files follow on their own:
- PKGBUILD-git derives
pkgverfromgit describe, so the tag is what moves it —1.0.0-rc.1plus 3 commits becomes1.0.0rc.1.r3.g51822a84. - CHANGELOG.md is generated by git-cliff from the commit log between tags.
Cargo.lock is tracked (.gitignore re-includes it with !/Cargo.lock) and
carries every crate’s version, so the refreshed lockfile belongs in the bump
commit. --tag stages only Cargo.toml and PKGBUILD, so amend the lockfile
in before pushing.
Release checklist
scripts/set-version.sh <version> --taggit cliff --tag v<version> -o CHANGELOG.mdand commit the changeloggit push --follow-tags
Which number to pick follows semver: fix: commits since
the last tag → patch, feat: → minor, a !/BREAKING CHANGE commit → major.
Pre-releases use a dotted suffix (1.0.0-rc.2). The packaging files spell that
differently on purpose (pacman drops the hyphen, RPM turns it into ~), so
1.0.0rc.2 and 1.0.0~rc.2 are both correct.