<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 13, 2018 at 12:37 PM, Arnaud <span dir="ltr"><<a href="mailto:arnaud.rebillout@collabora.com" target="_blank">arnaud.rebillout@collabora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
Dear pkg-go maintainers,<br>
<br>
I bumped into a trouble while packaging
<a class="gmail-m_-3931367309864801734moz-txt-link-rfc2396E" href="https://github.com/containerd/typeurl" target="_blank"><https://github.com/<wbr>containerd/typeurl></a>.<br>
<br>
The library is fairly simple, however the file marshal_test.go [1]
contains this line:<br>
<br>
eventsapi <span class="gmail-m_-3931367309864801734pl-s"><span class="gmail-m_-3931367309864801734pl-pds">"</span><a href="http://github.com/containerd/containerd/api/services/events/v1" target="_blank">github.com/containerd/<wbr>containerd/api/services/<wbr>events/v1</a><span class="gmail-m_-3931367309864801734pl-pds">"<br>
<br>
This is a circulare dependency, since containerd/typeurl is a
depency of of containerd/containerd, but requires
containerd/containerd for this test.<br>
<br>
This breaks dh-make-golang with this error:<br>
<br>
2018/02/13 18:29:20 Downloading
"<a href="http://github.com/containerd/typeurl/.." target="_blank">github.com/containerd/<wbr>typeurl/..</a>."<br>
go get: 82.03 MiBpackage <a href="http://github.com/containerd/typeurl" target="_blank">github.com/containerd/typeurl</a><br>
imports <a href="http://github.com/containerd/containerd/typeurl" target="_blank">github.com/containerd/<wbr>containerd/typeurl</a>: cannot
find package "<a href="http://github.com/containerd/containerd/typeurl" target="_blank">github.com/containerd/<wbr>containerd/typeurl</a>" in any
of:<br>
/usr/lib/go-1.7/src/<a href="http://github.com/containerd/containerd/typeurl" target="_blank">github.<wbr>com/containerd/containerd/<wbr>typeurl</a>
(from $GOROOT)<br>
/tmp/dh-make-golang738896973/<wbr>src/<a href="http://github.com/containerd/containerd/typeurl" target="_blank">github.com/containerd/<wbr>containerd/typeurl</a>
(from $GOPATH)<br>
2018/02/13 18:29:44 Could not create a tarball of the upstream
source: exit status 1<br></span></span></div></blockquote><div><br></div><div>This error is actually not because of a circular dependency, but rather because the import path specified in marshal_test.go is incorrect: it reads <a href="http://github.com/containerd/containerd/typeurl">github.com/containerd/containerd/typeurl</a>, but should read <a href="http://github.com/containerd/typeurl">github.com/containerd/typeurl</a>.<br></div><div><br></div><div>You can reproduce this issue outside of our packaging infrastructure by running go get -t -u <a href="http://github.com/containerd/typeurl">github.com/containerd/typeurl</a></div><div><br></div><div>Please file an upstream issue about this.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><span class="gmail-m_-3931367309864801734pl-s"><span class="gmail-m_-3931367309864801734pl-pds">
<br>
The fact that it breaks dh-make-dolang is not the blocker here,
as I can workaround and create the packaging files manually.
However, what should I do with this `marshal_test.go` file ?
Should I exclude it from the package ? Or should I patch it ?<br></span></span></div></blockquote><div><br></div><div>I agree with tincho’s reply.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><span class="gmail-m_-3931367309864801734pl-s"><span class="gmail-m_-3931367309864801734pl-pds">
<br>
And more generally: I've noticed that a lot of go packages have
test files named `*_test.go` Is it good policy to remove them
from the package when they get in the way like this ? Or are
they needed in some way that I don't expect ?<br>
<br>
</span></span>Thanks,<br>
<br>
Arnaud<br>
<br>
[1]:
<a class="gmail-m_-3931367309864801734moz-txt-link-freetext" href="https://github.com/containerd/typeurl/blob/master/marshal_test.go" target="_blank">https://github.com/containerd/<wbr>typeurl/blob/master/marshal_<wbr>test.go</a><br>
<br>
</div>
<br>______________________________<wbr>_________________<br>
Pkg-go-maintainers mailing list<br>
<a href="mailto:Pkg-go-maintainers@lists.alioth.debian.org">Pkg-go-maintainers@lists.<wbr>alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers" rel="noreferrer" target="_blank">http://lists.alioth.debian.<wbr>org/cgi-bin/mailman/listinfo/<wbr>pkg-go-maintainers</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Best regards,<br>Michael</div>
</div></div>