Skip to content

Support Debusine builds from externally-prepared source trees: srcpkg-artifact delivery and assemble-orig flag#167

Open
bjordiscollaku wants to merge 3 commits into
mainfrom
feat/reusable-workflow-srcpkg-artifact
Open

Support Debusine builds from externally-prepared source trees: srcpkg-artifact delivery and assemble-orig flag#167
bjordiscollaku wants to merge 3 commits into
mainfrom
feat/reusable-workflow-srcpkg-artifact

Conversation

@bjordiscollaku
Copy link
Copy Markdown
Contributor

@bjordiscollaku bjordiscollaku commented May 29, 2026

Summary

Extend the reusable workflow to support packages that do not follow the
single-repository packaging model. Two new inputs — srcpkg-artifact
and assemble-orig — unlock Debusine builds for packages like
pkg-linux-qcom where the kernel source (qualcomm-linux/kernel) and
the packaging metadata (debian/) live in separate repositories and are
injected into a single source tree at build time by prepare-source.sh.
The resulting tree has no upstream tag, no pristine-tar branch, and no
debian/gbp.conf — making the existing git-checkout and gbp-based paths
structurally inapplicable.


Motivation

The existing workflow has a single model for source tree delivery: check
out the packaging repository at debian-ref into srcpkg/. This works
for repositories where the upstream source and debian/ metadata are
co-located or linked via gbp conventions.

pkg-linux-qcom does not fit this model:

  • The kernel source is a shallow clone of qualcomm-linux/kernel at a
    qcom-next-* tag, optionally patched with qcom-next and kernel-topics
    PRs.
  • The debian/ metadata is injected by prepare-source.sh from the
    pkg-linux-qcom packaging repository into the kernel source tree.
  • The assembled tree is ephemeral — it exists only in the build workspace
    and has no corresponding git ref, no upstream tag, no pristine-tar
    branch, and no debian/gbp.conf.

Consequently:

  • There is no debian-ref that can be checked out to produce a buildable
    srcpkg/.
  • gbp buildpackage cannot reconstruct the .orig.tar.gz because there
    is no pristine-tar data and no upstream tag to fetch from.

Both failure modes are structural, not configuration errors. They require
new delivery and source-package-generation paths, not workarounds.


New inputs

srcpkg-artifact — controls source tree delivery

When empty (the default), the existing behaviour is preserved: the
packaging repository is checked out at debian-ref in both the
debian-build and test jobs. No existing callers are affected.

When set, the named artifact is expected to be a tar.gz archive of the
prepared source tree. The archive is downloaded to a staging directory
and extracted with --strip-components=1 directly into srcpkg/.

Why tar.gz and not a direct directory upload?
actions/upload-artifact uses zip format internally, which strips Unix
execute permissions. Kernel build scripts (e.g. scripts/cc-version.sh)
require execute permission; without it, make defconfig fails with
Permission denied inside the Debusine build environment. tar
preserves permissions end-to-end; the zip layer wraps a single opaque
file and permissions are restored on extraction.

The debian-ref input remains required by the workflow schema but is not
consumed for checkout when srcpkg-artifact is set.

assemble-orig — controls source package generation strategy

When false (the default), generate-source-package uses gbp buildpackage
to reconstruct the orig tarball from pristine-tar or an upstream tag.

When true, passes DEBUSINE_ASSEMBLE_ORIG=true to generate-source-package
(added in qualcomm-linux/debusine-action
feat/generate-source-package-non-gbp-quilt), which:

  1. Creates ../<pkg>_<upstream_ver>.orig.tar.gz directly from the source
    tree, excluding ./debian and ./.git
  2. Invokes dpkg-buildpackage -S -sa -d -nc -us -uc to produce the
    .dsc, .debian.tar.xz, and .changes files

This is required for source trees that have no upstream tarball available
via gbp or pristine-tar — specifically, shallow kernel clones assembled
at build time with no version-control history that gbp can interrogate.


Design

The two inputs are orthogonal:

  • srcpkg-artifact determines where the source tree comes from
  • assemble-orig determines how the source package is generated from it

A caller can use either independently, though for pkg-linux-qcom both
are required together.


Dependency

This PR depends on:

Until that PR is merged into main, DEBUSINE_ACTION_REF is pinned to
feat/generate-source-package-non-gbp-quilt and will be updated to main
once merged.

@bjordiscollaku bjordiscollaku changed the title qcom-build-pkg-reusable-workflow: support pre-prepared source trees via srcpkg-artifact Support Debusine builds from externally-prepared source trees: srcpkg-artifact delivery and assemble-orig flag May 29, 2026
Add `srcpkg-artifact` input (default: empty) that, when set,
downloads a pre-prepared source tree artifact into `srcpkg/` instead of
checking out the packaging repository at `debian-ref`. This enables
callers such as pkg-linux-qcom to assemble the source tree at CI time
(e.g. kernel source with `debian/` injected by prepare-source.sh) and
pass it to the reusable workflow for Debusine source package generation
and build submission.

When `srcpkg-artifact` is empty (the default), the existing behaviour
is preserved: the packaging repository is checked out at `debian-ref`
in both the `debian-build` and `test` jobs.

Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
When srcpkg-artifact is set, the artifact is a tar.gz archive rather
than a flat directory. Callers that need to preserve Unix file
permissions (execute bits on kernel build scripts) must use tar
instead of the zip-based artifact upload.

Replace the direct download-to-srcpkg/ approach with a two-step
download-then-extract pattern: download the artifact to a staging
directory, then extract with --strip-components=1 directly into
srcpkg/. This is robust regardless of the top-level directory name
inside the archive and correctly restores execute permissions that
would otherwise be stripped by zip-based artifact transport.

Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
Add a boolean input assemble-orig (default: false) that, when
set, passes DEBUSINE_ASSEMBLE_ORIG=true to generate-source-package.

This enables callers whose source tree is assembled externally with no
upstream tarball available via gbp or pristine-tar to request direct
orig tarball assembly without relying on heuristics inside
generate-source-package.

Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
@bjordiscollaku bjordiscollaku force-pushed the feat/reusable-workflow-srcpkg-artifact branch from 9a0996e to 14ff1d1 Compare May 29, 2026 20:53
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