(resending this to the bug report and also extending it slightly beyond the 
original version I sent to Ian)

On 04/12/17 12:30, Ian Jackson wrote:
peter green writes ("Bug#883340: dgit build accesses the internet and fails when 
offline."):
Trying to build a package with dgit build while offline results in an error 
message about api.ftp-master.debian.org There is no mention in the manpage 
section for dgit build about it accessing the internet in any way.

This is problematic for two reasons.

1. It is really annoying to be unable to work while offline.
2. Undocumented access to the internet could be considered a privacy breach.
This is, sadly, inevitable, when using `dgit build'.

The reason is as follows:

dgit build (and dgit sbuild et al) do all the preparation work needed
to do a binary upload using dgit push.  That includes generating the
.changes file.It would not be good to defer generation of the .changes
file because the user ought to be able to review everything before
invoking dgit push.
dgit push already modifies the changes file to add the dgit: header to the dsc 
and to sign everything.

The .changes file is supposed to contain changes since the last upload
to the relevant distro.  That involves knowing what that last upload
is.  dgit automates this, querying the prospective destination server
so it can know the version to pass to dpkg-genchanges's -v option.
But, if the user were doing this by hand, they would probably have to
check that themselves by hand anyway.
I expect the reality is that most developers run dpkg-buildpackage and upload 
the changes file that it spits out.  AIUI this does the right thing most of the 
time but there are some corner cases where it does not. For example if the 
version corresponding to a given changelog entry is never uploaded.

AIUI what you are saying is that dgit wants to fix up these corner cases and 
needs internet access to do so.

Is this understanding correct.

So it is not possible to fully prepare a build-for-upload offline.


OTOH, if you are not trying to build for upload, then then there is no
need for this.  Then it would be better not to use dgit build at all,
but rather to invoke dpkg-buildpackage.

Perhaps it would be useful for dgit to have a "not (yet) for upload"
build option, which generates source and binary packages, but not a
.changes file.

What do you think ?
It seems to me that "dgit build" or "dgit build-source" does two categories of 
things on top of what dpkg-buildpackage does.

1. It does stuff related to building from a dgit git tree, including checking the working 
tree matches the head (and erroring out if not), checking the quilt series matches head 
(and fixing it if not) and excluding the ".git" directory from the resulting 
source packages. Maybe there is other stuff too.
2. It tries to ensure a "more correct" changes file at the cost of requiring 
Internet access.

1 is the reason for using dgit build in the first place.

2 was unexpected to me and I would expect to a lot of users.


TBH I would like to know what you were trying to do when you
encountered this problem
I was working on testing my autoforwardporter on a machine that happened to be 
offline.
  - and which docs you read that led you to
choose this approach.
I think it was a mixture of reading the dgit manpage and trial and error.

I would like to improve the docs.


In the meantime, a workaround would be to pass a -v option to dgit.
Then it would have no need to talk to an archive server to find this
information; and there is no other information in a build that comes
from off the local machine.
Thanks.

Specifically from re-reading the manpage and from testing it seems passing -v_ 
is the solution to making dgit build work offline but I wouldn't have found it 
if I hadn't been explicitly looking for the -v option.

So it seems that the main things that are needed are.

1. Extend the "dgit build" section of the man page to clarify that dgit build 
accesses the Internet by default and how to override that for offline use..
2. Improve the error message so that when people do try to run "dgit build" 
while offline they know how to get around it.

Reply via email to