#!/usr/bin/env bash
#MISE description="Build yuctl (embeds the linux bench agent)"
set -e

mkdir -p dist
cd packages/yuctl

# -tags embedagent makes `yuctl tools bench` self-contained; a plain `go build`
# still works, but then requires --agent-bin.
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../../dist/bench-agent-linux-amd64 ./cmd/bench-agent
gzip -9 -n -c ../../dist/bench-agent-linux-amd64 > internal/bench/bench-agent-linux-amd64.gz

go build -tags embedagent -o ../../dist/yuctl .
