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
diff --git a/debian/changelog b/debian/changelog
index 5814252..3a5ef2e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
1golang-1.16 (1.16.2-0ubuntu1~18.04.2) bionic; urgency=medium
2
3 * d/helpers/goenv.sh: Don't set GO386 when building on i386.
4 (LP: #1983742)
5 * d/control{,.in}: Make golang-X.Y-go depend on sse2-support on
6 i386.
7
8 -- Sergio Durigan Junior <sergio.durigan@canonical.com> Fri, 05 Aug 2022 23:26:55 -0400
9
1golang-1.16 (1.16.2-0ubuntu1~18.04.1) bionic; urgency=medium10golang-1.16 (1.16.2-0ubuntu1~18.04.1) bionic; urgency=medium
211
3 * Backport to Bionic (LP: #1967425, #1960449).12 * Backport to Bionic (LP: #1967425, #1960449).
diff --git a/debian/control b/debian/control
index 63d92e4..f42da59 100644
--- a/debian/control
+++ b/debian/control
@@ -26,7 +26,8 @@ Architecture: amd64 arm64 armel armhf i386 mips mips64el mipsel ppc64 ppc64el ri
26Depends: golang-1.16-src (>= ${source:Version}),26Depends: golang-1.16-src (>= ${source:Version}),
27 ${misc:Depends},27 ${misc:Depends},
28 ${perl:Depends},28 ${perl:Depends},
29 ${shlibs:Depends}29 ${shlibs:Depends},
30 sse2-support [any-i386]
30Recommends: g++, gcc, libc6-dev, pkg-config31Recommends: g++, gcc, libc6-dev, pkg-config
31Suggests: bzr | brz, ca-certificates, git, mercurial, subversion32Suggests: bzr | brz, ca-certificates, git, mercurial, subversion
32Description: Go programming language compiler, linker, compiled stdlib33Description: Go programming language compiler, linker, compiled stdlib
diff --git a/debian/control.in b/debian/control.in
index ad9b14c..ce9e540 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -22,7 +22,8 @@ Architecture: amd64 arm64 armel armhf i386 mips mips64el mipsel ppc64 ppc64el ri
22Depends: golang-X.Y-src (>= ${source:Version}),22Depends: golang-X.Y-src (>= ${source:Version}),
23 ${misc:Depends},23 ${misc:Depends},
24 ${perl:Depends},24 ${perl:Depends},
25 ${shlibs:Depends}25 ${shlibs:Depends},
26 sse2-support [any-i386]
26Recommends: g++, gcc, libc6-dev, pkg-config27Recommends: g++, gcc, libc6-dev, pkg-config
27Suggests: bzr | brz, ca-certificates, git, mercurial, subversion28Suggests: bzr | brz, ca-certificates, git, mercurial, subversion
28Description: Go programming language compiler, linker, compiled stdlib29Description: Go programming language compiler, linker, compiled stdlib
diff --git a/debian/helpers/goenv.sh b/debian/helpers/goenv.sh
index bff8307..6b095ec 100755
--- a/debian/helpers/goenv.sh
+++ b/debian/helpers/goenv.sh
@@ -41,7 +41,13 @@ fi
41# and when users cross-compile for 386) can actually run on older CPUs (where41# and when users cross-compile for 386) can actually run on older CPUs (where
42# old means e.g. an AMD Athlon XP 2400+). See http://bugs.debian.org/753160 and42# old means e.g. an AMD Athlon XP 2400+). See http://bugs.debian.org/753160 and
43# https://code.google.com/p/go/issues/detail?id=815243# https://code.google.com/p/go/issues/detail?id=8152
44export GO386=38744#
45# When building for i386, we're affected by
46# https://github.com/golang/go/issues/44500. See also
47# https://bugs.launchpad.net/ubuntu/+source/golang-1.16/+bug/1983742.
48if [ "$(dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)" != 'i386' ]; then
49 export GO386=387
50fi
4551
46unset GOARM52unset GOARM
47if [ "$GOARCH" = 'arm' ]; then53if [ "$GOARCH" = 'arm' ]; then

Subscribers

People subscribed via source and target branches