Package: dh-golang
Version: 1.63build1
Severity: wishlist
X-Debbugs-Cc: [email protected], [email protected]
User: [email protected]
Usertags: amd64
Dear Maintainer,
[Goal]
Enable microarchitecture variant support (like amd64v3) for Go packages built
in the archive.
[Problem]
Currently, if a build is triggered with DEB_HOST_ARCH_VARIANT=amd64v3,
dpkg-buildflags correctly translates this for bundled C/C++ code.
However, the native Go compiler ignores this and continues to build at the
baseline amd64 level.
To actually utilize these optimizations, Go (since 1.18) requires the GOAMD64
environment variable to be set.
[Proposed Solution]
We need dh-golang to act as the bridge. dh-golang should read the
DEB_HOST_ARCH_VARIANT environment variable provided by dpkg and explicitly
export GOAMD64.
For example, if $ENV{DEB_HOST_ARCH} is amd64 and $ENV{DEB_HOST_ARCH_VARIANT} is
amd64v3, dh-golang should extract the v3 and set GOAMD64=v3 in the build
environment (provided the package maintainer hasn't already explicitly
overridden it).
I am currently putting together a patch for
lib/Debian/Debhelper/Buildsystem/golang.pm to implement this and will attach it
to this bug report shortly.
-- System Information:
Debian Release: forky/sid
APT prefers resolute-updates
APT policy: (500, 'resolute-updates'), (500, 'resolute-security'), (500,
'resolute'), (100, 'resolute-backports')
Architecture: amd64 (x86_64)
Kernel: Linux 7.0.0-38-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages dh-golang depends on:
ii debhelper 13.31ubuntu1
ii libdpkg-perl 1.23.7ubuntu1
ii perl 5.40.1-7ubuntu0.3
dh-golang recommends no packages.
dh-golang suggests no packages.
-- no debconf information