Skip to content

fix(build): build spored as a package, not main.go alone (#141) - #142

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/141-build-spored-package
Jun 13, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/141-build-spored-package

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

make build-spored ran go build -o bin/spored cmd/spored/main.go — a single-file build that can't see symbols defined in spored's build-tag-split sibling files (paths_other.go/paths_windows.go, shutdown_*.go), so make build failed:

cmd/spored/main.go:92:5: undefined: runAsServiceIfManaged
cmd/spored/main.go:96:2: undefined: registerPlatformCommands

Fix: build the package (./cmd/spored/). While here, normalized all Makefile build targets (spawn + spored, native + the cross-compile matrix) to build packages instead of main.go alone — more robust if the root package ever gets split files too.

Verified make build now produces both bin/spawn and bin/spored, and spored cross-compiles (linux/amd64) cleanly. GoReleaser already built packages (.goreleaser targets ./cmd/spored), so released/Homebrew/Scoop binaries were never affected — this only unbreaks from-source make build/make install. Closes #141.

make build-spored ran `go build cmd/spored/main.go`, which can't see symbols
defined in spored's build-tag-split sibling files (paths_*.go, shutdown_*.go) —
so `make build` failed with `undefined: runAsServiceIfManaged` etc. Build the
package (`./cmd/spored/`) instead. Normalized every Makefile build target
(spawn + spored, native + cross-compile) to build packages rather than single
files. GoReleaser was already package-based, so released binaries were never
affected — this just unbreaks `make build` / `make install` from source.
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

make build-spored compiles main.go alone, not the package — build/install broken

1 participant