[pkg-go] Bug#903385: dh-golang: Allow the "build" dh stage to call "go build" instead of "go install"

Paride Legovini pl at ninthfloor.org
Mon Jul 9 11:15:57 BST 2018


Package: dh-golang
Version: 1.34
Severity: normal

Hi,

There is at least one case when it would be preferable to have the build
dh stage to call ’go build’ instead of ’go install’. This is when
building c-shared libraries with -buildmode=c-shared. In this case ‘go
install’ builds the shared library object, but gives it a ‘.a’ extension
and installs it in a not well defined location. This is discussed in this
upstream issue:

https://github.com/golang/go/issues/24253

The upstream indication is that "The expectation is that people will use
go build -buildmode=c-shared -o foo.so" and that using ‘go install’ "will
put the shared library in a relatively unpredictable place".

Given these facts, I think dh-golang should support a ‘go build’ mode.
One way this could be implemented is via a --build-only flag to be
passed to dh_auto_build. If there is consensus on this I can send a
patch implementing it.

This problem arose while packaging fscrypt, see in particular:

https://salsa.debian.org/go-team/packages/fscrypt/blob/d15d123eb301d50c0376a10615e472054dd3b88d/debian/rules#L36

Paride


More information about the Pkg-go-maintainers mailing list