Debian Versioning in Nightly and Prerelease Binaries
Main convention is described in Debian Policy Manual, section 5.6.12.2. Special version conventions
In Debian, binary packages for nightly and prerelease builds follow specific versioning schemes to manage the precedence between stable, prerelease, and nightly versions. This ensures that packages can be organized and prioritized effectively when multiple repositories are in use.
Prerelease Versioning
Prerelease packages are created as candidates for an upcoming stable release (e.g., X.Y.Z). The stable version must always take precedence over prereleases when both are available. The versioning scheme for prereleases is as follows:
{upcoming_version}~pre{prerelease_version}
upcoming_version: The upstream version targeted for the release (e.g., X.Y.Z).
prerelease_version: The specific version of the prerelease in the series.
For example, if preparing for version 1.0.1, the prerelease would be versioned as 1.0.1~pre1-1, 1.0.1~pre2-1, etc.
Nightly Versioning
Nightly builds are snapshots of development code and include features or patches that will be incorporated into future releases. Nightlies typically take precedence over stable releases except when generated before a new stable release.
Nightly versioning follows this scheme:
{upcoming_version}~git{date}.{hash}-{revision}
upcoming_version: The upcoming release version
date: Timestamp in YYYYMMDD format.
hash: 7 characters of git commit hash used for the build (informational purpose).
revision: An internal revision number for that nightly build.
For example, a nightly version might look like 0.99.99+git20150101r2212b5136299-1.
Or look like 5.2.2+20241130+dfsg-1 when the upstream version distributed by the vendor is a snapshot named 5.2.2-dev build on the 30/11/2024. The +dfsg part is for packages that remove some copyright upstream data.
The date part is important as it will be used to compare versions in an incremental way.
Stable takes precedence, followed by prereleases, then nightlies. Example order:
- 1.0.0-1
- 1.0.0~pre2-1
- 1.0.0~git20150101.67bcdb-1
- 0.9.9-1
- 0.9.9~git20150101.67baaa-1