#1112033 delve build fails for ppc64le and riscv64

Package:
delve
Source:
delve
Description:
debugger for the Go programming language
Submitter:
tshah
Date:
2025-09-02 12:59:03 UTC
Severity:
normal
#1112033#5
Date:
2025-08-25 12:02:46 UTC
From:
To:
The package fails to build on ppc64le and riscv64. See
https://buildd.debian.org/status/architecture.php?a=ppc64el&suite=sid

Able to reproduce the issue while building the package on pp64el and
checked the  build logs from pp64el. The issue seems to be dh_auto_build
being used twice in debian/rules. I am checking more on this.

#1112033#10
Date:
2025-08-28 20:08:24 UTC
From:
To:
Hello
While debugging the build failure on ppc64le, I found that the main
issue behind the build failure error was because of 2 seperate calls to
dh_autobuild in debian/rules of delve package. The first one (generic
was causing this issue because of no tags been passed). As a temporary
workaround for testing, I commented that and the build was able to move
forward without the error.

Proposed fix:

I am thinking to add the build command based on the arch - condition to
avoid these errors in rules file.


But, further during the build, I got one another below error in
dh_auto_test,

ok github.com/go-delve/delve/service/test    121.628s
FAIL
dh_auto_test: error: cd obj-powerpc64le-linux-gnu && go test -vet=off -v
-p 8 -tags exp.linuxppc64le,exp.linuxriscv64 
github.com/go-delve/delve/cmd/dlv github.com/go-delve/delve/cmd/dlv/cmds
github.com/go-delve/delve/cmd/dlv/cmds/helphelpers
github.com/go-delve/delve/pkg/astutil
github.com/go-delve/delve/pkg/config github.com/go-delve/delve/pkg/dwarf
github.com/go-delve/delve/pkg/dwarf/dwarfbuilder
github.com/go-delve/delve/pkg/dwarf/frame
github.com/go-delve/delve/pkg/dwarf/godwarf
github.com/go-delve/delve/pkg/dwarf/leb128
github.com/go-delve/delve/pkg/dwarf/line
github.com/go-delve/delve/pkg/dwarf/loclist
github.com/go-delve/delve/pkg/dwarf/op
github.com/go-delve/delve/pkg/dwarf/reader
github.com/go-delve/delve/pkg/dwarf/regnum
github.com/go-delve/delve/pkg/elfwriter
github.com/go-delve/delve/pkg/gobuild
github.com/go-delve/delve/pkg/goversion
github.com/go-delve/delve/pkg/internal/gosym
github.com/go-delve/delve/pkg/locspec
github.com/go-delve/delve/pkg/logflags
github.com/go-delve/delve/pkg/proc
github.com/go-delve/delve/pkg/proc/amd64util
github.com/go-delve/delve/pkg/proc/core
github.com/go-delve/delve/pkg/proc/core/minidump
github.com/go-delve/delve/pkg/proc/debuginfod
github.com/go-delve/delve/pkg/proc/evalop
github.com/go-delve/delve/pkg/proc/fbsdutil
github.com/go-delve/delve/pkg/proc/gdbserial
github.com/go-delve/delve/pkg/proc/internal/ebpf
github.com/go-delve/delve/pkg/proc/linutil
github.com/go-delve/delve/pkg/proc/macutil
github.com/go-delve/delve/pkg/proc/native
github.com/go-delve/delve/pkg/proc/test
github.com/go-delve/delve/pkg/proc/winutil
github.com/go-delve/delve/pkg/terminal
github.com/go-delve/delve/pkg/terminal/colorize
github.com/go-delve/delve/pkg/terminal/starbind
github.com/go-delve/delve/pkg/version github.com/go-delve/delve/service
github.com/go-delve/delve/service/api
github.com/go-delve/delve/service/dap
github.com/go-delve/delve/service/dap/daptest
github.com/go-delve/delve/service/debugger
github.com/go-delve/delve/service/internal/sameuser
github.com/go-delve/delve/service/rpc2
github.com/go-delve/delve/service/rpccommon
github.com/go-delve/delve/service/test returned exit code 1
make[1]: *** [debian/rules:23: override_dh_auto_test] Error 25
make[1]: Leaving directory '/home/debian/delve-test/delve-1.24.0'
make: *** [debian/rules:9: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit
status 2
debuild: fatal error at line 1185:
dpkg-buildpackage -us -uc -ui -b failed

I suspect it was because there were some tests which are just for amd64
and it was failing due to a ppc64le arch. For that,  I have created the
below patch.
--- delve-1.24.0.orig/pkg/proc/core/core_test.go +++ delve-1.24.0/pkg/proc/core/core_test.go @@ -249,6 +249,9 @@ func logRegisters(t *testing.T, regs pro  }  func TestCore(t *testing.T) { +    if runtime.GOARCH != "amd64" { +        t.Skip("TestCore only supported on amd64") +    }      if runtime.GOOS != "linux" || runtime.GOARCH == "386" {          t.Skip("unsupported")      } @@ -409,6 +412,9 @@ func TestCoreFpRegisters(t *testing.T) {  }  func TestCoreWithEmptyString(t *testing.T) { +    if runtime.GOARCH != "amd64" { +        t.Skip("TestCore only supported on amd64") +    }      if runtime.GOOS != "linux" || runtime.GOARCH == "386" {          t.Skip("unsupported")      } Further, I got one more issue in the dh_auto_install stage because of multiple package names within the same folder, so it throws this error. obj-powerpc64le-linux-gnu/src/github.com/go-delve/delve/service/debugger/debugger.go:31:2: found packages native (dump_linux.go) and your_linux_architecture_is_not_supported_by_delve (support_sentinel_linux.go) in /build/reproducible-path/delve-1.24.0/obj-powerpc64le-linux-gnu/src/github.com/go-delve/delve/pkg/proc/nativedh_golang: error: go list -f '{{ range .Deps }}{{.}} {{ end }}' returned exit code 1 make: *** [debian/rules:10: binary] Error 25 dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2 I tried to check and make some alterations in the support_sentinel_linux.go file but no success. Its strange even though it has proper conditions , this file is getting created. So, For that, I have thought of a workaround to remove this file manually in configure stage in rules file. override_dh_auto_configure:     if [ "$(DEB_HOST_ARCH)" = "ppc64el" ]; then \         rm -f pkg/proc/native/support_sentinel_linux.go ; \     fi     dh_auto_configure Please let me know your reviews and thoughts on this.
#1112033#15
Date:
2025-08-28 21:34:56 UTC
From:
To:
Hello,

El jue, 28 ago 2025, 22:08, tshah <tshah@linux.ibm.com> escribió:
This is strange, I am not sure why 2 separate dh_autobuild calls should be
needed.
I do wonder if the first dh_autobuild call can be removed for all arches
and keep package building.
This is worth opening an issue upstream.
I suggest to document the issue upstream and add a comment stating this is
a workaround and add a pointer to the upstream issue.
Thanks very much for your work on this.

Regards

#1112033#20
Date:
2025-08-29 08:55:11 UTC
From:
To:
I tried to check that way firstly, but due to cross compilation , I am
not able to run dh_auto_test and its failing. Although, the
dh_auto_build command was executed properly. But, I am not sure if the
tags passed in the autobuild step does something arch specific in the
background or not. So, I thought to keep it safe via conditions.

I also see the dh_auto_test command being used twice. I think we can
also change that.
Sure, I will open the issue and provide the fix as well.
ohkay, sure. I will do that and add a link to the issue here.

#1112033#25
Date:
2025-08-29 09:13:16 UTC
From:
To:
Those tests in particular should word on linux/arm64 at least too.

That's deliberate, the ppc64le is an experimental port that doesn't build
except if the exp.linuxppc64le flag is passed to go build. However we've had
a passing builder in CI for a while and I don't see any important tests
being skipped for ppc64le so you could send a PR to us to remove the flag,
you have to remove the clause that says !(ppc64le && exp.linuxppc64le) from
support_sentinel_linux.go

#1112033#30
Date:
2025-08-29 10:09:59 UTC
From:
To:
Thank you for your inputs . I think then we shall modify this to skip
the tests exclusively on ppc64le as of now. That way, this should allows
to execute tests on another archs.

yeah, correct. I understand that exp.linuxppc64le was introduced as an
experimental build tag for |ppc64le.|I’ve looked into the suggestion of
removing the |!(ppc64le && exp.linuxppc64le)| clause from
|support_sentinel_linux.go|.

That said, I’m trying to better understand the practical impact of
removing this clause. Additionally, even with this clause removed, I’m
still encountering the same build error on |ppc64le|.  Got the below
error after removing the clause. Is there any other place where the
build tag might still be enforced?

src/github.com/go-delve/delve/service/debugger/debugger.go:31:2: found
packages native (dump_linux.go) and
your_linux_architecture_is_not_supported_by_delve
(support_sentinel_linux.go) in
/home/debian/delve/delve-1.24.0/obj-powerpc64le-linux-gnu/src/github.com/go-delve/delve/pkg/proc/native
dh_auto_build: error: cd obj-powerpc64le-linux-gnu && go install
-trimpath -v -p 8 -tags exp.linuxppc64le,exp.linuxriscv64 
github.com/go-delve/delve/cmd/dlv github.com/go-delve/delve/cmd/dlv/cmds
github.com/go-delve/delve/cmd/dlv/cmds/helphelpers
github.com/go-delve/delve/pkg/astutil
github.com/go-delve/delve/pkg/config github.com/go-delve/delve/pkg/dwarf
github.com/go-delve/delve/pkg/dwarf/dwarfbuilder
github.com/go-delve/delve/pkg/dwarf/frame
github.com/go-delve/delve/pkg/dwarf/godwarf
github.com/go-delve/delve/pkg/dwarf/leb128
github.com/go-delve/delve/pkg/dwarf/line
github.com/go-delve/delve/pkg/dwarf/loclist
github.com/go-delve/delve/pkg/dwarf/op
github.com/go-delve/delve/pkg/dwarf/reader
github.com/go-delve/delve/pkg/dwarf/regnum
github.com/go-delve/delve/pkg/elfwriter
github.com/go-delve/delve/pkg/gobuild
github.com/go-delve/delve/pkg/goversion
github.com/go-delve/delve/pkg/internal/gosym
github.com/go-delve/delve/pkg/locspec
github.com/go-delve/delve/pkg/logflags
github.com/go-delve/delve/pkg/proc
github.com/go-delve/delve/pkg/proc/amd64util
github.com/go-delve/delve/pkg/proc/core
github.com/go-delve/delve/pkg/proc/core/minidump
github.com/go-delve/delve/pkg/proc/debuginfod
github.com/go-delve/delve/pkg/proc/evalop
github.com/go-delve/delve/pkg/proc/fbsdutil
github.com/go-delve/delve/pkg/proc/gdbserial
github.com/go-delve/delve/pkg/proc/internal/ebpf
github.com/go-delve/delve/pkg/proc/linutil
github.com/go-delve/delve/pkg/proc/macutil
github.com/go-delve/delve/pkg/proc/native
github.com/go-delve/delve/pkg/proc/test
github.com/go-delve/delve/pkg/proc/winutil
github.com/go-delve/delve/pkg/terminal
github.com/go-delve/delve/pkg/terminal/colorize
github.com/go-delve/delve/pkg/terminal/starbind
github.com/go-delve/delve/pkg/version github.com/go-delve/delve/service
github.com/go-delve/delve/service/api
github.com/go-delve/delve/service/dap
github.com/go-delve/delve/service/dap/daptest
github.com/go-delve/delve/service/debugger
github.com/go-delve/delve/service/internal/sameuser
github.com/go-delve/delve/service/rpc2
github.com/go-delve/delve/service/rpccommon returned exit code 1
make[1]: *** [debian/rules:21: override_dh_auto_build] Error 255
make[1]: Leaving directory '/home/debian/delve/delve-1.24.0'

Please correct me if I am missing something or misunderstood something.

Thanks

#1112033#35
Date:
2025-08-29 19:40:24 UTC
From:
To:
No, I think you didn't remove it hard enough. Double check, have it cat somewhere the file that it's compiling, which would be:

/home/debian/delve/delve-1.24.0/obj-powerpc64le-linux-gnu/src/github.com/go-delve/delve/pkg/proc/native/support_sentinel_linux.go

#1112033#40
Date:
2025-09-01 09:16:40 UTC
From:
To:
Hello Alessandro,

I checked the file content of support_sentinel_linux.go, it doesnt
contain the ppc64le tags but it still gives that error.

debian@ltc-zz14-lp9:~/delve/delve-1.24.0$ cat
/home/debian/delve/delve-1.24.0/obj-powerpc64le-linux-gnu/src/github.com/go-delve/delve/pkg/proc/native/support_sentinel_linux.go
//go:build linux && !amd64 && !arm64 && !386 && !(riscv64 &&
exp.linuxriscv64)

// This file is used to detect build on unsupported GOOS/GOARCH
combinations.

package your_linux_architecture_is_not_supported_by_delve
debian@ltc-zz14-lp9:~/delve/delve-1.24.0$

#1112033#45
Date:
2025-09-01 09:20:12 UTC
From:
To:
Add !ppc64le to it.
#1112033#50
Date:
2025-09-01 09:51:45 UTC
From:
To:
Thank you very much. It worked.

So based on my understanding, we would need to remove the whole clause
"|!(ppc64le && exp.linuxppc64le)|" and replace it with "!ppc64le".

I will create all the three issues on upstream and raise the PRs there.
Thanks and regards.

#1112033#55
Date:
2025-09-02 12:56:04 UTC
From:
To:
Hello Debian team, please let me know your thoughts on this.
This issue is fixed in version 1.25.2. So, The dh_auto_test  error will
be fixed, once debian team upgrades to delve 1.25.2.
This issue will be fixed once the PR
<https://github.com/go-delve/delve/issues/4128> is merged. Thanks to
Alessandro for helping me on this.