Skip to main content

Module build

Module build 

Source
Expand description

The build of riff and riff-server, and the check that they can talk.

§Design

A build is the crate version, the last commit that changed the code (crates, Cargo.toml or Cargo.lock), and the UTC time of that commit. build.rs finds the commit. The image build of riff-server has no repository: it gives RIFF_COMMIT and RIFF_COMMIT_TIME, from deploy/build-id.sh, which runs the same command.

The crate version is a semantic version, and it says what a build can talk to (01M3MX1DYY6AVDW946NR0B9T2C). The line of a version is its major, and its minor while the major is 0: 0.4.1 is on the line 0.4, 1.2.0 on the line 1. A change that another machine or session can notice, for example to a wire type, to the API or to the header, starts a new line (01M3N73EAAD1G88TG7SNFWE4P1). Most merges change no wire type, so the builds differ and the line matches: riff goes on, and tells the person once to update (other_build).

riff-server also takes a riff of the line before its own (01M3MX1E1EY1M7JGNCN6FCEVQK), so a person has one release to update in. It takes no riff of another line. compatible holds the rule for both sides. It reads the version of each side at run time: no release number of riff is a constant in the code (01M5RG6BXBQVFABA1N4NRZBMQF).

Each call of riff carries its build in the header HEADER, and each reply of riff-server carries the build of the server (01M3JEE7P46GWXR1BD4Q1TTSGN). Each side refuses a version that it cannot talk to, or no build (01M3MX1E65XGWDZ062PQ9YXQ5T):

sequenceDiagram
    participant R as riff
    participant S as riff-server
    R->>S: call, riff-build: 0.3.2 929605821e54 2026-09-27T22:03:01Z
    alt the line of the server, or the line before
        S-->>R: reply, riff-build: 0.4.0 7213825ab1c2 2026-09-28T20:10:44Z
        Note over R: another build: one note to update, then go on
    else another line, or no build
        S-->>R: 409, riff-build: the build of the server, the mismatch
    end
    Note over R: a reply with no build, or of a line that riff<br/>cannot talk to, is a Mismatch too

Structs§

Build
One build of riff: the crate version, the commit and its UTC time.
Mismatch
riff and its riff-server cannot talk (01M3MX1E65XGWDZ062PQ9YXQ5T). None is a side that sent no build, or a build of an older form.
Semver
A semantic version: major, minor and patch. A pre-release or build part after - or + is not part of the order.

Enums§

Side
The side of a Mismatch to update.

Constants§

HEADER
The HTTP header that carries a Build.
UPDATE_URL
The part of the book that tells how to update each side.
VERSION
The build of this binary as text, for --version and HEADER (01M3JEE7WT04BKX377VW5GDSPY).

Functions§

compatible
True when riff and riff-server can talk: riff is on a line that the server takes (Semver::riff_lines). That is the line of the server (01M3MX1DYY6AVDW946NR0B9T2C), or the line before (01M3MX1E1EY1M7JGNCN6FCEVQK). Each side checks the other with it: riff each reply, and riff-server each call.
other_build
The note when the builds differ and they can talk (01M3MX1E8M9TKBN90P4DYKH3H8). riff prints it once for each process, and goes on. When riff is on the line before the server, the note says that the next line of the server refuses it. On the same line, the note names the older side (Build::older_than), as riff server does (01M56Q55SHHJSKJWNHMW79X7HA).