Repository navigation
make build cross-compiles for the selected platforms; dist ships every supported one #598
Description
Amended on delivery, 2026-08-24. The capability shipped in full; the default did not.
make build
defaults to the current platform, andPLATFORM=allselects every supported one — measured warm, the full
matrix costs 47.5s against 16.5s for the host alone, so building six platforms on every local build was a ~3x
tax paid by everyone to benefit the rare cross-compile.make distdefaults to all platforms, because a
release is not a selection. The text below is the 2026-08-21 ruling as written; read "by default" as
"on request" throughout.Delivered by #654 (with #653 removing the blocker). Final surface:
make build # this machine make build PLATFORM=linux/amd64 make build PLATFORM=all make dist # every supported platform make dist PLATFORM="linux/amd64 darwin/arm64"
Chore (USER, 2026-08-21). Building on Windows is a pain — no GNU make, no maintained build
environment — and with the platforms at (near) feature parity, the build should come to the machine
instead: make produces every platform's binaries from one host, and installing anywhere is a copy.
Why it works
The codebase is pure Go (zero import "C" — verified 2026-08-21), so the full matrix cross-compiles
from any host with GOOS/GOARCH alone; no per-platform toolchains, no build VMs. The Makefile already
sweeps the supported GOOS list (vet-all, lint-all, build-all) — but build-all is a compile-check
that emits nothing. The missing piece is the emitting variant with the ldflags stamp.
The shape
- Matrix:
darwin/arm64,linux/amd64,windows/amd64,windows/arm64— the last is the native
fit for Parallels on Apple Silicon (Windows-on-ARM). - Binary set: the products —
lore,writ,star,devlore-test. Dev-side tools
(devlore-docs,devlore-index,devlore-inventory,scenario) stay host-only. - Layout:
build/<goos>-<goarch>/<binary>[.exe], each built with the standard ldflags
(version, commit, date). make build= full matrix by default (ruled), with aPLATFORMS=override to restrict — the
relief valve for the inner dev loop's extra link time. Generators run once, host-side, shared by all
targets.- Tests stay native per platform in CI — cross-compiled binaries cross-run nowhere, and the CI matrix
already covers execution.
Relations
Forces #572 (the stale provider-gen groups that broke cross-GOOS make build) — subsumed or fixed
en route. Sits beside the platform sweep of #373 phase 1b, which supplied the GOOS list this reuses.
Epic: #453
Activity
David-Noble-at-work commentedon Aug 24, 2026
Blocked on #639, and that is now the only thing in the way.
#572 (which this issue named as forcing) was fixed 2026-08-24 — the stale grouped targets are gone and a second consecutive build runs zero codegen. But
GOOS=linux make buildstill fails, for a different reason:GOOS/GOARCHare ambient, so they reach the host tool builds too.go run ./cmd/devlore-inventory(Makefile:535-536) cross-compiles the generator and then tries to execute it on the host. #639 pins the host toolchain — ruled 2026-08-24 to use explicit$(shell go env GOHOSTOS)/GOHOSTARCH.That is precisely this issue's item: "generators run once, host-side, shared by all targets." The Makefile already draws the line without enforcing it — line 127 builds
build/star(the tool codegen invokes as$(STAR)), line 137 buildsbuild/star$(GOEXE)(the product copy). #639 makes it real.Also prior art for the matrix:
dist(Makefile:286-287) already cross-compileswritandloreunder explicitGOOS/GOARCH/CGO_ENABLED=0— 2 of the 4 products this issue targets.Superseded #652, closed as a duplicate of this issue.
[-]make build cross-compiles the product binaries for every supported platform by default[/-][+]make build cross-compiles for the selected platforms; dist ships every supported one[/+]