Skip to content

release: build .deb and .rpm packages - #271

Merged
congwang-mk merged 2 commits into
mainfrom
nfpm-packages
Oct 2, 2026
Merged

congwang-mk merged 2 commits into
mainfrom
nfpm-packages

Conversation

@congwang-mk

@congwang-mk congwang-mk commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Attaches .deb and .rpm packages per arch to each GitHub Release, so users on Debian/Ubuntu and Fedora/RHEL can install sandlock with their package manager instead of unpacking a tarball. The packages are built in our release CI and are not submitted to any distro.

Packages

The CLI does not link libsandlock_ffi, so the library, its header and its pkg-config file ship in a separate development package:

sandlock sandlock-dev (.deb) / sandlock-devel (.rpm)
Contents /usr/bin/sandlock, /usr/bin/sandlock-oci libsandlock_ffi.so, sandlock.pc, /usr/include/sandlock.h
Library dir /usr/lib (.deb), /usr/lib64 (.rpm)
License /usr/share/doc/<pkg>/copyright (.deb), /usr/share/licenses/<pkg>/LICENSE (.rpm) same
Depends libc6 (>= 2.34), libgcc-s1 / glibc >= 2.34, libgcc same

The usual three-way split (versioned runtime library, -dev with the unversioned symlink) needs a SONAME, which libsandlock_ffi.so does not have, so a program built with the C or Go SDK needs sandlock-dev installed at runtime too. Fedora and RHEL only search /usr/lib64 for 64-bit libraries, hence the per-format library dir. The release binaries only need glibc 2.34 symbols, which covers Ubuntu 22.04, Debian 12, and RHEL/Rocky/Alma 9 onwards. The .deb dev package activates dpkg's ldconfig trigger; on the .rpm side glibc's file trigger already refreshes the cache for /usr/lib64.

Commits

  1. sandlock.pc.in takes its libdir from the caller. The template hardcoded ${exec_prefix}/lib. It is now an @LIBDIR@ placeholder; the Makefile fills in the same value, and the Go library tree it stages is byte-identical.
  2. Release packaging. packaging/nfpm.yaml (CLI) and packaging/nfpm-dev.yaml (library) describe the packages, and packaging/build.sh stages a release build and runs nfpm for both formats, so CI and a local build use the same path. A new packages job in release.yml builds them from the existing per-arch release tarballs with nfpm (pinned by version and sha256), and github-release attaches them. riscv64 is experimental, like its build.

Testing

  • On x86_64 the job installs the .deb packages on the runner and the .rpm packages in a Rocky 9 container, then runs a sandboxed command and checks pkg-config and the linker cache.
  • Locally, all four packages built from a release build of this branch with the pinned nfpm pass that smoke test on clean Ubuntu 24.04 and Rocky 9 containers. The sandlock package alone runs a sandbox and installs no header or library.

🤖 Generated with Claude Code

@congwang-mk
congwang-mk force-pushed the nfpm-packages branch 2 times, most recently from 7b972b3 to f4ff18b Compare October 2, 2026 22:57
Base automatically changed from embed-restore-stub to main October 2, 2026 23:18
The template hardcoded ${exec_prefix}/lib, which is wrong for RPM-based
distros, where 64-bit libraries live in /usr/lib64. libdir is now an
@LIBDIR@ placeholder; the Makefile fills in the same ${exec_prefix}/lib
as before, so the Go library tree it stages is unchanged.

Signed-off-by: Cong Wang <cwang@multikernel.io>
Attach .deb and .rpm packages per arch to each GitHub Release, so users
on Debian/Ubuntu and Fedora/RHEL can install sandlock with their package
manager instead of unpacking a tarball. They are built from the
existing release binaries with nfpm (pinned by version and checksum)
and are not submitted to any distro.

The CLI does not link libsandlock_ffi, so the library ships separately:
sandlock carries the CLI, sandlock-oci and the license, and sandlock-dev
(sandlock-devel for .rpm) carries libsandlock_ffi.so with sandlock.h and
sandlock.pc for C and Go SDK builds. The library has no SONAME, so there
is no versioned runtime library to split off from the header. The
library and .pc file go to /usr/lib for .deb and /usr/lib64 for .rpm,
since Fedora and RHEL only search the latter. The binaries need glibc
2.34, which covers Ubuntu 22.04, Debian 12 and RHEL 9 onwards.

On x86_64 the job installs both packages, the .rpm in a Rocky 9
container, and runs a sandboxed command before the release picks them
up. riscv64 packages are experimental, like the riscv64 build.

Signed-off-by: Cong Wang <cwang@multikernel.io>
@congwang-mk
congwang-mk merged commit c28ce7e into main Oct 2, 2026
17 checks passed
@congwang-mk
congwang-mk deleted the nfpm-packages branch October 2, 2026 23:39
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