#1043335 dgit-user(7) should note where dgit build is inappropriate (e.g. CI)

#1043335#5
Date:
2023-08-09 09:29:21 UTC
From:
To:
Package: dgit
Version: 10.1
Severity: normal
X-Debbugs-Cc: mvernon@wikimedia.org, matthew@debian.org

Hi,

I want to build packages from a dgit tree in CI; I spent some time
arranging for e.g. git deborig to work so that I could do:

git-deborig
mk-build-deps
dgit -wg build

And you pointed out that, in fact, I'd be better just using
dpkg-buildpackage -uc -b

In particular, that avoids the need to produce a source package at
all, which in many cases is desirable (in a gitish workflow, they're
not useful). dgit-user(7) does include runes to produce a
source-package-for-sbuild (under "Using sbuild") alongside a note that
this source package should not otherwise be used (and a reference to
#868527).

In fact, while a DD always wants to use some flavour of dgit
build/sbuild/whatever (since a DD will be uploading a source or binary
package), for non-DD-users who don't care about source packages but
just want binaries-from-git, they don't want dgit build at all (since
that will make a source package), but rather dpkg-buildpackage[0].

dgit-user(7) should note this prominently. A bonus point might be to
refer to dcmd(1), since CI often has requirements about where build
artifacts go (in particular, gitlab won't take artifacts from
out-of-tree, so build artifacts will need moving from .., which dcmd
helps with). In bookworm-and-later dpkg-buildpackage has --changes-file.

[this bug report is a summary of an IRC discussion]

Thanks,

Matthew

[0] the result of which may well be a lot of rubbish inside the git
working tree, but that is already discussed in dgit-user(7)

#1043335#10
Date:
2023-08-09 10:17:57 UTC
From:
To:
Matthew Vernon writes ("Bug#1043335: dgit-user(7) should note where dgit build is inappropriate (e.g. CI)"):

Also this should probably be mentioned somehow in the `dgit build`
options in dgit(1).

Thanks,
Ian.

#1043335#15
Date:
2023-08-10 12:13:06 UTC
From:
To:
Hello,

What I like to tell people is that dgit is pretty much only for when
what you want to do will involve .dscs.  No .dscs, no need for dgit.

I think that the above distinction in terms of whether source packages
are required is more informative than this distinction.  How about
something like:

    As a general rule, you only need to invoke dgit when what you want
    to do involves generating or unpacking .dsc files.  And if you're
    not actually performing an upload to a Debian-style archive, the
    only case you need a .dsc is likely to be 'dgit clone'.

(I don't think the fact that sbuild's input is a source package is a
problem here, but possibly that should be worked in too.)

#1043335#20
Date:
2023-08-21 14:56:29 UTC
From:
To:
Hello,

No, I mean in those cases too -- those are cases where you have to deal
with source packages, because those are what the archive mirrors have.