Untitled
This change is needed because you’re moving from using OpenWRT’s standard Go package infrastructure to a custom implementation. Let me break it down:
Original Line
include $(INCLUDE_DIR)/golang-package.mk
This tries to use OpenWRT’s built-in Go package infrastructure which:
Expects specific file locations
Requires the official golang-package.mk file
Uses predefined build rules that may conflict with your custom setup
New Implementation
$(eval $(call GoPackage))
This instead activates your custom Go package definition that:
Is defined in your golang.mk file
Uses your own build rules and paths
Bypasses OpenWRT’s default Go build system
Key Differences
include \((INCLUDE_DIR)/golang-package.mk\)(eval $(call GoPackage))SourceOpenWRT’s core packageYour custom golang.mkBuild RulesPredefined by OpenWRTCustomized for your needsFile LocationsRequires standard pathsUses your custom pathsWorkspace HandlingStandard Go workspaceCustom .go_work directory
Why This Fixes Your Error
Avoids Missing File
The error occurred because the build system couldn’t find OpenWRT’s official golang-package.mk. By using your own implementation, you eliminate this dependency.
Custom Build Control
Your golang.mk likely contains a GoPackage macro that implements alternative build steps better suited for your workspace setup.
Path Consistency
Your custom implementation uses paths like .go_work/build that match what you’re actually creating in the build process.
Implementation Notes
Ensure golang.mk contains the GoPackage macro definition
Verify your custom implementation handles:
define GoPackage
Your custom build rules here
Package name handling
Dependency resolution
Install paths
endef
Remove any remaining references to OpenWRT’s default Go infrastructure
This change allows full control over the Go build process while maintaining compatibility with OpenWRT’s package framework.