Symptom
From pkgs/map on current main (284cd52), go build ./... fails while compiling github.com/caarlos0/[email protected]:
# github.com/caarlos0/sshmarshal
.../caarlos0/[email protected]/marshal.go:29:6: MarshalPrivateKey already declared through dot-import of package ssh ("golang.org/x/crypto/ssh")
.../golang.org/x/[email protected]/ssh/keys.go:302:6: other declaration of MarshalPrivateKey
.../caarlos0/[email protected]/marshal.go:35:6: MarshalPrivateKeyWithPassphrase already declared through dot-import of package ssh ("golang.org/x/crypto/ssh")
.../golang.org/x/[email protected]/ssh/keys.go:308:6: other declaration of MarshalPrivateKeyWithPassphrase
Reproduced this run (2026-10-19) with the module's pinned Go 1.21.3 toolchain; exit code 1.
This is the #166 root cause in a second, untracked module
#166 tracks the identical collision for pkgs/graph only. pkgs/map is a separate Go module (module github.com/developing-today/code/sources/map, its own go.mod/go.sum/gomod2nix.toml) with the same dependency path: charm v0.12.6 → keygen v0.4.2 → caarlos0/sshmarshal v0.1.0, resolving golang.org/x/crypto v0.16.0. Fixing #166 will not fix this module.
Two differences from #166 that change the fix:
pkgs/map actually uses Charm. pkgs/graph Go build fails on sshmarshal/x/crypto symbol collision #166's suggested graph fix (remove the unused Charm KV demo dependency) is not available here: pkgs/map/main.go:8 imports github.com/charmbracelet/charm/kv and main.go:74 calls kv.OpenWithDefaults("my-cute-db"). The fix must upgrade/replace the chain, not delete it.
- No CI covers this module at all. The only workflow referencing any of the small
pkgs/* Go modules is .github/workflows/mod-tidy.yml, and it is graph-only (and tidy-only, not a build). Nothing builds pkgs/map, which is how it rotted silently.
Sibling modules verified building clean on the same main this run: pkgs/chat, pkgs/database, pkgs/tea, pkgs/import, pkgs/launcher. (pkgs/identity also builds, with its required -tags libsql.) So the broken set is exactly graph (#166) + map (this issue).
Suggested fix (verified in a scratch copy, not committed)
cd pkgs/map
go get github.com/charmbracelet/[email protected]
go mod tidy
go build ./... # passes; sshmarshal leaves the module graph entirely
keygen v0.5.1 no longer depends on sshmarshal. Remaining work beyond the scratch verification: regenerate gomod2nix.toml so the default.nix buildGoApplication build matches the new go.mod, and verify that nix build.
Acceptance criteria
-
go build ./... (and go vet ./...) pass in pkgs/map with the module's toolchain, without removing the charm/kv functionality used in main.go.
-
gomod2nix.toml regenerated and the nix build of pkgs/map passes (or, if the nix packaging is intentionally abandoned — note flake.nix is still named flake.todo.nix — that is recorded and the stale packaging removed instead).
- A CI build check covers
pkgs/map (e.g. extend mod-tidy.yml into a build workflow for the small Go modules, or add a map-specific one) so this cannot silently regress again.