Publish HyperMeow as its own Go module - #33
Conversation
HyperMeow declared `module go.mau.fi/whatsmeow`, so consumers could only reach it through `replace go.mau.fi/whatsmeow => github.com/polymorfa/ hypermeow`. Go only honours a `replace` in the main module, so that arrangement never propagated: anything that depended in turn on a module using HyperMeow silently resolved upstream whatsmeow instead, and `go get github.com/polymorfa/hypermeow` could not work at all. Declare the module under its own path, `github.com/polymorfa/hypermeow`, and rewrite internal import paths to match. Package names are unchanged - the root package is still `whatsmeow` - so only import paths move and no call site changes. The 57 generated descriptors are regenerated rather than text-edited. The `go_package` option is stored in the raw descriptor behind two protobuf varint length prefixes, and the path grows by 11 bytes, so a substitution would have left every length prefix understating its payload and corrupted the descriptors at runtime. Regenerating with the toolchain the artifacts were produced by (protoc-gen-go v1.36.11) reproduces them byte-identically apart from the intended change; the only incidental diff is the recorded protoc patch version, 6.33.5 to 6.33.6. The nested benchmark module already carried the new path and now requires it directly.
|
@codex review Please review exact head This renames the module from Highest-value areas to challenge:
Local controls on this head: |
|
@coderabbitai review Please review exact head Module path rename from Please pay particular attention to:
|
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
godoc renders the root package as "whatsmeow package - github.com/polymorfa/hypermeow", which reads like the rename did not take. It did: only the module path moved. Say so directly, and give the reason the package clause stays on the upstream name.
|
@codex review Head has moved to |
|
@coderabbitai review Head has moved to |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d1e837a27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A distinct module path lets Go compile HyperMeow alongside upstream whatsmeow. Both keep upstream's generated descriptor paths, so the process-global protobuf registry panics before main. The replace directive made that impossible; document the constraint and how to assert it at build time.
|
@coderabbitai review Please review exact head |
|
Thanks — that P1 is correct and I have addressed it in You are right that this is a real regression in kind, not just degree: under On the proposed remedy — giving the fork a distinct protobuf descriptor namespace — I looked at it and did not take it, for reasons I want to state rather than silently decline:
So I treated it as a constraint to enforce rather than design away, given the failure is fail-loud and fully diagnosable:
If you still consider a distinct descriptor namespace necessary despite the wire-compatibility cost, say so and I will treat it as blocking and scope it separately — I did not want to make that trade unilaterally. @codex review Please review exact head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ea2d78aab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Without -m the query is about the package, so a dependency importing only a subpackage such as proto/waCommon reports that the module is not needed while it is in fact linked. Add a link-graph check as well.
|
Second P1 is correct — fixed in You are right that @codex review Please review exact head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6eaf52956e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
grep exits 0 on a match, so the documented command succeeded precisely when upstream whatsmeow was in the graph.
|
P2 fixed in The documented check had its exit status backwards: Verified empirically: I have resolved the @codex review Please review exact head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92b49be16d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Applied the same correction in @codex review Please review exact head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b86af7604f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Both P2s fixed in Test-only deps: correct — POSIX portability: also correct — Verified under a real @codex review Please review exact head |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Same simplification in On the recurring The finding is accurate — a distinct module path does allow both copies to link, and the descriptors do collide. But the proposed remedy, a distinct protobuf descriptor namespace, is not one I will take unilaterally: it requires changing Meta protobuf What I have done instead is make the unsafe state impossible to reach unnoticed:
If a maintainer judges the namespace split necessary despite the wire-compatibility cost, I will scope it as its own change — but it should not ride along inside a module-path migration. @codex review Please review exact head |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The go-mod-tidy pre-commit hook fails on nine stale entries for modules no longer in the graph.
|
Resolving the remaining README threads. All of them were about successive edge cases in one shell snippet — inverted deps="$(go list -deps -test ./...)" || exit 1
case "$deps" in *go.mau.fi/whatsmeow*) exit 1 ;; esac
CI is green on both Go 1.25 and 1.26 at |
HyperMeow declared
module go.mau.fi/whatsmeow, so the only way to consume it wasreplace go.mau.fi/whatsmeow => github.com/polymorfa/hypermeow.Go honours a
replaceonly in the main module. That meant the arrangement never propagated: anything depending in turn on a module that used HyperMeow silently resolved upstream whatsmeow instead, andgo get github.com/polymorfa/hypermeowcould not work at all.This declares the module under its own path and rewrites internal import paths to match.
Scope
go.mod:module github.com/polymorfa/hypermeow.protogo_packageoptions rewritten.pb.goregenerated (see below)benchmark/barback(already namedgithub.com/polymorfa/hypermeow/benchmark/barback) now requires the parent directly.pre-commit-config.yamlgoimports-localprefix, Dockerfiles, READMEPackage names are unchanged - the root package is still
whatsmeow, so only import paths move and no call site changes:The generated descriptors were regenerated, not text-edited
This is the part worth reviewing closely.
go_packagelives in the raw descriptor behind two protobuf varint length prefixes:The path grows by 11 bytes (
go.mau.fi/whatsmeow19 ->github.com/polymorfa/hypermeow30), so asedwould have left both prefixes understating their payload and corrupted all 57 descriptors at runtime. Regenerated output confirms it:Regeneration used the toolchain the committed artifacts were produced by (
protoc-gen-go v1.36.11), verified beforehand by regenerating an unmodified proto and confirming byte-identical output. The only incidental diff is the recorded protoc patch version,v6.33.5->v6.33.6(protobuf 33.5 -> 33.6, same minor series). Net: 57 files, 201 insertions / 201 deletions.Verification
go build ./...,go vet ./...,go test ./...(8 packages, 0 failures),go test -race ./...(8 packages, 0 failures), nested benchmark module builds,gofmtclean,goimports -local github.com/polymorfa/hypermeowclean, and the CI MEX consistency check (genmex -check) passes.Coordination
This is a breaking change for consumers. Titan currently pins the old path via
replaceand must be updated in lockstep - Go rejects areplacewhose target declares a different module path. The matching Titan change is next.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.