[pkg-go] dh-golang : DH_GOLANG_INSTALL_EXTRA_EXTENSIONS option
Michael Hudson-Doyle
michael.hudson at canonical.com
Thu Jul 30 20:03:18 UTC 2015
On 30 July 2015 at 23:23, Michael Stapelberg <stapelberg at debian.org> wrote:
> I think the go tools do not cover files that are referenced by test code,
> e.g.:
>
> func TestFoo(t *testing.T) {
> f, err := os.Open("my_test_resource.txt")
> if err != nil {
> t.Fatalf("Could not open file: %v", err)
> }
> // …
> }
>
> Did I miss something?
No indeed -- it would be an improvement on just collecting .go files,
but not a total solution.
Cheers,
mwh
> On Thu, Jul 30, 2015 at 2:41 AM, Michael Hudson-Doyle
> <michael.hudson at canonical.com> wrote:
>>
>> I guess you could ask go by invoking 'go list -json ./...' and looking
>> for the various *Files fields. The imports/deps calculations won't
>> work of course because the point of the copy is to get files to where
>> they _do_ work, but that just means that there are DepsErrors fields
>> in the json -- the command still completes and gives the needed
>> information afaics.
>>
>> Cheers,
>> mwh
>>
>> On 30 July 2015 at 19:10, Michael Stapelberg <stapelberg at debian.org>
>> wrote:
>> > Instead of adding this via a new setting, why not make dh-golang install
>> > these files by default?
>> >
>> > I think installing everything one can legitimately call program source
>> > code
>> > is fair game. The tricky part is identifying files which are necessary
>> > for
>> > test cases.
>> >
>> > The reason why dh-golang doesn’t just install all files is because that
>> > might generate lintian warnings about extra LICENSE files, extra README
>> > files not being marked as docs, random non-executable shell scripts,
>> > etc.
>> >
>> > That said, I’m not very happy with the current need to specify the
>> > install_all option in many cases, and any improvements over that (using
>> > more
>> > introspection? using a blacklist instead of a whitelist?) are very
>> > welcome.
>> >
>> > On Wed, Jul 29, 2015 at 10:53 PM, Alexandre Viau
>> > <alexandre at alexandreviau.net> wrote:
>> >>
>> >> Hello,
>> >>
>> >> This is new dh-golang feature should allow to include more files to the
>> >> install in an easier way. It should be useful, for example, with cgo
>> >> projects.
>> >>
>> >> DH_GOLANG_INSTALL_EXTRA_EXTENSIONS := .cgo,.h,.c
>> >>
>> >> Will include all files with .cgo, .h and .c extensions.
>> >>
>> >> I have had this issue (not just with cgo projects) a couple times last
>> >> week so I thought this would be useful.
>> >>
>> >> I have never done perl before, feel free to comment on the code.
>> >>
>> >> --
>> >> Alexandre Viau
>> >> alexandre at alexandreviau.net
>> >>
>> >> _______________________________________________
>> >> Pkg-go-maintainers mailing list
>> >> Pkg-go-maintainers at lists.alioth.debian.org
>> >>
>> >> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers
>> >
>> >
>> >
>> >
>> > --
>> > Best regards,
>> > Michael
>> >
>> > _______________________________________________
>> > Pkg-go-maintainers mailing list
>> > Pkg-go-maintainers at lists.alioth.debian.org
>> >
>> > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers
>
>
>
>
> --
> Best regards,
> Michael
More information about the Pkg-go-maintainers
mailing list