On Wed, 4 Oct 2017 at 18:23 Jonathan Nieder <jrnie...@gmail.com> wrote:

> Hi,
>
> Nicholas Brown wrote:
>
> > /usr/share/perl5/Dpkg/Source/Package/V3/Git.pm regularly calls out to
> git using
> > "system('git',...." yet libdpkg-perl does not Require or even Recommend
> that
> > Git is installed.
> >
> > This makes using dpkg-source with the 3.0 (git) format fail, for example
> in a
> > automatically build chroot created to build a source package in this
> format, as
> > git is missing to extract the package.
> > It can be worked around by explcitly installing git in the build chroot.
> >
> > I'd guess the that libdpkg-perl should either Require or Recommend that
> git is
> > installed.
> >
> > [    5s] now finalizing build dir...
> > [    7s] dpkg-source: warning: extracting unsigned source package
> > (/usr/src/packages/test-package_1.0.0.dsc)
> > [    7s] dpkg-source: info: extracting test-package in
> /usr/src/packages/BUILD
> > [    7s] dpkg-source: info: cloning test-package_1.0.0.git
> > [    7s] Can't exec "git": No such file or directory at
> > /usr/share/perl5/Dpkg/Source/Package/V3/Git.pm line 246.
> > [    7s] dpkg-source: error: git bundle failed with unknown exit code -1
>
> Interesting.
>
> Since lidpkg-perl is a library that provides lots of useful
> functionality without git, I think I would prefer that this be a
> Suggests, not a Recommends.  I see that libdpkg-perl already has
> "Recommends: xz-utils", so I may be fighting against the tide.  (Maybe
> the Debian archive not accepting "3.0 (git)" packages changes the
> calculus somehow.  Not sure.)
>

I think treating git like xz-utils is reasonable.
Making it Recommends means that in default cases it will be installed, and
git format supported, not surprising users, but still allowing a minimal
install to be created is explicitly required.


> What tool do you use to generate a build chroot?  If nothing else, we
> should look into improving that to install the packages needed to
> extract a source package.
>

I use 'osc' which invokes 'obs-build'

https://github.com/openSUSE/osc
https://github.com/openSUSE/obs-build

These are Suse tools that support many package formats and distributions.
(they are available in Debian too:https://packages.debian.org/source/sid/osc
https://packages.debian.org/source/sid/obs-build)

obs-build creates a chroot build environment using debootstrap with buildd
variant:
https://github.com/openSUSE/obs-build/blob/master/build-recipe-debootstrap

I work around the issue by passing the --extra-pkgs="git" option to the
'osc' command.

I can investigate enhancing osc/obs-build to inspect the source package for
the source format and automatically add git the chroot if detects 3.0 (git)
format.


> I also wonder if it's possible to improve the error message when git
> is not installed.
>

Yes, I think the error message could probably be improved.
Infact I think putting an early check in the perl module to check that git
available would be good thing to do.

Thanks,
Nick


> Thoughts?
> Jonathan
>

Reply via email to