Thursday 2 December 2021

How to make git-build-recipe find orig tarballs?

Hi,
I'm looking for experience or a hint on git-build-recipe.
I've worked on a recipe that uses git-ubuntu branches as the base like

# git-build-recipe format 0.4 deb-version {debversion}~{time}
https://git.launchpad.net/ubuntu/+source/postgresql-12 ubuntu/focal-devel

This might be extended with other branches for adaptations or backports,
but this isn't needed for the question I have here.

The problem is that a build without --allow-fallback-to-native will fail.
That is due to git-ubuntu having two pristine-tar branches (since they might
differ between Debian/Ubuntu).
Also git-build-recipe isn't just using the orig tarball from the archive
and ends up like:

$ git-build-recipe --no-build --distribution focal
recipes/postgresql-12-focal.recipe /tmp/testbuild/
...
pristine-tar: There's no local pristine-tar branch. Several remote
pristine-tar branches exist.
Run "git branch --track pristine-tar <remote>" to create a local
pristine-tar branch
ed778a9b05e89dc12aff034836655ab40d10da42
refs/remotes/source/importer/debian/pristine-tar
274809cadf2802b26b8a4dd2425d266447e4f5d6
refs/remotes/source/importer/ubuntu/pristine-tar
usage: git-build-recipe [-h] [--manifest PATH] [--if-changed-from
PATH] [--package PACKAGE] [--distribution DISTRIBUTION] [--no-build]
[--append-version APPEND_VERSION] [--safe]
[--allow-fallback-to-native]
LOCATION [WORKING-BASEDIR]
git-build-recipe: error: Unable to find the upstream source. Import
it as tag upstream/12.9 or build with --allow-fallback-to-native.


Note: I tried pushing a tag as the error message suggests, but it
didn't work for me.

So far (in all other recipes I had) this wasn't a problem, but I had to realize
that the way this --allow-fallback-to-native works will bump the time of all
files to the time that git-build-recipe ran.

And in postgresql case that became obvious as it started to rebuild things only
meant to be re-built when upstream creates a new tarball, but since the stamp
files were no more newer it now did and led to an FTBFS.

My question would be if anyone knows how to do either of:
a) Get it to use the tarball from the Ubuntu Archive
b) How to correctly push ie.g. tag (and where) so that git-build-recipe properly
recognizes and uses that as the upstream content
c) Specify the pristine-tar branch I want it to use

I have a (way too ugly) workaround for now and would appreciate any
hints on this topic.

--
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel