Bug#802284: git-buildpackage: should assemble overlay before issuing 'debian/rules' commands

Guido Günther agx at sigxcpu.org
Mon Aug 14 02:11:34 UTC 2017


Hi Ben,
On Mon, Aug 14, 2017 at 11:36:24AM +1000, Ben Finney wrote:
> Control: submitter -1 !
> Control: found -1 git-buildpackage/0.8.18
> 
> On 11-Aug-2017, Guido Günther wrote:
> 
> > […] what you can do right now is call the clean command as prebuild
> > hook since it gets the build_dir passed in as GBP_BUILD_DIR and is
> > run right before the build.
> 
> Would calling the clean as a pre-build hook prevent Git-BuildPackage
> from issuing a clean *before* building the source? Is there some
> existing hook that I should disable?
> 
> As best I can tell, there is no request for “clean” prior to exporting
> the source. Yet it happens in response to a request to build the
> source:
> 
> =====
> $ gbp --version
> gbp 0.8.18
> 
> $ gbp buildpackage --git-overlay --git-cleaner=/bin/true

If you check with --git-verbose …

> gbp:info: All Orig tarballs 'pelican_3.7.1.orig.tar.gz' found at '../tarballs'
> gbp:info: Building with (cowbuilder) for sid
> gbp:info: Extracting pelican_3.7.1.orig.tar.gz to '/home/bignose/Projects/debian/pelican/build-area/pelican-tmp'
> gbp:info: Exporting 'WC' to '/home/bignose/Projects/debian/pelican/build-area/pelican-tmp'
> gbp:info: Moving '/home/bignose/Projects/debian/pelican/build-area/pelican-tmp' to '/home/bignose/Projects/debian/pelican/build-area/pelican-3.7.1'
> Building with cowbuilder for distribution sid
> I: using cowbuilder as pbuilder
> dh clean --with python2,sphinxdoc  --buildsystem=pybuild

… one can see that this is already within cowbuilder …

>    dh_auto_clean -O--buildsystem=pybuild
> I: pybuild base:184: python2.7 setup.py clean 
> running clean
> removing '/home/bignose/Projects/debian/pelican/build-area/pelican-3.7.1/.pybuild/pythonX.Y_2.7/build' (and everything under it)
> 'build/bdist.linux-x86_64' does not exist -- can't clean it
> 'build/scripts-2.7' does not exist -- can't clean it
>    debian/rules override_dh_clean
> make[1]: Entering directory '/home/bignose/Projects/debian/pelican/build-area/pelican-3.7.1'
> dh_clean
> rm -rf pelican.egg-info build/html
> make[1]: Leaving directory '/home/bignose/Projects/debian/pelican/build-area/pelican-3.7.1'
> dpkg-source: info: using source format '3.0 (quilt)'
> dpkg-source: error: unwanted binary file: debian/theme-substitute/notmyidea/static/images/forkme_left_white_ffffff.png
> dpkg-source: error: unwanted binary file: debian/theme-substitute/notmyidea/static/images/forkme_right_red_aa0000.png
> dpkg-source: error: detected 2 unwanted binary files (add them in debian/source/include-binaries to allow their inclusion).
> gbp:error: 'git-pbuilder' failed: it exited with 29
> =====
> 
> So the problem is that a “clean” is occurring implicitly before
> building the source, even when I specify ‘--git-cleaner=/bin/true’.

… so that's not a issue of gbp itself, it's cowbuilder triggering a
clean in the current directory. You can work around this by passing
"-nc":

    $ gbp buildpackage --git-overlay --git-cleaner=/bin/true -nc

(unfortunately cowbuilder does not understand pbuilder's
--pdebuild-internal).

This is not perfect since the -nc also affects the build _inside_ the
chroot. I'm cc'ing the cowbuilder maintainers since maybe they have
better idea. What we'd want to have for cowbuilder is:

    - do no clean outside the chroot (since we know we're clean when
      using --export-dir and --overlay)
    - but do as before inside the chroot

I couldn't find a bug on that. cowbuilder maintainers, does this sound
sane? People (including me) seem to get confused by this form time to
time and it would be great if we could find a solution. What about
adding a '--no-initial-clean'?
   
> > (I'll have a closer look how to reshuffle things after fixing 2 other
> > bugs I'm currently on, sorry to keep you waiting).
> 
> Thank you for working on this!

I would not call this "working on it" yet but at least I've shuffled
around some code there recently to make this simpler.

Thanks for keeping this alive!
Cheers,
 -- Guido

> 
> -- 
>  \          “When we call others dogmatic, what we really object to is |
>   `\   their holding dogmas that are different from our own.” —Charles |
> _o__)                                                           Issawi |
> Ben Finney <ben at benfinney.id.au>





More information about the Pbuilder-maint mailing list