Merge ~cjwatson/launchpad-buildd:recipe-ignore-fewer-files into launchpad-buildd:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 95cbdd080691b4b378b983d35394b45c3f17f52c
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad-buildd:recipe-ignore-fewer-files
Merge into: launchpad-buildd:master
Diff against target: 29 lines (+9/-1)
2 files modified
bin/buildrecipe (+2/-1)
debian/changelog (+7/-0)
Reviewer Review Type Date Requested Status
Guruprasad Approve
Review via email: mp+439758@code.launchpad.net

Commit message

Ignore fewer files when building recipes

Description of the change

`dpkg-buildpackage -I` ignores files matching a number of patterns (see `@tar_ignore_default_pattern` in `/usr/share/perl5/Dpkg/Source/Package.pm`). Most of these are revision control metadata, and ignoring those is no problem. However, they also include things like `.a` and `.so`. Including these in source packages is typically not good practice, but in the rare cases where people need to do it, `dpkg-buildpackage -I` leaves them with no good alternative: there's no way to override it and say that particular files shouldn't be ignored.

Since by definition we're building from a clean bzr or git tree here, the only things we actually need to ignore are the `.bzr` and `.git` directories. For everything else, we can reasonably assume that if it's checked into revision control then the developer most probably wants to have it in the source package.

To post a comment you must log in.
Revision history for this message
Guruprasad (lgp171188) wrote :

LGTM 👍🏼 Does this allow binaries to be added to the source packages and shipped through the binary packages, bypassing the Launchpad requirement to only upload source packages (which in spirit only contains source code and not precompiled binaries, FOSS or not) and having Launchpad build the binary packages from it?

review: Approve
Revision history for this message
Colin Watson (cjwatson) wrote :

It does, but being a non-text file was always an imperfect proxy for that (e.g. sometimes an image is in fact the preferred form for modification of graphical assets such as icons, and there exist files that look like text files that I'd class as compiled output rather than source code). I don't think that requirement is one that we should be trying to enforce by means of technical limitations on source package recipes; and if it were, then a good implementation wouldn't look like this anyway.

95cbdd0... by Colin Watson

Clarify changelog

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/buildrecipe b/bin/buildrecipe
2index 6cfa10f..8cbda6d 100755
3--- a/bin/buildrecipe
4+++ b/bin/buildrecipe
5@@ -413,7 +413,8 @@ class RecipeBuilder:
6 [
7 "su",
8 "-c",
9- "cd %s && /usr/bin/dpkg-buildpackage -i -I -us -uc -S -sa"
10+ "cd %s && "
11+ "/usr/bin/dpkg-buildpackage -i -I.bzr -I.git -us -uc -S -sa"
12 % self.source_dir_relative,
13 self.username,
14 ]
15diff --git a/debian/changelog b/debian/changelog
16index f18c8dd..43148d0 100644
17--- a/debian/changelog
18+++ b/debian/changelog
19@@ -1,3 +1,10 @@
20+launchpad-buildd (231) UNRELEASED; urgency=medium
21+
22+ * Only ignore .bzr and .git when building source packages from recipes,
23+ not all the things that "dpkg-buildpackage -I" ignores.
24+
25+ -- Colin Watson <cjwatson@ubuntu.com> Mon, 27 Mar 2023 17:56:08 +0100
26+
27 launchpad-buildd (230) focal; urgency=medium
28
29 * Apply black and isort.

Subscribers

People subscribed via source and target branches