Skip to content

Fix fmt 9 compatibility, and use system libs for (most) CI jobs - #163

Open
jagerman wants to merge 2 commits into
session-foundation:clientfrom
jagerman:system-deps-ci
Open

jagerman wants to merge 2 commits into
session-foundation:clientfrom
jagerman:system-deps-ci

Conversation

@jagerman

Copy link
Copy Markdown
Member

format_as only started working with fmt starting in version 10, and so builds on bookworm using system libfmt were failing; this fixes it.

This also changes CI jobs to use system libs as much as possible, for faster builds since in many cases we don't have to rebuild dependencies. It keeps a jammy-based static build just to ensure that that path still works properly.

fmt's ADL `format_as` hook only reaches non-enum types from fmt 10, so the
three types using it here -- human_size, the XWingKeys-derived device and
account keys, and devices.cpp's Processing -- are unformattable against a
system fmt 9 (Debian bookworm), which fails as a wall of template errors
deep inside fmt rather than as anything that names them.

Specializations work from fmt 9 through 12, and are also the only form
std::format offers, so nothing here has to be rewritten if we ever move to
it.  The output is unchanged.

human_size's formatter goes in session/format.hpp with the others, keeping
session/util.hpp free of fmt headers as before; what was its format_as is
now human_size::str().

`fmt::format_context` is spelled out in the devices.cpp formatters: an
out-of-line partial specialization does not get namespace fmt into its
unqualified lookup on gcc 12 with fmt 9, where the unqualified name is not
found and the parameter silently becomes `int&`.
Every debian_build now installs the libraries the distro has and configures
with -DBUILD_STATIC_DEPS=OFF, rather than compiling its own copy of each
dependency.  That is considerably faster, and it is what puts distro library
versions in front of our code: Debian 12's fmt 9 is a version we have to
support and was, until now, never built against in CI.

A too-old system library still falls back to building that one dependency
(libsodium on Debian 12 and Ubuntu 22.04), so this does not narrow what we
can build on.

One full static-deps build is kept, on Ubuntu 22.04 as the oldest
distribution we support, so that the vendored dependency builds -- what the
release artifacts use -- keep being exercised.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant