Support Debusine builds from externally-prepared source trees: srcpkg-artifact delivery and assemble-orig flag#167
Open
bjordiscollaku wants to merge 3 commits into
Open
Conversation
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>
9a0996e to
14ff1d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend the reusable workflow to support packages that do not follow the
single-repository packaging model. Two new inputs —
srcpkg-artifactand
assemble-orig— unlock Debusine builds for packages likepkg-linux-qcomwhere the kernel source (qualcomm-linux/kernel) andthe packaging metadata (
debian/) live in separate repositories and areinjected into a single source tree at build time by
prepare-source.sh.The resulting tree has no upstream tag, no
pristine-tarbranch, and nodebian/gbp.conf— making the existing git-checkout and gbp-based pathsstructurally inapplicable.
Motivation
The existing workflow has a single model for source tree delivery: check
out the packaging repository at
debian-refintosrcpkg/. This worksfor repositories where the upstream source and
debian/metadata areco-located or linked via gbp conventions.
pkg-linux-qcomdoes not fit this model:qualcomm-linux/kernelat aqcom-next-*tag, optionally patched with qcom-next and kernel-topicsPRs.
debian/metadata is injected byprepare-source.shfrom thepkg-linux-qcompackaging repository into the kernel source tree.and has no corresponding git ref, no upstream tag, no
pristine-tarbranch, and no
debian/gbp.conf.Consequently:
debian-refthat can be checked out to produce a buildablesrcpkg/.gbp buildpackagecannot reconstruct the.orig.tar.gzbecause thereis 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 deliveryWhen empty (the default), the existing behaviour is preserved: the
packaging repository is checked out at
debian-refin both thedebian-buildandtestjobs. No existing callers are affected.When set, the named artifact is expected to be a
tar.gzarchive of theprepared source tree. The archive is downloaded to a staging directory
and extracted with
--strip-components=1directly intosrcpkg/.Why
tar.gzand not a direct directory upload?actions/upload-artifactuses zip format internally, which strips Unixexecute permissions. Kernel build scripts (e.g.
scripts/cc-version.sh)require execute permission; without it,
make defconfigfails withPermission deniedinside the Debusine build environment.tarpreserves permissions end-to-end; the zip layer wraps a single opaque
file and permissions are restored on extraction.
The
debian-refinput remains required by the workflow schema but is notconsumed for checkout when
srcpkg-artifactis set.assemble-orig— controls source package generation strategyWhen false (the default),
generate-source-packageusesgbp buildpackageto reconstruct the orig tarball from pristine-tar or an upstream tag.
When true, passes
DEBUSINE_ASSEMBLE_ORIG=truetogenerate-source-package(added in qualcomm-linux/debusine-action
feat/generate-source-package-non-gbp-quilt), which:../<pkg>_<upstream_ver>.orig.tar.gzdirectly from the sourcetree, excluding
./debianand./.gitdpkg-buildpackage -S -sa -d -nc -us -ucto produce the.dsc,.debian.tar.xz, and.changesfilesThis 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-artifactdetermines where the source tree comes fromassemble-origdetermines how the source package is generated from itA caller can use either independently, though for
pkg-linux-qcombothare required together.
Dependency
This PR depends on:
adds
DEBUSINE_ASSEMBLE_ORIGsupport togenerate-source-package.Until that PR is merged into
main,DEBUSINE_ACTION_REFis pinned tofeat/generate-source-package-non-gbp-quiltand will be updated tomainonce merged.