<div dir="ltr">dpkg-buildpackage calls debian/rules (see <a href="https://people.debian.org/~stapelberg//2016/11/25/build-tools.html">https://people.debian.org/~stapelberg//2016/11/25/build-tools.html</a>), which calls debhelper, including Debian::Debhelper::Buildsystem::golang(3pm), which uses the DH_GOPKG variable (either from the environment, i.e. via debian/rules, or from debian/control).<div><br></div><div>In other words: the value you specify in debian/control unfortunately cannot be made available in debian/rules.</div><div><br></div><div>If you need to use DH_GOPKG in debian/rules, I recommend to define it both in debian/control and in debian/rules as well.</div><div><br></div><div>This issue should be fixed with a documentation update. Could you supply a patch please? You know best at which point the wording becomes clear enough :). Thanks!<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 5, 2018 at 4:55 AM, Arnaud Rebillout <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">Package: dh-golang<br>
Version: 1.34<br>
Severity: normal<br>
<br>
Dear Maintainer,<br>
<br>
According to `man dh-golang`:<br>
<br>
  "DH_GOPKG" (string) contains the Go package name which this Debian<br>
  package is building.<br>
<br>
  "DH_GOPKG" is automatically set to the value of the first import path<br>
  of the "XS-Go-Import-Path" "debian/control" field, which can contain<br>
  several comma-separated import paths.<br>
<br>
However, I tried to use this variable in the debian/rules file, in<br>
targets such as `override_dh_auto_test` and `override_dh_auto_build`,<br>
and this variable is empty.<br>
<br>
I added some debug to dh-golang, and I clearly see the code from<br>
`_set_dh_gopkg` being executed, and the variable is set there. So it<br>
looks like the environment in `debian/rules` is unrelated to the<br>
environment that is set by dh-golang.<br>
<br>
If it's expected, then maybe the man page needs a little rewording. If<br>
it's not expected, then it's a bug?<br>
<br>
Regards,<br>
<br>
  Arnaud<br>
<br>
-- System Information:<br>
Debian Release: buster/sid<br>
  APT prefers testing<br>
  APT policy: (500, 'testing')<br>
Architecture: amd64 (x86_64)<br>
<br>
Kernel: Linux 4.13.0-1-amd64 (SMP w/8 CPU cores)<br>
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)<br>
Shell: /bin/sh linked to /bin/dash<br>
Init: systemd (via /run/systemd/system)<br>
LSM: AppArmor: enabled<br>
<br>
Versions of packages dh-golang depends on:<br>
ii  debhelper  Â  Â 11.1.5<br>
ii  dpkg  Â  Â  Â  Â  1.19.0.5<br>
ii  libdpkg-perl  1.19.0.5<br>
ii  perl  Â  Â  Â  Â  5.26.1-5<br>
<br>
dh-golang recommends no packages.<br>
<br>
dh-golang suggests no packages.<br>
<br>
-- no debconf information<br>
<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></div>