Fran ois Marier: pristine-tar and git-buildpackage Work-arounds
I recently ran into problems trying to package the
latest version of my
planetfilter
tool.
This is how I was able to temporarily work-around bugs in my tools and still
produce a package that can be
built reproducibly from source and that contains a verifiable upstream
signature.
pristine-tar being is unable to reproduce a tarball
After importing the
latest upstream tarball
using
pristine-tar being is unable to reproduce a tarball
After importing the
latest upstream tarball
using gbp import-orig, I tried to build the package but ran into this
pristine-tar error:
$ gbp buildpackage
gbp:error: Pristine-tar couldn't checkout "planetfilter_0.7.4.orig.tar.gz": xdelta3: target window checksum mismatch: XD3_INVALID_INPUT
xdelta3: normally this indicates that the source file is incorrect
xdelta3: please verify the source file with sha1sum or equivalent
xdelta3 decode failed! at /usr/share/perl5/Pristine/Tar/DeltaTools.pm line 56.
pristine-tar: command failed: pristine-gz --no-verbose --no-debug --no-keep gengz /tmp/user/1000/pristine-tar.mgnaMjnwlk/wrapper /tmp/user/1000/pristine-tar.EV5aXIPWfn/planetfilter_0.7.4.orig.tar.gz.tmp
pristine-tar: failed to generate tarball
So I decided to throw away what I had, re-import the tarball and try again.
This time, I got a different pristine-tar error:
$ gbp buildpackage
gbp:error: Pristine-tar couldn't checkout "planetfilter_0.7.4.orig.tar.gz": xdelta3: target window checksum mismatch: XD3_INVALID_INPUT
xdelta3: normally this indicates that the source file is incorrect
xdelta3: please verify the source file with sha1sum or equivalent
xdelta3 decode failed! at /usr/share/perl5/Pristine/Tar/DeltaTools.pm line 56.
pristine-tar: command failed: pristine-gz --no-verbose --no-debug --no-keep gengz /tmp/user/1000/pristine-tar.mgnaMjnwlk/wrapper /tmp/user/1000/pristine-tar.EV5aXIPWfn/planetfilter_0.7.4.orig.tar.gz.tmp
pristine-tar: failed to generate tarball
I filed bug 871938
for this.
As a work-around, I simply symlinked the upstream tarball I already had
and then built the package using the tarball directly instead of the
upstream git branch:
ln -s ~/deve/remote/planetfilter/dist/planetfilter-0.7.4.tar.gz ../planetfilter_0.7.4.orig.tar.gz
gbp buildpackage --git-tarball-dir=..
Given that only the upstream and master branches are signed, the
.delta file
on the
pristine-tar branch
could be fixed at any time in the future by committing a new .delta file
once pristine-tar gets fixed. This therefore seems like a reasonable
work-around.
git-buildpackage doesn't import the upstream tarball signature
The second problem I ran into was a missing upstream signature after
building the package with
git-buildpackage:
$ lintian -i planetfilter_0.7.4-1_amd64.changes
E: planetfilter changes: orig-tarball-missing-upstream-signature planetfilter_0.7.4.orig.tar.gz
N:
N: The packaging includes an upstream signing key but the corresponding
N: .asc signature for one or more source tarballs are not included in your
N: .changes file.
N:
N: Severity: important, Certainty: certain
N:
N: Check: changes-file, Type: changes
N:
This problem (and the lintian error I suspect) is fairly new and hasn't been
solved yet.
So until gbp import-orig gets proper support for upstream signatures, my
work-around was to copy the upstream signature in the export-dir output
directory (which I set in ~/.gbp.conf) so that it can be picked up by the
final stages of gbp buildpackage:
ln -s ~/deve/remote/planetfilter/dist/planetfilter-0.7.4.tar.gz.asc ../build-area/planetfilter_0.7.4.orig.tar.gz.asc
If there's a better way to do this, please feel free to leave a comment
(authentication not required)!
$ gbp buildpackage
gbp:error: Pristine-tar couldn't checkout "planetfilter_0.7.4.orig.tar.gz": xdelta3: target window checksum mismatch: XD3_INVALID_INPUT
xdelta3: normally this indicates that the source file is incorrect
xdelta3: please verify the source file with sha1sum or equivalent
xdelta3 decode failed! at /usr/share/perl5/Pristine/Tar/DeltaTools.pm line 56.
pristine-tar: command failed: pristine-gz --no-verbose --no-debug --no-keep gengz /tmp/user/1000/pristine-tar.mgnaMjnwlk/wrapper /tmp/user/1000/pristine-tar.EV5aXIPWfn/planetfilter_0.7.4.orig.tar.gz.tmp
pristine-tar: failed to generate tarball
$ gbp buildpackage
gbp:error: Pristine-tar couldn't checkout "planetfilter_0.7.4.orig.tar.gz": xdelta3: target window checksum mismatch: XD3_INVALID_INPUT
xdelta3: normally this indicates that the source file is incorrect
xdelta3: please verify the source file with sha1sum or equivalent
xdelta3 decode failed! at /usr/share/perl5/Pristine/Tar/DeltaTools.pm line 56.
pristine-tar: command failed: pristine-gz --no-verbose --no-debug --no-keep gengz /tmp/user/1000/pristine-tar.mgnaMjnwlk/wrapper /tmp/user/1000/pristine-tar.EV5aXIPWfn/planetfilter_0.7.4.orig.tar.gz.tmp
pristine-tar: failed to generate tarball
ln -s ~/deve/remote/planetfilter/dist/planetfilter-0.7.4.tar.gz ../planetfilter_0.7.4.orig.tar.gz
gbp buildpackage --git-tarball-dir=..
git-buildpackage:
$ lintian -i planetfilter_0.7.4-1_amd64.changes
E: planetfilter changes: orig-tarball-missing-upstream-signature planetfilter_0.7.4.orig.tar.gz
N:
N: The packaging includes an upstream signing key but the corresponding
N: .asc signature for one or more source tarballs are not included in your
N: .changes file.
N:
N: Severity: important, Certainty: certain
N:
N: Check: changes-file, Type: changes
N:
This problem (and the lintian error I suspect) is fairly new and hasn't been
solved yet.
So until gbp import-orig gets proper support for upstream signatures, my
work-around was to copy the upstream signature in the export-dir output
directory (which I set in ~/.gbp.conf) so that it can be picked up by the
final stages of gbp buildpackage:
ln -s ~/deve/remote/planetfilter/dist/planetfilter-0.7.4.tar.gz.asc ../build-area/planetfilter_0.7.4.orig.tar.gz.asc
If there's a better way to do this, please feel free to leave a comment
(authentication not required)!


