dh-make-golang
dh-make-golang copied to clipboard
[FR] ignore windows-only go modules
$ dh-make-golang estimate github.com/arduino/arduino-cli
[...]
2025/03/11 00:55:41 Bringing github.com/arduino/arduino-cli to Debian requires packaging the following Go modules:
github.com/arduino/arduino-cli
fortio.org/safecast
github.com/arduino/go-paths-helper
github.com/arduino/go-properties-orderedmap
github.com/arduino/go-paths-helper (2)
github.com/arduino/go-serial-utils
github.com/arduino/go-timeutils
github.com/arduino/go-win32-utils
github.com/arduino/pluggable-discovery-protocol-handler/v2
github.com/arduino/go-paths-helper (3)
github.com/arduino/go-properties-orderedmap (2)
github.com/arduino/pluggable-monitor-protocol-handler
github.com/cmaglie/pb
github.com/codeclysm/extract/v4
github.com/arduino/go-paths-helper (4)
github.com/niemeyer/pretty
github.com/djherbis/buffer
github.com/djherbis/nio/v3
github.com/djherbis/buffer (2)
github.com/go-git/go-git/v5 (github.com/go-git/go-git in Debian)
github.com/go-git/gcfg
github.com/go-git/go-git-fixtures/v4 (github.com/go-git/go-git-fixtures in Debian)
github.com/Microsoft/go-winio
github.com/gofrs/uuid/v5 (github.com/gofrs/uuid in Debian)
github.com/marcinbor85/gohex
go.bug.st/cleanup
go.bug.st/downloader/v2
go.bug.st/f
go.bug.st/relaxed-semver
go.bug.st/testifyjson
github.com/Microsoft/go-winio (2)
github.com/go-git/gcfg (2)
github.com/sagikazarmark/locafero
github.com/sagikazarmark/slog-shim
go-winio and go-win32-utils are windows-only deps. it'd be nice if dh-make-golang would ignore those.
Good suggestion. I am not sure what would be the best way to implement this. Were you simply thinking of a blacklist? This would probably be enough.
I also thought that maybe I could try to make the estimate command use the build graph again (instead of the mod graph currently). If it respects the build tags and if the usage of these libraries is guarded by such build tags, it would ignore them by default.
But from what I saw, at least in docker packages, the import of the windows only libraries were not always guarded by build tags.
That said, it would still be interesting to display the usage of these libraries in the log, as it will most likely imply patching work. And it could be misleading if it just looks like the libraries were not detected.
I am not that deep in the Go ecosystem, so I don't know if modules declare themselves windows-only which then can be filtered somehow. A blocklist would certainly be the most convenient /easiest way.