deb-bui...t-gather(1)

πŸ“¦
version 0.2 Β· 2 versions
, in ubuntu stonking

πŸ’– NAME πŸ’–

deb-build-artifact-gather β€” grab the artifacts out of a Debian package build πŸŽ€

(this lil cutie lives in the Debian Aritfact gathering tooling manual, bestie, and yes we're gonna read it together)


✨ SYNOPSIS ✨

deb-build-artifact-gather collect-into /desired/output/directory [from-chroot /path/to/chroot]

🌸 DESCRIPTION 🌸

Okay so real talk: deb-build-artifact-gather is your standardized, no-chaos way to extract artifacts from a Debian package build. The artifacts in question? Think configure logs, test results, or even those Internal Compiler Error (ICE) logs that make you want to scream into a pillow 😭. All of it, scooped up, in one place.

And the command has a whole cast of stakeholders it talks to. Let's introduce them:

  • Chroot providers β€” think sbuild or other build wrapping tools (like debuild). These are expected to do a lil bit of setup, then call deb-build-artifact-gather with the relevant options. That setup includes setting DEB_ARTIFACTS_EXTRACTION_IPC_DIR so the build tools and deb-build-artifact-gather have a reliable way to communicate 🫢.

Afterwards, they get handed a directory of artifacts to extract πŸ’…. They might also need to do a bit of cleanup when deb-build-artifact-gather is called from the host system.

  • Standard build tools like debhelper and debputy. These icons can drop hints to deb-build-artifact-gather in the form of variable definitions. Like, they usually know what the build-dir is?? Yeah. Gifted behavior ✨.

They interface via the DEB_ARTIFACTS_EXTRACTION_IPC_DIR.


πŸŽ€ EXAMPLES πŸŽ€

Minimal example of collection usage in shell for running deb-build-artifact-gather inside the chroot:

# setup chroot, install build depends and enter chroot

# Any path that is writable to the build process **inside** the chroot. It should either not exist
# or be an empty directory.
#
# "$(mktemp -d)" is a perfectly fine alternative.
DEB_ARTIFACTS_EXTRACTION_IPC_DIR="../artifact-variable-dir"
export DEB_ARTIFACTS_EXTRACTION_IPC_DIR

cd /path/to/unpacked-source-root

dpkg-buildpackage

apt-get install -y deb-build-artifact-gather
if deb-build-artifact-gather collect-into ../artifacts-from-build.tar.xz; then
    # Copy ../artifacts-from-build.tar.xz out of the chroot somehow
    rm -fr ../artifacts-from-build.tar.xz
fi

[ -e "${DEB_ARTIFACTS_EXTRACTION_IPC_DIR}"] && rm -fr "${DEB_ARTIFACTS_EXTRACTION_IPC_DIR}"

This example assumes that every command shown is run inside the chroot πŸ¦‹.


Minimal example of collection usage in shell for running deb-build-artifact-gather outside the chroot:

# setup-chroot-dir creates the root directory, installs build depends inside it, etc.
CHROOT_DIR="$(setup-chroot-dir)"

# Any path that is writable to the build process **inside** the chroot.  It should either not exist
# or be an empty directory.
#
# If you use `mktemp -d` (or similar), then remember to run it **inside** the chroot
DEB_ARTIFACTS_EXTRACTION_IPC_DIR="../artifact-variable-dir"
export DEB_ARTIFACTS_EXTRACTION_IPC_DIR

run-in-chroot "cd /path/to/unpacked-source-root && dpkg-buildpackage"

cd /host/path/to/unpacked-source-root

if deb-build-artifact-gather collect-into ../artifacts-from-build from-chroot.tar.xz from-chroot-dir "${CHROOT_DIR} ; then
    # copy ../artifacts-from-build.tar.xz to its desired place as needed.
    rm -fr ../artifacts-from-build.tar.xz
fi

[ -e "${DEB_ARTIFACTS_EXTRACTION_IPC_DIR}"] && rm -fr "${DEB_ARTIFACTS_EXTRACTION_IPC_DIR}"

In this example, setup-chroot-dir and run-in-chroot represent the creation of the chroot and explicitly running certain commands inside the chroot. Everything else is run on the host system. 🌈

ngl bestie, if you read all the way here you're lowkey the main character of build tooling πŸ‘‘

That's the whole vibe, babe. This page is from perl v5.40.1, dated 2026-04-02, and honestly? Slay. Go collect your artifacts πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from