Hi Shengjing,

Thanks for looking into this too.  I'm sorry for not recording my findings
here before going to bed, causing duplication of work...

I've already found the cause and a solution, but couldn't keep my eyes open
to finish writing debian/changelog and actually upload it about 7 hours ago.

On Mon, Feb 24, 2020, 08:52 Shengjing Zhu <z...@debian.org> wrote:

> On Mon, Feb 24, 2020 at 2:33 PM Anthony Fok <f...@debian.org> wrote:
> [...]
> > +       cd obj-x86_64-linux-gnu && go test -vet=off -v -p 4
> > +can't load package: package .: no Go files in
> >
> /home/foka/debian/go-team/gopkg/golang-gopkg-gorethink-gorethink.v3/obj-x86_64-linux-gnu
> > +dh_auto_test: error: cd obj-x86_64-linux-gnu && go test -vet=off -v
> > -p 4 returned exit code 1
> > +make[1]: *** [debian/rules:17: override_dh_auto_test] Error 25
> >
> > And I wonder why other Go packages are apparently not affected by this.
> >
> > I will continue to investigate and hopefully come up with a fix soon.
>
> I take a look too... but it's too weird...
>
> If you apply this to dh-golang,
>
> diff --git a/lib/Debian/Debhelper/Buildsystem/golang.pm
> b/lib/Debian/Debhelper/Buildsystem/golang.pm
> index c856f7d..2df380d 100644
> --- a/lib/Debian/Debhelper/Buildsystem/golang.pm
> +++ b/lib/Debian/Debhelper/Buildsystem/golang.pm
> @@ -589,6 +589,7 @@ sub test {
>      # Go 1.10 started calling “go vet” when running “go test”. This
> breaks tests
>      # of many not-yet-fixed upstream packages, so we disable it for the
> time
>      # being.
> +    my ($minor) = (qx(go version) =~ /go version go1\.([0-9]+)/);
>      if (_go1_has_minor(10)) {
>          $this->doit_in_builddir("go", "test", "-vet=off", "-v", @_,
> get_targets());
>      } else {
>
> This package can be built.
> But how could this line affect the result.
>

It turns out to be what I suspected to be a Perl bug but turns out to be a
"feature", see the story here: https://github.com/Perl/perl5/issues/17577

So, your recent _go1_has_minor() sub is perfectly fine, and thanks to you,
you have uncovered a corner case that dh-golang didn't cover properly, i.e.
maintainers adding leading space in DH_GOLANG_* variables...

More info in the debian/changelog.  :-)  Bye for now!

Cheers,
Anthony

Reply via email to