Your message dated Sat, 20 Sep 2025 04:36:43 +0000
with message-id <[email protected]>
and subject line Bug#1100436: fixed in golang-1.25 1.25.0-2
has caused the Debian Bug report #1100436,
regarding golang-1.24 FTCBFS: multiple reasons
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1100436: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100436
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: golang-1.24
Version: 1.24.1-1
Tags: patch
User: [email protected]
Usertags: ftcbfs
I looked into cross building the go compiler itself. The packaging
already did a lot of the heavy lifting. Thank you!
The immediate failure is running the host's go executable. As go is a
multi-target compiler, we really want the build's go here. That can be
achieved by appending :native to the relevant Build-Depends.
>From then, the build goes quite far. The failure is from dh_strip
complaining about amd64 executables in various locations. One aspect to
this is that we should tell the build process about the C and C++
compilers as it uses different variable meanings from Debian:
CC -> CC_FOR_TARGET
CC_FOR_BUILD -> CC
I propose adding those variables to debian/helpers/goenv.sh.
Unfortunately, that doesn't make dh_strip happy. In a cross build,
./bin contains the build's go tools and a directory ${GOOS}_${GOARCH}
containing the host's go tools. This is different from native builds and
requires some branching to install them.
Likewise, pkg/tool now contains tools for both the build and the host
architecture, but the binary package should only contain the host's
tools.
For correctly installing those files in both native and cross builds,
the packaging needs the GOOS and GOARCH variables, which is why I
suggest moving their computation from debian/helpers/goenv.sh into
debian/rules. Admittedly, it is slightly uglier in make than in shell.
And with all of these changes, we can readily cross build the
golang-1.24 package. What do you think?
I suppose that this likewise applies to other go versions and that the
patch is transferrable there.
If you think that the toolchain freeze is too close to apply this patch,
please defer it until after trixie is released. Cross building go
packages in Debian requires more changes and cross building the go
compiler probably is not the most exciting exercise.
Helmut
diff --minimal -Nru golang-1.24-1.24.1/debian/changelog
golang-1.24-1.24.1/debian/changelog
--- golang-1.24-1.24.1/debian/changelog 2025-03-05 00:58:41.000000000 +0100
+++ golang-1.24-1.24.1/debian/changelog 2025-03-13 11:38:16.000000000 +0100
@@ -1,3 +1,15 @@
+golang-1.24 (1.24.1-1.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Fix FTCBFS: (Closes: #-1)
+ + Build-Depend on a native go compiler.
+ + Move GO{,HOST}{ARCH,OS} from debian/helpers/goenv.sh to debian/rules
+ for use by debhelper.
+ + Export C{C,XX}{,_FOR_TARGET} as required by make.bash.
+ + Install the host's (target in go-speak) tools and compiler only.
+
+ -- Helmut Grohne <[email protected]> Thu, 13 Mar 2025 11:38:16 +0100
+
golang-1.24 (1.24.1-1) unstable; urgency=medium
* Team upload
diff --minimal -Nru golang-1.24-1.24.1/debian/control
golang-1.24-1.24.1/debian/control
--- golang-1.24-1.24.1/debian/control 2025-03-05 00:58:41.000000000 +0100
+++ golang-1.24-1.24.1/debian/control 2025-03-13 11:38:16.000000000 +0100
@@ -13,7 +13,7 @@
Priority: optional
Build-Depends: debhelper-compat (= 13),
binutils-gold [arm64],
- golang-1.24-go | golang-1.23-go | golang-1.22-go,
+ golang-1.24-go:native | golang-1.23-go:native |
golang-1.22-go:native,
netbase
Standards-Version: 4.6.2
Vcs-Browser: https://salsa.debian.org/go-team/compiler/golang/tree/golang-1.24
diff --minimal -Nru golang-1.24-1.24.1/debian/golang-X.Y-go.dirs
golang-1.24-1.24.1/debian/golang-X.Y-go.dirs
--- golang-1.24-1.24.1/debian/golang-X.Y-go.dirs 2025-03-05
00:58:41.000000000 +0100
+++ golang-1.24-1.24.1/debian/golang-X.Y-go.dirs 2025-03-13
11:38:16.000000000 +0100
@@ -1 +1 @@
-usr/lib/go-X.Y
+usr/lib/go-X.Y/bin
diff --minimal -Nru golang-1.24-1.24.1/debian/golang-X.Y-go.install
golang-1.24-1.24.1/debian/golang-X.Y-go.install
--- golang-1.24-1.24.1/debian/golang-X.Y-go.install 2025-03-05
00:58:41.000000000 +0100
+++ golang-1.24-1.24.1/debian/golang-X.Y-go.install 2025-03-13
11:38:16.000000000 +0100
@@ -1,5 +1,4 @@
VERSION /usr/lib/go-X.Y/
-bin /usr/lib/go-X.Y/
go.env /usr/lib/go-X.Y/
pkg/include /usr/share/go-X.Y/pkg/
-pkg/tool /usr/lib/go-X.Y/pkg/
+pkg/tool/${env:GOOS}_${env:GOARCH} /usr/lib/go-X.Y/pkg/
diff --minimal -Nru golang-1.24-1.24.1/debian/helpers/goenv.sh
golang-1.24-1.24.1/debian/helpers/goenv.sh
--- golang-1.24-1.24.1/debian/helpers/goenv.sh 2025-03-05 00:58:41.000000000
+0100
+++ golang-1.24-1.24.1/debian/helpers/goenv.sh 2025-03-13 11:38:16.000000000
+0100
@@ -1,37 +1,7 @@
#!/bin/sh
set -e
-__goos__deb_arch_os() {
- case "$1" in
- kfreebsd) echo freebsd ;;
- linux) echo "$1" ;;
- *) echo >&2 "error: unrecongized DEB_*_ARCH_OS: $1"; exit 1 ;;
- esac
-}
-
-__goarch__deb_arch_cpu() {
- case "$1" in
- amd64|arm|arm64|loong64|mips|ppc64|riscv64|s390x) echo "$1" ;;
- i386) echo 386 ;;
- mips64el) echo mips64le ;;
- mipsel) echo mipsle ;;
- ppc64el) echo ppc64le ;;
- *) echo >&2 "error: unrecongized DEB_*_ARCH_CPU: $1"; exit 1 ;;
- esac
-}
-
-# build machine
-# The machine the package is built on.
-#
-# host machine
-# The machine the package is built for.
-
-export GOHOSTOS="$(__goos__deb_arch_os "$(dpkg-architecture
-qDEB_BUILD_ARCH_OS 2>/dev/null)")"
-export GOOS="$(__goos__deb_arch_os "$(dpkg-architecture -qDEB_HOST_ARCH_OS
2>/dev/null)")"
-
-export GOHOSTARCH="$(__goarch__deb_arch_cpu "$(dpkg-architecture
-qDEB_BUILD_ARCH_CPU 2>/dev/null)")"
-export GOARCH="$(__goarch__deb_arch_cpu "$(dpkg-architecture
-qDEB_HOST_ARCH_CPU 2>/dev/null)")"
-
+# GO{,HOST}{ARCH,OS} are set in debian/rules
if [ -z "$GOHOSTOS" -o -z "$GOOS" -o -z "$GOHOSTARCH" -o -z "$GOARCH" ]; then
exit 1
fi
@@ -70,4 +40,28 @@
fi
export GOARM
+if [ "$(dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)" = "$(dpkg-architecture
-qDEB_BUILD_ARCH 2>/dev/null)" ]; then
+ : "${CC:=${CC_FOR_BUILD:-gcc}}"
+ CC_FOR_TARGET="$CC"
+ : "${CXX:=${CXX_FOR_BUILD:-g++}}"
+ CXX_FOR_TARGET="$CXX"
+else
+ if [ -z "${CC:-}" ]; then
+ CC_FOR_TARGET="$CC"
+ else
+ CC_FOR_TARGET="$(dpkg-architecture -qDEB_HOST_GNU_TYPE
2>/dev/null)-gcc"
+ fi
+ CC="${CC_FOR_BUILD:-gcc}"
+ if [ -n "${CXX:-}" ]; then
+ CXX_FOR_TARGET="$CXX"
+ else
+ CXX_FOR_TARGET="$(dpkg-architecture -qDEB_HOST_GNU_TYPE
2>/dev/null)-g++"
+ fi
+ CXX="${CXX_FOR_BUILD:-g++}"
+fi
+export CC
+export CC_FOR_TARGET
+export CXX
+export CXX_FOR_TARGET
+
eval "$@"
diff --minimal -Nru golang-1.24-1.24.1/debian/rules
golang-1.24-1.24.1/debian/rules
--- golang-1.24-1.24.1/debian/rules 2025-03-05 00:58:41.000000000 +0100
+++ golang-1.24-1.24.1/debian/rules 2025-03-13 11:38:16.000000000 +0100
@@ -20,6 +20,18 @@
# Go 1.12 needs a build cache, otherwise the build fails.
export GOCACHE := $(GOPATH)/gocache
+__goos__deb_arch_os = $(or $(filter $(1),linux),$(if $(filter
$(1),kfreebsd),freebsd,$(error unrecognized DEB_*_ARCH_OS: $(1))))
+__goarch__deb_arch_cpu_map_i386 = 386
+__goarch__deb_arch_cpu_map_mips64el = mips64le
+__goarch__deb_arch_cpu_map_mipsel = mipsle
+__goarch__deb_arch_cpu_map_ppc64el = ppc64le
+__goarch__deb_arch_cpu = $(or $(filter $(1),amd64 arm arm64 loong64 mips ppc64
riscv64 s390x),$(__goarch__deb_arch_cpu_map_$(1)),$(error unrecognized
DEB_*_ARCH_CPU: $(1)))
+
+export GOHOSTOS := $(call __goos__deb_arch_os,$(DEB_BUILD_ARCH_OS))
+export GOOS := $(call __goos__deb_arch_os,$(DEB_HOST_ARCH_OS))
+export GOHOSTARCH := $(call __goarch__deb_arch_cpu,$(DEB_BUILD_ARCH_CPU))
+export GOARCH := $(call __goarch__deb_arch_cpu,$(DEB_HOST_ARCH_CPU))
+
# source files generated during building.
# especially zbootstrap.go has different defaultGOARM values on armhf and
armel,
# since the value is set from debian/helpers/goenv.sh
@@ -74,6 +86,7 @@
dh_compress -Xusr/share/doc/golang-$(GOVER)-doc/html
execute_after_dh_install-arch:
+ cp bin/$(if $(filter
$(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)),,$(GOOS)_$(GOARCH)/)*
debian/golang-$(GOVER)-go/usr/lib/go-$(GOVER)/bin/
cp --parent -v $(GENERATED_FILES)
debian/golang-$(GOVER)-go/usr/share/go-$(GOVER)/
execute_after_dh_install-indep:
--- End Message ---
--- Begin Message ---
Source: golang-1.25
Source-Version: 1.25.0-2
Done: Tianon Gravi <[email protected]>
We believe that the bug you reported is fixed in the latest version of
golang-1.25, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Tianon Gravi <[email protected]> (supplier of updated golang-1.25 package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Fri, 19 Sep 2025 21:11:23 -0700
Source: golang-1.25
Architecture: source
Version: 1.25.0-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Go Compiler Team <[email protected]>
Changed-By: Tianon Gravi <[email protected]>
Closes: 1100436 1115478
Changes:
golang-1.25 (1.25.0-2) unstable; urgency=medium
.
[ Tianon Gravi ]
* Add support for cross-building natively (Closes: #1100436)
- https://salsa.debian.org/go-team/compiler/golang/-/merge_requests/21
* Clean up debian/helpers/goenv.sh (notably no more go1.16 support)
.
[ Bo YU ]
* Skip failing TSAN tests on riscv64 (Closes: #1115478)
Checksums-Sha1:
fba65a676ba5d17c96dc4795a7b47bdc976902d9 2923 golang-1.25_1.25.0-2.dsc
5a08af8588058bd6a2461042b6d417c5ff3557fc 43876
golang-1.25_1.25.0-2.debian.tar.xz
ffdbb17e3a2f73bcfb69ec13e4a6d19540c35db8 5486
golang-1.25_1.25.0-2_source.buildinfo
Checksums-Sha256:
88f02f7fb4940736b2f9f76133ea8e8e318942ce09f7803f453839d56db7bf7a 2923
golang-1.25_1.25.0-2.dsc
ebb50be9ff5c82741454857283570084c3a04edd7ad345f85daf399fc87ca916 43876
golang-1.25_1.25.0-2.debian.tar.xz
9c654eb243a040afe50064725cc4fa93d7fceb5dac2574f312575f6d5aee7a96 5486
golang-1.25_1.25.0-2_source.buildinfo
Files:
75bef2aa922f660196f12025e799f5fb 2923 golang optional golang-1.25_1.25.0-2.dsc
297d5d1c3f2054b9742002c1f16c29f3 43876 golang optional
golang-1.25_1.25.0-2.debian.tar.xz
f6f8d8646b687bc11e14849dce428fd6 5486 golang optional
golang-1.25_1.25.0-2_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQJGBAEBCgAwFiEEtC9oGQB/APiONk/UA2qcJb81fdQFAmjOKcsSHHRpYW5vbkBk
ZWJpYW4ub3JnAAoJEANqnCW/NX3UA8wQALx0DEHDTBMRsp0ju0WE5ZUYFWZUYDRS
Iuip9ozhL2eJhC+c+YEfo91u/QI4FLDDP5UFXqVV22ZvZXWKHdz4ibxU7ibBgCem
eWZ4rO9Huv/jRQHpfHa2VleqPv6l0Oamlqo/ZYVNev5mYIrpBsTaSG1xbpbPWVzI
LvAoGffGPkvWz69Lluorq1KlGmo09ne6KExgVP/wzoKLki1jRHkOru/dQUqT4HrU
uE2ALZjpFNlGB1i6IZv1kx+dd8Tw5yNHj9MuNuS28zQLZ0IlH7oe5tTMSpe/ifYS
1p5HWJgKXYUu+fKS4mMje6/10QHiAt3vHVoZ+4gSXeNwPfO5z+TVePBwoKex4Abc
NaDkqB6oHTWFXd1hQAbAs94Axc1mZw0Da+R8dt6ryGJARcnhiJ/YDVmCC0ICWnqm
fZxmE5FTda6576C0dxw77AQt1mrTfzlxcwFiD8qwZt+H9OmC0fwrA44A8oYWtAl/
6tCyDrw7aL1x0S1S01zKdkkAzxZPLnizUcEmW18gj0jjDAD78pRf9VLb2WLEu0V9
CCKaNsIoRQY/c5pRjm3727J8MBb2Z+qG2x3LzwaUcdKDwSxEcImFsZEPJLtUZwRk
H6DqEKKdolV89Jxtpga1P0P38sSJYX4dCul4NhwLehUJdShhposdR7ZSrROqhlXY
eVB2caOLIu7C
=fwZ3
-----END PGP SIGNATURE-----
pgpv5InTPUx0i.pgp
Description: PGP signature
--- End Message ---