Merge ~sergiodj/ubuntu/+source/golang-1.16:fix-ftbfs-i386-bionic into ubuntu/+source/golang-1.16:ubuntu/bionic-devel

Proposed by Sergio Durigan Junior
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: 8dc37ba7021962f0bbe7dbffa9411ee1fa26fd88
Proposed branch: ~sergiodj/ubuntu/+source/golang-1.16:fix-ftbfs-i386-bionic
Merge into: ubuntu/+source/golang-1.16:ubuntu/bionic-devel
Diff against target: 64 lines (+20/-3)
4 files modified
debian/changelog (+9/-0)
debian/control (+2/-1)
debian/control.in (+2/-1)
debian/helpers/goenv.sh (+7/-1)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Lucas Kanashiro (community) Approve
Canonical Server packageset reviewers Pending
Canonical Server Reporter Pending
Review via email: mp+427997@code.launchpad.net

Description of the change

This MP fixes the current FTBFS that's affecting golang-1.16 on Bionic/i386.

The problem is that golang-1.16 doesn't support using "GO386=387" anymore when bootstrapping, which is what the Debian/Ubuntu golang always use when building (see the file d/helpers/goenv.sh and the Debian bug http://bugs.debian.org/753160 for more details). Another option would be to set "GO386=softfloat", but that's not supported by any of the available golang versions we currently have on Bionic.

The change I'm proposing here is that we only set "GO386=387" when *not* building for i386, and leave the variable empty otherwise. This works, but has a drawback: when "GO386" is not set and we're building for i386, this means that the generated go binary will use SSE2 instructions, which ultimately means that they will be unable to run on old CPUs (e.g., CPUs older than Intel Pentium 4 and AMD Opteron/Athlon 64). I am not sure whether it'd make sense to add an explict Depends on "sse2-support [any-i386]" for this package, but I decided to do so anyway.

There's a PPA with the proposed change here:

https://launchpad.net/~sergiodj/+archive/ubuntu/golang-1.16-i386/+packages

The package doesn't have any dep8 tests. In order to test it, I'd recommend firing up a Bionic/i386 LXD container and installing it there.

To post a comment you must log in.
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the patch Sergio, appreciated!

Your solution (not setting GO386 variable in i386) seems to be the right way to go, and it indeed fixed the FTBFS as we can see in your PPA. I was thinking about the sse2-support runtime dependency, it would be better if we could keep the needed changes minimal (not needing that), but we could also hit the unlikely case where users would try to install it in a machine which does not support SSE2 instruction set.

I launched a container and installed the package, ran a simple script and it worked well.

I +1 the changes. Please, when uploading the package also include the previous changelog entry in the changes file.

review: Approve
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Ah, maybe you could also add a reference to the LP bug in debian/helpers/goenv.sh changes, not only the upstream bug. It will make easier to understand all the context behind that in the future.

Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: sergiodj, lucaskanashiro
Uploaders: sergiodj, lucaskanashiro
MP auto-approved

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Monday, August 08 2022, Lucas Kanashiro wrote:

> Ah, maybe you could also add a reference to the LP bug in
> debian/helpers/goenv.sh changes, not only the upstream bug. It will
> make easier to understand all the context behind that in the future.

Thanks, Lucas. I've done that and uploaded the package.

$ dput golang-1.16_1.16.2-0ubuntu1~18.04.2_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/golang-1.16/golang-1.16_1.16.2-0ubuntu1~18.04.2_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/golang-1.16/golang-1.16_1.16.2-0ubuntu1~18.04.2.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading golang-1.16_1.16.2-0ubuntu1~18.04.2.dsc: done.
  Uploading golang-1.16_1.16.2-0ubuntu1~18.04.2.debian.tar.xz: done.
  Uploading golang-1.16_1.16.2-0ubuntu1~18.04.2_source.buildinfo: done.
  Uploading golang-1.16_1.16.2-0ubuntu1~18.04.2_source.changes: done.
Successfully uploaded packages.

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 5814252..3a5ef2e 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+golang-1.16 (1.16.2-0ubuntu1~18.04.2) bionic; urgency=medium
7+
8+ * d/helpers/goenv.sh: Don't set GO386 when building on i386.
9+ (LP: #1983742)
10+ * d/control{,.in}: Make golang-X.Y-go depend on sse2-support on
11+ i386.
12+
13+ -- Sergio Durigan Junior <sergio.durigan@canonical.com> Fri, 05 Aug 2022 23:26:55 -0400
14+
15 golang-1.16 (1.16.2-0ubuntu1~18.04.1) bionic; urgency=medium
16
17 * Backport to Bionic (LP: #1967425, #1960449).
18diff --git a/debian/control b/debian/control
19index 63d92e4..f42da59 100644
20--- a/debian/control
21+++ b/debian/control
22@@ -26,7 +26,8 @@ Architecture: amd64 arm64 armel armhf i386 mips mips64el mipsel ppc64 ppc64el ri
23 Depends: golang-1.16-src (>= ${source:Version}),
24 ${misc:Depends},
25 ${perl:Depends},
26- ${shlibs:Depends}
27+ ${shlibs:Depends},
28+ sse2-support [any-i386]
29 Recommends: g++, gcc, libc6-dev, pkg-config
30 Suggests: bzr | brz, ca-certificates, git, mercurial, subversion
31 Description: Go programming language compiler, linker, compiled stdlib
32diff --git a/debian/control.in b/debian/control.in
33index ad9b14c..ce9e540 100644
34--- a/debian/control.in
35+++ b/debian/control.in
36@@ -22,7 +22,8 @@ Architecture: amd64 arm64 armel armhf i386 mips mips64el mipsel ppc64 ppc64el ri
37 Depends: golang-X.Y-src (>= ${source:Version}),
38 ${misc:Depends},
39 ${perl:Depends},
40- ${shlibs:Depends}
41+ ${shlibs:Depends},
42+ sse2-support [any-i386]
43 Recommends: g++, gcc, libc6-dev, pkg-config
44 Suggests: bzr | brz, ca-certificates, git, mercurial, subversion
45 Description: Go programming language compiler, linker, compiled stdlib
46diff --git a/debian/helpers/goenv.sh b/debian/helpers/goenv.sh
47index bff8307..6b095ec 100755
48--- a/debian/helpers/goenv.sh
49+++ b/debian/helpers/goenv.sh
50@@ -41,7 +41,13 @@ fi
51 # and when users cross-compile for 386) can actually run on older CPUs (where
52 # old means e.g. an AMD Athlon XP 2400+). See http://bugs.debian.org/753160 and
53 # https://code.google.com/p/go/issues/detail?id=8152
54-export GO386=387
55+#
56+# When building for i386, we're affected by
57+# https://github.com/golang/go/issues/44500. See also
58+# https://bugs.launchpad.net/ubuntu/+source/golang-1.16/+bug/1983742.
59+if [ "$(dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)" != 'i386' ]; then
60+ export GO386=387
61+fi
62
63 unset GOARM
64 if [ "$GOARCH" = 'arm' ]; then

Subscribers

People subscribed via source and target branches