Skip to content

Commit b4aed16

Browse files
zardusclaude
andcommitted
Revert source-bundle generation back to binary-only
dpkg-buildpackage -us -uc (without -b) requires the port to satisfy 3.0 (quilt) round-trip semantics — orig.tar + debian/patches must reconstruct the working tree. SafeLibs ports do not satisfy that contract (no upstream tarball, post-patch safe/ tree, and several ports keep partial debian/patches/ that no longer round-trip). Pull the template back to binary-only via -b. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 816c5da commit b4aed16

2 files changed

Lines changed: 17 additions & 65 deletions

File tree

.github/workflows/ci-release.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,54 +83,54 @@ jobs:
8383
id: artifact
8484
run: |
8585
set -euo pipefail
86+
shopt -s nullglob
8687
mapfile -t debs < <(find dist -type f -name '*.deb' -print | sort)
8788
if (( ${#debs[@]} == 0 )); then
8889
printf 'No .deb files were produced under dist/.\n' >&2
8990
exit 1
9091
fi
91-
mapfile -t all_files < <(find dist -type f -print | sort)
9292
{
93-
printf 'count=%d\n' "${#all_files[@]}"
93+
printf 'count=%d\n' "${#debs[@]}"
9494
printf 'paths<<EOF\n'
95-
printf '%s\n' "${all_files[@]}"
95+
printf '%s\n' "${debs[@]}"
9696
printf 'EOF\n'
9797
} >> "$GITHUB_OUTPUT"
98-
printf 'Built %d artifact(s) (%d .deb):\n' "${#all_files[@]}" "${#debs[@]}"
99-
printf ' %s\n' "${all_files[@]}"
98+
printf 'Built %d .deb file(s):\n' "${#debs[@]}"
99+
printf ' %s\n' "${debs[@]}"
100100
101101
- name: Upload Debian artifacts
102102
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
103103
with:
104104
name: debs-${{ github.run_id }}
105-
path: dist/*
105+
path: dist/*.deb
106106
if-no-files-found: error
107107

108108
- name: Publish build release
109109
if: github.event_name == 'push'
110110
env:
111111
GH_TOKEN: ${{ github.token }}
112-
ARTIFACT_PATHS: ${{ steps.artifact.outputs.paths }}
112+
DEB_PATHS: ${{ steps.artifact.outputs.paths }}
113113
run: |
114114
set -euo pipefail
115115
116116
short_sha="${GITHUB_SHA:0:12}"
117117
tag="build-${short_sha}"
118118
119-
mapfile -t artifact_files <<< "$ARTIFACT_PATHS"
119+
mapfile -t deb_files <<< "$DEB_PATHS"
120120
121121
notes_file="$(mktemp)"
122122
{
123123
printf 'Commit SHA: %s\n\n' "$GITHUB_SHA"
124-
printf 'Attached binary (.deb) and source (.dsc, .tar.*, .changes, .buildinfo) artifacts were produced by `scripts/build-debs.sh`.\n'
124+
printf 'Attached .deb file(s) were produced by `scripts/build-debs.sh`.\n'
125125
} > "$notes_file"
126126
127127
if gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
128-
gh release upload "$tag" "${artifact_files[@]}" --repo "$GITHUB_REPOSITORY" --clobber
128+
gh release upload "$tag" "${deb_files[@]}" --repo "$GITHUB_REPOSITORY" --clobber
129129
else
130-
gh release create "$tag" "${artifact_files[@]}" \
130+
gh release create "$tag" "${deb_files[@]}" \
131131
--repo "$GITHUB_REPOSITORY" \
132132
--target "$GITHUB_SHA" \
133-
--title "Safe library build for ${short_sha}" \
133+
--title "Safe library debs for ${short_sha}" \
134134
--notes-file "$notes_file"
135135
fi
136136

scripts/lib/build-deb-common.sh

Lines changed: 5 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
# run in a directory containing debian/changelog.
1212
# Honors $SAFELIBS_COMMIT_SHA when set.
1313
# build_with_dpkg_buildpackage
14-
# Run mk-build-deps + dpkg-buildpackage -us -uc in
15-
# the current directory (full build: source + binary)
16-
# and copy the resulting .deb / .dsc / .tar.* /
17-
# .buildinfo / .changes files into $repo_root/dist.
14+
# Run mk-build-deps + dpkg-buildpackage -us -uc -b
15+
# (binary-only) in the current directory and copy
16+
# the resulting .deb files into $repo_root/dist.
1817

1918
prepare_rust_env() {
2019
if [[ -f "$HOME/.cargo/env" ]]; then
@@ -77,56 +76,9 @@ stamp_safelibs_changelog() {
7776
mv debian/changelog.new debian/changelog
7877
}
7978

80-
_synthesize_orig_tarball_if_needed() {
81-
# SafeLibs ports don't carry an upstream orig.tar (the safe/ tree IS the
82-
# source). For 3.0 (quilt) packages, dpkg-source -b refuses to build
83-
# without one, so synthesize a deterministic orig.tar.xz from the safe/
84-
# tree (excluding debian/ and build artifacts).
85-
[[ -f debian/source/format ]] || return 0
86-
grep -Fq '3.0 (quilt)' debian/source/format || return 0
87-
88-
local package upstream_version orig_tar
89-
package="$(dpkg-parsechangelog -S Source)"
90-
upstream_version="$(dpkg-parsechangelog -S Version | sed -E 's/-[^-]*$//')"
91-
orig_tar="../${package}_${upstream_version}.orig.tar.xz"
92-
93-
[[ -f "$orig_tar" ]] && return 0
94-
95-
local stage
96-
stage="$(mktemp -d)"
97-
rsync -a \
98-
--exclude='/debian' \
99-
--exclude='/target' \
100-
--exclude='/build' \
101-
--exclude='/build-check' \
102-
--exclude='/build-check-install' \
103-
--exclude='/.git' \
104-
./ "$stage/${package}-${upstream_version}/"
105-
tar --create --xz --file="$orig_tar" \
106-
--sort=name --owner=0 --group=0 --numeric-owner \
107-
--mtime='@0' \
108-
-C "$stage" "${package}-${upstream_version}"
109-
rm -rf "$stage"
110-
}
111-
11279
build_with_dpkg_buildpackage() {
11380
local repo_root="$1"
11481
sudo mk-build-deps -i -r -t "apt-get -y --no-install-recommends" debian/control
115-
_synthesize_orig_tarball_if_needed
116-
dpkg-buildpackage -us -uc
117-
shopt -s nullglob
118-
local artifacts=(
119-
../*.deb
120-
../*.ddeb
121-
../*.dsc
122-
../*.tar.gz ../*.tar.xz ../*.tar.bz2 ../*.tar.zst
123-
../*.buildinfo
124-
../*.changes
125-
)
126-
shopt -u nullglob
127-
if (( ${#artifacts[@]} == 0 )); then
128-
printf 'build_with_dpkg_buildpackage: dpkg-buildpackage produced no artifacts\n' >&2
129-
return 1
130-
fi
131-
cp -v "${artifacts[@]}" "$repo_root/dist"/
82+
dpkg-buildpackage -us -uc -b
83+
cp -v ../*.deb "$repo_root/dist"/
13284
}

0 commit comments

Comments
 (0)