Skip to content

build: Add Debian packaging - #272

Open
kpanuragh wants to merge 2 commits into
linux-credentials:mainfrom
kpanuragh:deb-packaging
Open

kpanuragh wants to merge 2 commits into
linux-credentials:mainfrom
kpanuragh:deb-packaging

Conversation

@kpanuragh

Copy link
Copy Markdown
Contributor

Part of #268. This adds Debian packaging in distrib/debian/, next to the Arch PKGBUILD in #269. It builds three packages:

  • credentialsd: the daemon, its D-Bus activation file and systemd user unit.
  • credentialsd-ui: the GTK dialog and the portal backend description.
  • credentialsd-webextension: the Firefox/Chromium helper and the native messaging manifest.

It builds offline from the crates that meson dist vendors into the source tarball. That's what OBS needs for Debian/Ubuntu targets. README.source explains how to make the tarball.

The first commit fixes meson dist: the vendoring script was registered three times, and the second run failed on mkdir .cargo, so no tarball was produced.

Release mode

Debian builds use the default profile=release, so they rely on #270. Without it the packages contain debug builds. I tested with #270 applied: all Cargo builds use the release profile, with Rust LTO. Cargo's release profile has no debug info, which left the -dbgsym packages empty, so debian/rules sets CARGO_PROFILE_RELEASE_DEBUG=true, and dh_strip moves the symbols out.

Testing

  • Builds in clean, offline containers on Debian sid and Ubuntu 26.10, with build: Build releases in release mode, and make the trusted-client overrides opt-in #270 applied. Before adding the debug info setting, I also checked -A, -B, and a rebuild after clean.
  • lintian only reports initial-upload-closes-no-bugs, no-manual-page, and appstream-metadata-validation-failed. The last one is upstream: the metainfo refers to a .desktop file that isn't installed.
  • Debian sid VM (QEMU), using these packages built with build: Build releases in release mode, and make the trusted-client overrides opt-in #270:
    • apt install of the three .debs pulls in GTK 4, libnfc and pcsclite.
    • D-Bus activation starts the daemon, then the UI.
    • The daemon logs "Ignoring CREDSD_TRUSTED_CALLERS", and rejects python3 as an untrusted caller.
    • End-to-end in a browser: GNOME 51, Firefox ESR started from the app grid, the extension from credentialsd-webextension (installed via policy, since ESR allows unsigned extensions), and the patched xdg-desktop-portal built in the VM (1.22.1 + Credential commits). On webauthn.io, registration and then sign-in both went through the extension, the helper, the portal, credentialsd and the dialog, using a virtual FIDO2 key over USB/IP. Stock systemd udev rules give the seat user access to the key.
    • In that test, requests arrived as firefox-esr, which the daemon doesn't list as privileged yet. That's fixed in daemon: Treat Debian's Firefox ESR as a privileged client #271.

Getting into the Debian archive

This packaging works for OBS and other third-party repositories. The Debian archive needs every crate packaged on its own (librust-*-dev) instead of vendor/. I compared Cargo.lock with Debian sid:

  • 388 crates in total;
  • 336 are in sid at a compatible version;
  • 31 are in sid only at an incompatible version;
  • 21 aren't in Debian at all. Most of them belong to libwebauthn's stack: apdu, apdu-core, apdu-derive, bluer, bluez-async, bluez-generated, btleplug, cbor-smol, cosey, ctap-types, dbus-tokio, delog, heapless-bytes, iso7816, libwebauthn, nfc1, nfc1-sys, pxp, serde-indexed, text_io.

An upload also needs an ITP bug and a sponsor. I'll post the full list on #268.

Found while testing (not changed here)

The root meson.build and the credentialsd and credentialsd-ui subdirs
each registered build-aux/dist-vendor.sh. The root and credentialsd
registrations both run in the same dist directory, so the second one
fails on `mkdir .cargo` and `meson dist` aborts without producing a
tarball. Keep the registration in the root meson.build only, which
vendors the crates for the whole workspace.
Add distrib/debian/, which builds the daemon, the GTK UI and the browser
helper as credentialsd, credentialsd-ui and credentialsd-webextension.
It builds offline from the crates that `meson dist` vendors into the
source tarball, so it works on the openSUSE Build Service. README.source
explains how to make the tarball and what an upload to the Debian
archive needs instead (crates packaged on their own).
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