Skip to content

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

- Add CLAUDE.md with project overview and key commands for AI assistance
- Create docs/architecture/ with detailed architectural analysis:
  * ARCHITECTURAL_PATTERNS.md: 16 design patterns, anti-patterns, and 15 improvement suggestions
  * LOGGING_ARCHITECTURE.md: Analysis of sophisticated dual logging system (Log() vs Term())
  * PLUGIN_SYSTEM.md: Complete plugin architecture guide with examples
  * SERVICE_SYSTEM.md: Service-oriented design and dependency injection documentation
- Add comprehensive DEVELOPER_GUIDELINES.md covering:
  * Code style and conventions
  * Architecture guidelines and best practices
  * Logging guidelines for dual system usage
  * Plugin and service development guides
  * Testing, error handling, and performance considerations
- Update docs/README.md with improved organization and navigation

Total: 1,915 lines of comprehensive documentation covering system architecture,
development practices, and contribution guidelines.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
andypost and others added 3 commits June 25, 2025 22:09
- Fix plugin download logic to properly distinguish between exact matches and subpaths
- Add two-phase approach: skip subpaths, handle exact matches as replaced modules
- Ensure replaced modules (both core and plugins) are required in go.mod with placeholder versions

The key fix changes the condition from `strings.HasPrefix(p.Path, repl)` to
`p.Path \!= repl && strings.HasPrefix(p.Path, repl)` to avoid incorrectly
skipping plugins that exactly match replaced module paths.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@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?


// ensureModuleRequired adds a module to go.mod if it's not already there or if it's replaced.
// It uses a placeholder version for replaced modules.
func (env *buildEnvironment) ensureModuleRequired(ctx context.Context, modulePath string, modReplace map[string]string) error {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method fails on rebase, let's get docs PR #118 in and then fix it

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