Re: [pkg-go] RFC: Enhancements to dh-golang

2016-05-15 Thread Paul Tagliamonte
Thank you!
On May 15, 2016 8:30 PM, "Martín Ferrari"  wrote:

> On 15/05/16 19:21, Michael Stapelberg wrote:
> > I’m not opposed, please feel free to push your changes.
>
> So I have just uploaded 1.17:
>
>
> dh-golang (1.17) unstable; urgency=medium
>
>   * Team upload.
>   * Move dh-golang to the pkg-go team repository.
> - Update Maintainer and Uploaders.
> - Update Vcs-* fields.
>   * Update Standards-Version with no changes.
>   * Export DH_GOLANG_INSTALL_EXTRA with a list of space-separated paths to
> copy to the build dir, for tests and other files not automatically
> installed.
>   * Add --no-source and --no-binaries options to install target.
>   * Display a debug message when copying files to the build tree.
>
>  -- Martín Ferrari   Mon, 16 May 2016 01:08:06 +0100
>
>
> --
> Martín Ferrari (Tincho)
>
> ___
> Pkg-go-maintainers mailing list
> Pkg-go-maintainers@lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers
>
___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Re: [pkg-go] RFC: Enhancements to dh-golang

2016-05-15 Thread Martín Ferrari
On 15/05/16 19:21, Michael Stapelberg wrote:
> I’m not opposed, please feel free to push your changes.

So I have just uploaded 1.17:


dh-golang (1.17) unstable; urgency=medium

  * Team upload.
  * Move dh-golang to the pkg-go team repository.
- Update Maintainer and Uploaders.
- Update Vcs-* fields.
  * Update Standards-Version with no changes.
  * Export DH_GOLANG_INSTALL_EXTRA with a list of space-separated paths to
copy to the build dir, for tests and other files not automatically
installed.
  * Add --no-source and --no-binaries options to install target.
  * Display a debug message when copying files to the build tree.

 -- Martín Ferrari   Mon, 16 May 2016 01:08:06 +0100


-- 
Martín Ferrari (Tincho)

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers


Re: [pkg-go] RFC: Enhancements to dh-golang

2016-05-15 Thread Michael Stapelberg
I’m not opposed, please feel free to push your changes.

On Sat, May 14, 2016 at 3:50 PM, Martín Ferrari  wrote:

> Since nobody has voiced strong concerns about this, I will merge this
> change later today or tomorrow and upload.
>
> I wanted to wait for Michael S. to chime in, but I guess he's not
> strongly opposed either :-)
>
>
> On 08/05/16 05:31, Martín Ferrari wrote:
> > Hi all,
> >
> > I have just pushed a branch (tincho_extensions) to dh-golang,
> > implementing a few changes that I believe are beneficial for golang
> > packaging. If there are no objections, I would like to merge this to
> > master and release 0.17.
> >
> >
> > * Export DH_GOLANG_INSTALL_EXTRA with a list of space-separated paths to
> > copy to the build dir, for tests and other files not automatically
> > installed.
> >
> > This means we can stop using the INSTALL_ALL=1+rm combo, which I think
> > is pretty awkward. Instead, one would do (real example from the
> > prometheus package):
> >
> > export DH_GOLANG_INSTALL_EXTRA := retrieval/discovery/fixtures \
> > storage/local/fixtures config/testdata promql/testdata \
> > retrieval/testdata
> >
> >
> > * Add --no-source and --no-binaries options to install target.
> >
> > This avoids the need to remove debian/prometheus/usr/share/gocode, and
> > would go a long way to fix #814690, and I think is generally a good
> > idea, to make it simple to split packages in binary and sources. Again,
> > a real (and tested) example from prometheus:
> >
> > override_dh_auto_install:
> > dh_auto_install -O--buildsystem=golang -- --no-source
> >
> >
> > * Display a debug message when copying files to the build tree.
> >
> > A minor change, I think that when DH_VERBOSE is set, all the copy and
> > symlink operations during preparation of the source tree should be
> > printed. It looks like this:
> >
> >   Copy retrieval/testdata/server.cer ->
> > build/src/github.com/prometheus/prometheus/retrieval/testdata/server.cer
> >   Copy retrieval/testdata/client.cer ->
> > build/src/github.com/prometheus/prometheus/retrieval/testdata/client.cer
> >   Symlink /usr/share/gocode/src/code.google.com -> build/src/
> code.google.com
> >   Symlink /usr/share/gocode/src/github.com/asaskevich ->
> > build/src/github.com/asaskevich
> >
> >
> > Thoughts?
> >
>
>
> --
> Martín Ferrari (Tincho)
>



