2026-06-18 01:40:12 +00:00
|
|
|
#!/usr/bin/env bash
|
2026-06-19 12:32:19 +00:00
|
|
|
# Build the hsa binary into the repo root.
|
|
|
|
|
#
|
|
|
|
|
# CGO_ENABLED=0 makes a fully static binary (the SQLite driver is pure Go, so no
|
|
|
|
|
# C toolchain is needed): it runs on any linux/<arch> — glibc or musl/Alpine,
|
|
|
|
|
# scratch containers, etc. — with no shared-library dependencies.
|
|
|
|
|
# Cross-compile for another arch by setting GOARCH, e.g.:
|
|
|
|
|
# GOARCH=arm64 ./scripts/build.sh
|
2026-06-18 01:40:12 +00:00
|
|
|
set -euo pipefail
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
source scripts/go-env.sh
|
2026-06-19 12:32:19 +00:00
|
|
|
CGO_ENABLED=0 go build -ldflags "-s -w" -o hsa ./cmd/hsa
|
|
|
|
|
echo "Built ./hsa ($(go env GOOS)/$(go env GOARCH), static)"
|