Known dh-golang issues
This page tracks known issues with dh-golang currently in experimental that need to be fixed before we can upload it to unstable.
1. Minimal go.mod files are being created under /usr/share/gocode/
For Go packages without go.mod files, dh-golang auto-generates a minimal go.mod file. This should be done in the current work directory, but gibmat noticed after performing a build that removing the various -dev packages caused apt to complain about non-empty directories. He thinks this might be caused by the current logic of symlinking dependency source code from /usr/share/gocode/ into the build directory.
Resolved Issues
1. autopkgtests fail due to skipping dh_auto_configure
When autopkgtests are run, since the package source is installed from its -dev binary package, no configuration step is run. This means no go.work file is generated which then results in a build failure.
Should we generate the Go workspace file first thing during dh_auto_build instead?
gibmat is currently investigating.
2. Possible mismatch in go.mod required Go versions
mdosch mentioned when working on the sptlrx package that its go.mod file requires Go >= 1.26.1, but the generated go.work file only lists Go 1.26.
dh-golang should probably use the full Go version corresponding to whatever version of the Go compiler is currently running to work around such issues.
Comment from AndrewLee: We should try to be identical with upstream's expectation. So we can reproduce the same issue on both upstream and Debian. And also applies upstream fixes the same in Debian. I think dh-golang should respect the version from upstrema's go.mod. Not force to use full Go version of Go Compiler is currently running, but use the same version from go.mod file in the generated go.work file.
3. dh-golang should ignore GO111MODULE values from d/rules, etc
podman (and likely several other packages) currently manually set GO111MODULE=off. dh-golang will ignore any supplied value and always set GO111MODULE=on.
4. dh-golang was ignoring build targets specified via DH_GOLANG_BUILDPKG
We were only considering go.mod files for the default DH_GOPKG, which caused packages such as golang-google-grpc to fail to build properly. dh-golang 1.66~exp7 expands the go.work creation logic to consider go.mod files for each build target.