-- 
Best regards,
Michael
___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Re: [pkg-go] RFC: Enhancements to dh-golang

2016-05-14 Thread Martín Ferrari
Since nobody has voiced strong concerns about this, I will merge this
change later today or tomorrow and upload.

I wanted to wait for Michael S. to chime in, but I guess he's not
strongly opposed either :-)


On 08/05/16 05:31, Martín Ferrari wrote:
> Hi all,
> 
> I have just pushed a branch (tincho_extensions) to dh-golang,
> implementing a few changes that I believe are beneficial for golang
> packaging. If there are no objections, I would like to merge this to
> master and release 0.17.
> 
> 
> * Export DH_GOLANG_INSTALL_EXTRA with a list of space-separated paths to
> copy to the build dir, for tests and other files not automatically
> installed.
> 
> This means we can stop using the INSTALL_ALL=1+rm combo, which I think
> is pretty awkward. Instead, one would do (real example from the
> prometheus package):
> 
> export DH_GOLANG_INSTALL_EXTRA := retrieval/discovery/fixtures \
> storage/local/fixtures config/testdata promql/testdata \
> retrieval/testdata
> 
> 
> * Add --no-source and --no-binaries options to install target.
> 
> This avoids the need to remove debian/prometheus/usr/share/gocode, and
> would go a long way to fix #814690, and I think is generally a good
> idea, to make it simple to split packages in binary and sources. Again,
> a real (and tested) example from prometheus:
> 
> override_dh_auto_install:
> dh_auto_install -O--buildsystem=golang -- --no-source
> 
> 
> * Display a debug message when copying files to the build tree.
> 
> A minor change, I think that when DH_VERBOSE is set, all the copy and
> symlink operations during preparation of the source tree should be
> printed. It looks like this:
> 
>   Copy retrieval/testdata/server.cer ->
> build/src/github.com/prometheus/prometheus/retrieval/testdata/server.cer
>   Copy retrieval/testdata/client.cer ->
> build/src/github.com/prometheus/prometheus/retrieval/testdata/client.cer
>   Symlink /usr/share/gocode/src/code.google.com -> 
> build/src/code.google.com
>   Symlink /usr/share/gocode/src/github.com/asaskevich ->
> build/src/github.com/asaskevich
> 
> 
> Thoughts?
> 


-- 
Martín Ferrari (Tincho)

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Re: [pkg-go] RFC: Enhancements to dh-golang

2016-05-12 Thread Michael Hudson-Doyle
On 13 May 2016 at 00:52, Martín Ferrari  wrote:
> On 11/05/16 03:57, Michael Hudson-Doyle wrote:
>
>> +} elsif ($File::Find::name =~ m%/testdata/%) {
>> +# testdata directories are always copied
>
> Ah yes, but that is cheating in my opinion :) AFAIK, the 'testdata'
> directory is not special in go, and many packages have other names
> (fixtures is a common one). I think it is a bad idea to add this.

'testdata' is a little special to the Go tool: it ignores such
directories entirely, and it does seem to be pretty commonly used in
the random subset of packages I have in my GOPATH today and

https://codesearch.debian.net/perpackage-results/testdata%20path%3Adebian%2Frules%20/2/page_0

certainly shows lots of lines that could be removed if this was added
(in fact, maybe they would now cause errors or misbehave, which is
perhaps an argument against this change without some compat stuff...)

Cheers,
mwh

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Re: [pkg-go] RFC: Enhancements to dh-golang

2016-05-12 Thread Martín Ferrari
On 11/05/16 03:57, Michael Hudson-Doyle wrote:

> +} elsif ($File::Find::name =~ m%/testdata/%) {
> +# testdata directories are always copied

Ah yes, but that is cheating in my opinion :) AFAIK, the 'testdata'
directory is not special in go, and many packages have other names
(fixtures is a common one). I think it is a bad idea to add this.




