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

Martín Ferrari tincho at tincho.org
Sun May 8 04:31:08 UTC 2016

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

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 \

* 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:

        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 ->
	Copy 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 ->


Martín Ferrari (Tincho)

More information about the Pkg-go-maintainers mailing list