Source: dh-golang Version: 1.43 Tags: patch User: debian-cr...@lists.debian.org Usertags: ftcbfs Control: affects -1 + src:golang-github-docker-docker-credential-helpers
Hi, After marking dh-golang Multi-Arch: foreign, a number of golang-* packages have become bd-satisfiable. One of them is golang-github-docker-docker-credential-helpers. The immediate failure is failing to run go as the host architecture go is installed. I'm not yet set on this part. I'd like to gain a bit more experience with go before raising it with possible solutions on the list. A temporary workaround is adding :native. Once you do that, you run into the actual problem: | # pkg-config --cflags -- libsecret-1 | Package libsecret-1 was not found in the pkg-config search path. | Perhaps you should add the directory containing `libsecret-1.pc' | to the PKG_CONFIG_PATH environment variable | No package 'libsecret-1' found | pkg-config: exit status 1 | github.com/docker/docker-credential-helpers/pass/cmd | dh_auto_build: cd obj-powerpc64le-linux-gnu && go install -gcflags=all=\"-trimpath=/<<PKGBUILDDIR>>/obj-powerpc64le-linux-gnu/src\" -asmflags=all=\"-trimpath=/<<PKGBUILDDIR>>/obj-powerpc64le-linux-gnu/src\" -v -p 8 github.com/docker/docker-credential-helpers/client github.com/docker/docker-credential-helpers/credentials github.com/docker/docker-credential-helpers/osxkeychain github.com/docker/docker-credential-helpers/pass github.com/docker/docker-credential-helpers/pass/cmd github.com/docker/docker-credential-helpers/secretservice github.com/docker/docker-credential-helpers/secretservice/cmd returned exit code 2 | make[1]: *** [debian/rules:9: override_dh_auto_build] Error 255 | make[1]: Leaving directory '/<<PKGBUILDDIR>>' | make: *** [debian/rules:6: build-arch] Error 2 | dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit status 2 What happens here is that we have a go file with a syntax "#cgo pkg-config libsecret-1". This is apparently interpreted by go to run pkg-config and it uses the build architecture one ... unless one exports PKG_CONFIG. So, the golang build system should also pass PKG_CONFIG. My previous patch already made it pass CC. Doing so does not fix golang-github-docker-docker-credential-helpers. It does advance the build a little. More issues reside there, but this one is well understood now. Please consider applying the attached patch. Helmut
diff --minimal -Nru dh-golang-1.43/debian/changelog dh-golang-1.43+nmu1/debian/changelog --- dh-golang-1.43/debian/changelog 2019-11-22 23:14:21.000000000 +0100 +++ dh-golang-1.43+nmu1/debian/changelog 2019-11-25 18:48:53.000000000 +0100 @@ -1,3 +1,10 @@ +dh-golang (1.43+nmu1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Also export PKG_CONFIG for cross compiling. (Closes: #-1) + + -- Helmut Grohne <hel...@subdivi.de> Mon, 25 Nov 2019 18:48:53 +0100 + dh-golang (1.43) unstable; urgency=medium [ Helmut Grohne ] diff --minimal -Nru dh-golang-1.43/lib/Debian/Debhelper/Buildsystem/golang.pm dh-golang-1.43+nmu1/lib/Debian/Debhelper/Buildsystem/golang.pm --- dh-golang-1.43/lib/Debian/Debhelper/Buildsystem/golang.pm 2019-11-22 19:50:36.000000000 +0100 +++ dh-golang-1.43+nmu1/lib/Debian/Debhelper/Buildsystem/golang.pm 2019-11-25 18:48:49.000000000 +0100 @@ -344,6 +344,9 @@ unless ($ENV{CC}) { $ENV{CC} = dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-gcc"; } + unless ($ENV{PKG_CONFIG}) { + $ENV{PKG_CONFIG} = dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-pkg-config"; + } $ENV{CGO_ENABLED} = "1";