-- 
Martín Ferrari (Tincho)

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Re: [pkg-go] RFC: Enhancements to dh-golang

2016-05-10 Thread Michael Hudson-Doyle
On 9 May 2016 at 13:23, Martín Ferrari  wrote:
> On 09/05/16 02:12, Michael Hudson-Doyle wrote:
>
>> (parenthetically, as I think I said on IRC, dh-golang should just copy
>> testdata by default)
>
> I agree, but so far I don't know how to detect that programatically.

This seems to do the trick for me:

diff --git a/lib/Debian/Debhelper/Buildsystem/golang.pm
b/lib/Debian/Debhelper/Buildsystem/golang.pm
index 4d73d99..4fbf1d7 100644
--- a/lib/Debian/Debhelper/Buildsystem/golang.pm
+++ b/lib/Debian/Debhelper/Buildsystem/golang.pm
@@ -103,6 +103,8 @@ sub configure {
 my $name = substr($File::Find::name, 2);
 if ($install_all) {
 # All files will be installed
+} elsif ($File::Find::name =~ m%/testdata/%) {
+# testdata directories are always copied
 } else {
 my $dot = rindex($name, ".");
 return if $dot == -1;

(only lightly tested, but tested)

>>> override_dh_auto_install:
>>> dh_auto_install -O--buildsystem=golang -- --no-source
>>
>> Like Dmitry, I guess I'm only +0 on this.
>
> I see the point... I don't think it adds clutter, but I'd remove it if
> people are not too happy about it.

Certainly the implementation seems simple enough. Don't much care either way!

>> Hmmm. Can see the point, but it would be a lt of output in some
>> cases. DH_VERBOSE doesn't really support levels of verbosity does it?
>
> It is a lot of output, but currently, you have no way to see what is
> actually being included in the build, which I think is a problem. I
> thought of this when adding the first feature, because I had no way to
> easily see what was going on!
>
> About verbosity levels, not really. You have: normal, verbose, and quiet
> mode.
>
> Personally, I think this is valuable output, and one can just use
> DH_VERBOSE=0

I think I agree the information is worth the log spam. So +1 on this
for me -- we can always find some other way to moderate it later if we
feel the need...

Cheers,
mwh

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Re: [pkg-go] RFC: Enhancements to dh-golang

2016-05-08 Thread Martín Ferrari
On 09/05/16 02:12, Michael Hudson-Doyle wrote:

> (parenthetically, as I think I said on IRC, dh-golang should just copy
> testdata by default)

I agree, but so far I don't know how to detect that programatically.


>> override_dh_auto_install:
>> dh_auto_install -O--buildsystem=golang -- --no-source
> 
> Like Dmitry, I guess I'm only +0 on this.

I see the point... I don't think it adds clutter, but I'd remove it if
people are not too happy about it.

> Hmmm. Can see the point, but it would be a lt of output in some
> cases. DH_VERBOSE doesn't really support levels of verbosity does it?

It is a lot of output, but currently, you have no way to see what is
actually being included in the build, which I think is a problem. I
thought of this when adding the first feature, because I had no way to
easily see what was going on!

About verbosity levels, not really. You have: normal, verbose, and quiet
mode.

Personally, I think this is valuable output, and one can just use
DH_VERBOSE=0

-- 
Martín Ferrari (Tincho)

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Re: [pkg-go] RFC: Enhancements to dh-golang

2016-05-08 Thread Michael Hudson-Doyle
On 8 May 2016 at 16:31, Martín Ferrari  wrote:
> Hi all,
>
> I have just pushed a branch (tincho_extensions) to dh-golang,
> implementing a few changes that I believe are beneficial for golang
> packaging. If there are no objections, I would like to merge this to
> master and release 0.17.
>
>
> * Export DH_GOLANG_INSTALL_EXTRA with a list of space-separated paths to
> copy to the build dir, for tests and other files not automatically
> installed.
>
> This means we can stop using the INSTALL_ALL=1+rm combo, which I think
> is pretty awkward. Instead, one would do (real example from the
> prometheus package):
>
> export DH_GOLANG_INSTALL_EXTRA := retrieval/discovery/fixtures \
> storage/local/fixtures config/testdata promql/testdata \
> retrieval/testdata

+1

(parenthetically, as I think I said on IRC, dh-golang should just copy
testdata by default)

> * Add --no-source and --no-binaries options to install target.
>
> This avoids the need to remove debian/prometheus/usr/share/gocode, and
> would go a long way to fix #814690, and I think is generally a good
> idea, to make it simple to split packages in binary and sources. Again,
> a real (and tested) example from prometheus:
>
> override_dh_auto_install:
> dh_auto_install -O--buildsystem=golang -- --no-source

Like Dmitry, I guess I'm only +0 on this.

> * Display a debug message when copying files to the build tree.
>
> A minor change, I think that when DH_VERBOSE is set, all the copy and
> symlink operations during preparation of the source tree should be
> printed. It looks like this:
>
> Copy retrieval/testdata/server.cer ->
> build/src/github.com/prometheus/prometheus/retrieval/testdata/server.cer
> Copy retrieval/testdata/client.cer ->
> build/src/github.com/prometheus/prometheus/retrieval/testdata/client.cer
> Symlink /usr/share/gocode/src/code.google.com -> 
> build/src/code.google.com
> Symlink /usr/share/gocode/src/github.com/asaskevich ->
> build/src/github.com/asaskevich

Hmmm. Can see the point, but it would be a lt of output in some
cases. DH_VERBOSE doesn't really support levels of verbosity does it?

Cheers,
mwh

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Re: [pkg-go] RFC: Enhancements to dh-golang

2016-05-07 Thread Dmitry Smirnov
On Sunday, 8 May 2016 5:31:08 AM AEST Martín Ferrari wrote:
> Thoughts?

Awesome. :)

I think --no-source and --no-binaries options are unnecessary.
It is easy and more portable to do

:rules:
override_dh_auto_install:
dh_auto_install --destdir=debian/tmp


and put either "usr/bin" or "usr/share/gocode/src" to "install" file for 
binary and source packages respectively. "override_dh_auto_install" is only 
needed in case of single binary package. It is the default for multiple 
binary packages.

Thanks.

-- 
Regards,
 Dmitry Smirnov.

---

The man who does not do his own thinking is a slave, and is a traitor
to himself and to his fellow-men.
 -- Robert G. Ingersoll, "The Liberty
of Man, Woman and Child" 1877


signature.asc
Description: This is a digitally signed message part.
___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

[pkg-go] RFC: Enhancements to dh-golang

2016-05-07 Thread Martín Ferrari
Hi all,

I have just pushed a branch (tincho_extensions) to dh-golang,
implementing a few changes that I believe are beneficial for golang
packaging. If there are no objections, I would like to merge this to
master and release 0.17.


* Export DH_GOLANG_INSTALL_EXTRA with a list of space-separated paths to
copy to the build dir, for tests and other files not automatically
installed.

This means we can stop using the INSTALL_ALL=1+rm combo, which I think
is pretty awkward. Instead, one would do (real example from the
prometheus package):

export DH_GOLANG_INSTALL_EXTRA := retrieval/discovery/fixtures \
storage/local/fixtures config/testdata promql/testdata \
retrieval/testdata


* Add --no-source and --no-binaries options to install target.

This avoids the need to remove debian/prometheus/usr/share/gocode, and
would go a long way to fix #814690, and I think is generally a good
idea, to make it simple to split packages in binary and sources. Again,
a real (and tested) example from prometheus:

override_dh_auto_install:
dh_auto_install -O--buildsystem=golang -- --no-source


* Display a debug message when copying files to the build tree.

A minor change, I think that when DH_VERBOSE is set, all the copy and
symlink operations during preparation of the source tree should be
printed. It looks like this:

Copy retrieval/testdata/server.cer ->
build/src/github.com/prometheus/prometheus/retrieval/testdata/server.cer
Copy retrieval/testdata/client.cer ->
build/src/github.com/prometheus/prometheus/retrieval/testdata/client.cer
Symlink /usr/share/gocode/src/code.google.com -> 
build/src/code.google.com
Symlink /usr/share/gocode/src/github.com/asaskevich ->
build/src/github.com/asaskevich


Thoughts?

-- 
Martín Ferrari (Tincho)

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers