Skip to content

make build cross-compiles for the selected platforms; dist ships every supported one #598

Closed

Description

@David-Noble-at-work

Amended on delivery, 2026-08-24. The capability shipped in full; the default did not. make build
defaults to the current platform, and PLATFORM=all selects 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 dist defaults 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

  1. Matrix: darwin/arm64, linux/amd64, windows/amd64, windows/arm64 — the last is the native
    fit for Parallels on Apple Silicon (Windows-on-ARM).
  2. Binary set: the products — lore, writ, star, devlore-test. Dev-side tools
    (devlore-docs, devlore-index, devlore-inventory, scenario) stay host-only.
  3. Layout: build/<goos>-<goarch>/<binary>[.exe], each built with the standard ldflags
    (version, commit, date).
  4. make build = full matrix by default (ruled), with a PLATFORMS= override to restrict — the
    relief valve for the inner dev loop's extra link time. Generators run once, host-side, shared by all
    targets.
  5. 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.

Activity

  1. David-Noble-at-work commented on Aug 24, 2026

    @David-Noble-at-work
    ContributorAuthor

    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 build still fails, for a different reason: GOOS/GOARCH are 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 builds build/star$(GOEXE) (the product copy). #639 makes it real.

    Also prior art for the matrix: dist (Makefile:286-287) already cross-compiles writ and lore under explicit GOOS/GOARCH/CGO_ENABLED=0 — 2 of the 4 products this issue targets.

    Superseded #652, closed as a duplicate of this issue.

  2. changed the title [-]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[/+] on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions