Possible to create a daily recipe when there is a pristine-tar branch?

Asked by Richard Hansen

Is it possible to create a daily build recipe that works when the debian/ directory comes from a git-buildpackage repository containing a pristine-tar branch?

When I try, the pristine-tar is reconstituted and all of the daily changes that get merged in result in this error:

    dpkg-source: error: aborting due to unexpected upstream changes

Here is a specific example:
https://code.launchpad.net/~ddclient/+archive/ubuntu/daily/+recipebuild/2606368

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Colin Watson
Solved:
Last query:
Last reply:
Revision history for this message
Ioana Lasc (ilasc) said :
#1

Hi Richard

It is possible to create the daily recipe but it would require a change in your recipe.

The recipe is currently merging master from lp:~ddclient/ddclient/+git/ddclient-debian into master of lp:ddclient and building the resulting tree. The problem is that when upstream release tarballs are created they won't contain the entire upstream git working tree, but a modified subset of it. When the recipe takes lp:~ddclient/ddclient/+git/ddclient-debian master and merges it into lp:ddclient master the effect is that the resulting tree contains a number of files from upstream's git tree that aren't in the tarballs released by upstream. It's these files that dpkg-source is complaining about and that you can see listed in the buildlog under the line: "dpkg-source: info: local changes detected, the modified files are:".

If you wish to see in more detail the difference in files you can compare locally lp:ddclient's master branch with lp:~ddclient/ddclient/+git/ddclient-debian's upstream branch:

git clone git+ssh://<email address hidden>/ddclient
cd ddclient/
git remote add upstream https://salsa.debian.org/debian/ddclient.git
git fetch upstream master:upstream_master
git diff upstream_master

The best thing to do in this case to get the daily build working is to reconfigure the recipe to just build lp:~ddclient/ddclient/+git/ddclient-debian master directly, rather than merging it into lp:ddclient master and attempting to build the resulting tree.

Hope this helps.

Revision history for this message
Richard Hansen (rhansen) said :
#2

Thank you for your answer. I really appreciate you taking the time!

> When the recipe takes lp:~ddclient/ddclient/+git/ddclient-debian
> master and merges it into lp:ddclient master the effect is that the
> resulting tree contains a number of files from upstream's git tree
> that aren't in the tarballs released by upstream.

Yes, exactly. That's what I want -- this recipe is for a daily build that should contain a snapshot of upstream's master. By definition those files won't match the files in the release tarball that is checked into the pristine-tar branch.

To clarify:
  * lp:ddclient is a mirror of the upstream project's repository at https://github.com/ddclient/ddclient. It contains only upstream sources -- no debian/ directory exists in that repository.
  * lp:~ddclient/ddclient/+git/ddclient-debian is a mirror of https://salsa.debian.org/debian/ddclient. It contains the sources from the latest stable release, plus a debian/ directory, plus a pristine-tar branch for reconstructing the orig.tar.gz of the latest stable release.

I want the daily build to contain the sources from the upstream repo (lp:ddclient) but with the debian/ directory from the Debian repo (lp:~ddclient/ddclient/+git/ddclient-debian).

When the recipe is set to this:

    # git-build-recipe format 0.4 deb-version {debversion}+git{revtime}
    lp:ddclient master
    merge packaging lp:~ddclient/ddclient/+git/ddclient-debian

the resulting merge contains exactly what I want.

However, when git-build-recipe kicks off the build, the first thing it does is detect the pristine-tar branch from the Debian repository and reconstruct the orig.tar.gz from that. What I want it to do is ignore the pristine-tar branch and construct the orig.tar.gz from the upstream snapshot. If the lp:~ddclient/ddclient/+git/ddclient-debian repo didn't have a pristine-tar branch I think the recipe would work how I want it to work.

> The best thing to do in this case to get the daily build working is
> to reconfigure the recipe to just build
> lp:~ddclient/ddclient/+git/ddclient-debian master directly, rather
> than merging it into lp:ddclient master and attempting to build the
> resulting tree.

That's what I'm doing for the stable release recipe:
https://code.launchpad.net/~ddclient/+recipe/ddclient-stable
It works well, but I would also like to make daily snapshot packages.

Revision history for this message
Best Colin Watson (cjwatson) said :
#3

I see. Interesting.

git-build-recipe tries to check out specifically the pristine tarball corresponding to the upstream version part of the topmost entry in debian/changelog. So I think a viable approach in your case would be, instead of merging master, to merge a branch that had an artificial "snapshot" entry at the top of debian/changelog with a different upstream version part: that way, it won't find the pristine tarball and will use its fallback logic instead. That branch could be just a small change on top of master, so not too hard to maintain.

Can you try that approach?

Revision history for this message
Richard Hansen (rhansen) said :
#4

> instead of merging master, to merge a branch that had an artificial
> "snapshot" entry at the top of debian/changelog with a different
> upstream version part

Interesting idea, I'll try that out and report back.

I'm also going to try merging a repository that contains the debian/ directory but lacks the pristine-tar branch. (I'm currently waiting for https://code.launchpad.net/~ddclient/ddclient/+git/debian-packaging to complete its initial import.)

Thanks!

Revision history for this message
Richard Hansen (rhansen) said :
#5

> instead of merging master, to merge a branch that had an artificial
> "snapshot" entry at the top of debian/changelog with a different
> upstream version part

That worked, thanks!

> I'm also going to try merging a repository that contains the debian/
> directory but lacks the pristine-tar branch.

That also worked.

Revision history for this message
Richard Hansen (rhansen) said :
#6

Thanks Colin Watson, that solved my question.