go install codeberg.org/goern/forgejo-mcp/v2@latest fails due to replace directive in go.mod #67
Labels
No labels
Compat/Breaking
hermes-attempted
hermes-needs-clarification
hermes-ready
hermes-review
hermes-wip
human-required
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
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
goern/forgejo-mcp#67
Loading…
Add table
Add a link
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?
Problem
Running
go install codeberg.org/goern/forgejo-mcp/v2@latestfails with:Cause
The
go.modcontains areplacedirective:Go refuses to
go install pkg@versionwhen the module'sgo.modhasreplacedirectives, because the build would behave differently than if the module were used as a dependency.Workaround
Clone and build locally:
Resolution options
mvdkleijn/forgejo-sdkso thereplaceis no longer neededcodeberg.org/goern/forgejo-sdk), update imports, and drop thereplaceAnalysis
The
replacedirective currently ingo.mod:…is actually a no-op. The
redbeard/forgejo-sdkfork at thev2.2.0tag has an identicalmainbranch to upstreammvdkleijn/forgejo-sdk(same commit5f3afea2fa). The replace was likely added in anticipation of adopting Brian's expanded Actions API from thefeature/expanded-actionsbranch, but that branch is untagged and unreleased.Why we can't just switch import paths
The fork's
go.modonfeature/expanded-actionsstill declares:Go enforces that the declared module path must match the import path. This means:
replacedirectivego install @latestto work → we need noreplacedirectiveThese are mutually exclusive under Go's module system.
Resolution
Immediate fix (this issue): Remove the no-op
replacedirective. This unblocksgo install codeberg.org/goern/forgejo-mcp/v2@latestwith zero functional change, since the replace was pointing at identical code.Follow-up: Adopting Brian's expanded Actions API (which adds comprehensive Actions support for user/org/repo scopes) is blocked until his changes are merged upstream into
mvdkleijn/forgejo-sdkand released. Brian offered to PR on issue #84 and the maintainer was receptive — just needs the PR to be filed.@redbeard @mvdkleijn — heads up: we're hitting this
go install @latestblocker in forgejo-mcp because of areplacedirective pointing at Brian's fork.The immediate fix here is straightforward (remove the no-op replace), but longer-term we'd love to adopt the expanded Actions API from
feature/expanded-actions. That's blocked until those changes land upstream inmvdkleijn/forgejo-sdk— I saw the positive exchange on mvdkleijn/forgejo-sdk#84. Is there anything we can do to help move that PR along?Like I said in mvdkleijn/forgejo-sdk#84 I'm down for someone shooting in a PR. I was planning to look at some outstanding PRs tomorrow in between other work.
Resolved by the Actions support work in
ebe97a0/af4636e.The
replacedirective (pointing toredbeard/forgejo-sdk) is gone. We upgraded directly tocodeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.2.1-0.20260217203524-edf26081b649— a pseudo-version of upstream main after SDK PR #103 was merged. Noreplacedirective needed, sogo install codeberg.org/goern/forgejo-mcp/v2@latestwill work again once a release is tagged.