On 19-Oct-2015, Guido Günther wrote:

> On Mon, Oct 19, 2015 at 12:51:08PM +1100, Ben Finney wrote:
> > The ‘gbp buildpackage’ command, for a package in “overlay” mode,
> > should not assume any of the ‘debian/rules’ commands will work in
> > the absence of the upstream source. That includes ‘clean’.
> > 
> > Instead, before issuing the ‘debian/rules clean’ command, the
> > overlay needs to be assembled: get the upstream source for the
> > package, then overlay the Debian packaging files onto it. Only
> > after that can ‘debian/rules clean’ be expected to work in the
> > exported tree.
> 
> I somehow agree here although I don't think the clean command makes much
> sense in the overlay case

For comparison, the ‘bzr-buildpackage’ and ‘svn-buildpackage’ tools
both construct the overlay (they call it “merge with upstream”), and
then call ‘debian/rules clean’.

I think ‘bzr-buildpackage’, at least, uses ‘dpkg-buildpackage’ and
‘dpkg-source’, which call ‘debian/rules clean’ on the resulting source
tree.

    $ bzr-buildpackage --source
    Building using working tree
    Building package in merge mode
    Looking for a way to retrieve the upstream tarball
    Upstream tarball already exists in build directory, using that
    Building the package in 
/home/bignose/Projects/debian/python-adventure/bzr/build-area/python-adventure-1.3,
 using debuild -S
     dpkg-buildpackage -rfakeroot -d -us -uc -S
    dpkg-buildpackage: source package python-adventure
    dpkg-buildpackage: source version 1.3-1
    dpkg-buildpackage: source distribution UNRELEASED
    dpkg-buildpackage: source changed by Ben Finney <ben+deb...@benfinney.id.au>
     dpkg-source --before-build python-adventure-1.3
     fakeroot debian/rules clean
    dh clean --with python3 --buildsystem=pybuild
       dh_testdir -O--buildsystem=pybuild
       debian/rules override_dh_auto_clean
    make[1]: Entering directory 
'/home/bignose/Projects/debian/python-adventure/bzr/build-area/python-adventure-1.3'
    dh_auto_clean
    […]

This is done so that the ‘debian/rules clean’ target can perform any
cleaning of the source tree needed before build. This ensures the
build is repeatable.

> so just setting the cleaner to /bin/true works around this and maybe
> we should just skip it in overlay mode altogether?

I would expect ‘git-buildpackage’ should as closely as feasible mirror
the overlay behaviour of the original ‘svn-buildpackage’, and later
‘bzr-buildpackage’ and ‘hg-buildpackage’.

That includes, AFAICT, constructing the overlaid source tree, then
calling ‘debian/rules clean’ (maybe using ‘dpkg-source’ to do it)
inside the resulting source tree, before continuing the build.

-- 
 \     “For every complex problem, there is a solution that is simple, |
  `\                               neat, and wrong.” —Henry L. Mencken |
_o__)                                                                  |
Ben Finney <b...@benfinney.id.au>

Attachment: signature.asc
Description: PGP signature

Reply via email to