You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
make build-spored compiles main.go alone, not the package — build/install broken #141
make build-spored compiles cmd/spored/main.go as a single file instead of the whole package, so it fails on symbols defined in spored's sibling (platform-split) files:
$ make build-spored
go build -o bin/spored cmd/spored/main.go
cmd/spored/main.go:92:5: undefined: runAsServiceIfManaged
cmd/spored/main.go:96:2: undefined: registerPlatformCommands
cmd/spored/ has build-tag-split files — paths_other.go / paths_windows.go, shutdown_other.go / shutdown_windows.go — that define sporedLogPath, waitForShutdown, runAsServiceIfManaged, registerPlatformCommands, etc. A single-file go build can't see them.
Reproduction
make build-spored # fails
make build # fails (build = build-spawn + build-spored)
go build ./cmd/spored/ # works (builds the package)
Fix
In the Makefile, build the package, not the file:
- go build -o $(BUILD_DIR)/spored cmd/spored/main.go+ go build -o $(BUILD_DIR)/spored ./cmd/spored/
Impact / scope
Local-only. make build (and thus a from-source make install) is broken for spored. GoReleaser builds the package (.goreleaser.yaml targets ./cmd/spored, not the file), so released binaries are unaffected — which is why this went unnoticed. Found while building bin/spawn to run a Tier 1 e2e test.
Activity
fix(build): build spored as a package, not main.go alone (#141) (#142)