Skip to content

Comments

fix: ensure replaced modules are required in go.mod during build#119

Open
andypost wants to merge 1 commit intolaunchrctl:mainfrom
andypost:87-fix
Open

fix: ensure replaced modules are required in go.mod during build#119
andypost wants to merge 1 commit intolaunchrctl:mainfrom
andypost:87-fix

Conversation

@andypost
Copy link

When using the --replace flag, the build process was skipping go get for replaced modules but not adding them as requirements, causing Go compilation errors. This fix ensures replaced modules are properly required using go mod edit -require with placeholder versions.

Fixes #87

🤖 Generated with Claude Code

@andypost andypost force-pushed the 87-fix branch 3 times, most recently from 374888e to e04eaab Compare June 25, 2025 21:17
@lexbritvin
Copy link
Collaborator

@andypost can you please rebase onto the latest main? The change for better documented replace is a good thing, and I don't want to dump this code.
Can you please extract claude.md changes to a separate PR?

When using --replace flag, the build process was skipping go get for
replaced modules but not adding them as requirements, causing Go
compilation errors ("replaced but not required").

Add ensureModuleRequired() that calls go mod edit -require with a
placeholder version before go get for replaced modules. Also include
core package in GONOSUMDB/GONOPROXY for no-cache builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@andypost
Copy link
Author

andypost commented Feb 8, 2026

@lexbritvin new Claude suggests simple approach #130 (added updated docs here)

@andypost
Copy link
Author

andypost commented Feb 8, 2026

@lexbritvin see 8fc77a3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build a binary with --replace doesn't work

2 participants