deb: Depends: never gets libc6 (or other shlib deps) for dynamically-linked cgo binaries #74
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
nagonag
nagonag/ignore
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
heiko/gogogo#74
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
internal/pack/deb builds binary .debs by hand (no dpkg-shlibdeps
invocation), so the ${shlibs:Depends} placeholder in the populated
debian/control stub is never substituted, and spec.Depends only ever
contains what the user explicitly configured.
For a binary built with cgo enabled (Go's default; e.g. anything using
net with the system resolver, os/user, etc.), the resulting ELF is
dynamically linked against libc:
but the generated package's control file has no Depends: line at all
referencing it:
lintian correctly flags this:
Reproduction
Package any Go binary built with default CGO_ENABLED=1 (the Go
default) that links dynamically -- e.g. go.schlittermann.de/ius/joker-dmapi-client,
cmd/joker. Run lintian on the resulting .deb.
Notes
static binary was tried as a workaround and made things worse: it
trades this warning (and the two PIE/RELRO ones, see the companion
issue) for a harder lintian error, statically-linked-binary. So
that's not a viable per-project fix on its own.
CGO_ENABLED: 0 + a hand-written debian/.lintian-overrides
suppressing statically-linked-binary. That's a working pattern today,
but it has to be hand-rolled per project; gogogo's
populatecommanddoesn't scaffold a lintian-overrides stub.
through debug/elf to collect DT_NEEDED entries and translate known
SONAMEs to Debian package names (at minimum libc.so.6 -> libc6),
merging into spec.Depends; or
same way debhelper does it, if a bundled/manual ELF-to-package
mapping is considered too fragile long-term.
documented option too (avoiding this whole class of finding), but
see the companion issue about statically-linked-binary.