reading up on rapidjson.
I was reading the docs for
My monthly report covers a large part of what I have been doing in the free software world. I write it for
A few years ago, I started to write software which primary
audience is going to be blind musicians. I did a small
I have been working with STM32 chips on-and-off for at least eight, possibly
closer to nine years. About as long as ST have been touting them around. I
love the STM32, and have done much with them in C. But, as my
I am still far from being a professor, but I recently got a glimps of what awaits you in that role
I realised recently that my laptop isn't set up to send
After fours years, I will again make it to
Welcome to gambaru.de. Here is my monthly report that covers what I have been doing for Debian. If you re interested in Java, Games and LTS topics, this might be interesting for you.
Debian Games
Ok, what is happening here? First you can choose a source and binary package name. Then disable the tests and don t run javadoc to create the documentation. This will simplify things a little. Tests and javadoc settings can be added later. Choose the version you want to package and then you can basically follow the default recommendations and confirm them by hitting the Enter key. Throughout the project we choose to transform the upstream version with the symbolic debian version. Remember that Java/Maven is version-centric. This will ensure that our Maven dependencies are always satisfied later and we can simply upgrade our Maven libraries and don t have to change the versions by hand in various pom.xml files; maven-debian-helper will automatically transform them for us to debian . Enable all modules. If you choose not to, you can select each module individually. Note that later on some of the required build-dependencies cannot be found because they are either not installed (libjmagick6-java) or they cannot be found in Debian s Maven repository under /usr/share/maven-repo. You can fix this by entering a substitution rule or, as I did in this case, you can just ignore these artifacts for now. They will be added to maven.IgnoreRules. In order to successfully compile your program you have to remove them from this file later again, create the correct substitution rule in maven.rules and add the missing build-dependencies to debian/control. For now we just want to quickly create our initial debian directory.
If everything went as planned a complete debian directory should be visible in your root directory. The only thing left is to fix the substitution rule for the Servlet API 3.1. Add libservlet3.1-java to Build-Depends and the following rule to maven.rules:
You can just use an asterisk to match any value. Every value can be substituted. This is necessary when the value of upstream s pom.xml file differs from Debian s system packages. This happens frequently for API packages which are uploaded to Maven Central multiple times under a different groupId/artifactId but provide the same features. In this case the Twelvemonkeys pom requires an older API version but Debian is already at version 3.1. Note that we require a strict version number in this case because libservlet3.1-java does not use a symbolic debian version since we provide more than one Servlet API in the archive and this measure prevents conflicts.
Thanks for reading this far. More articles about Java packaging will follow in the near future and hopefully they will clarify some terms and topics which could only be briefly mentioned in this post.


Back in November,