My App

Cross-compilation

Building go-udap for other platforms

Cross-compilation

The tool uses pure Go networking (no cgo dependencies), enabling easy cross-compilation.

Using Task

# Windows (amd64)
task build:windows

# Linux (amd64)
task build:linux

# Linux (arm64)
task build:linux-arm64

# All platforms
task build:all

Using Go Directly

# Windows
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o go-udap.exe .

# Linux (amd64)
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o go-udap-linux-amd64 .

# Linux (arm64)
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o go-udap-linux-arm64 .

Platform Support

PlatformArchitectureStatus
macOSamd64, arm64Supported
Linuxamd64, arm64Supported
Windowsamd64Supported

Release builds (UPX-packed)

task release runs task build:all and then UPX-compresses the Linux and Windows binaries. macOS is skipped — modern macOS rejects UPX-packed binaries by default (you can force it with upx --force-macos, but the resulting binary won't run on a stock system without manually re-signing).

Requires UPX in PATH:

brew install upx
task release

Approximate sizes after UPX (-s -w -trimpath plus --best --lzma):

BinaryStrippedUPX-packedSaving
go-udap (macOS arm64)~2.7 MBn/a
go-udap-linux-amd64~2.7 MB~900 KB~67%
go-udap-linux-arm64~2.6 MB~780 KB~70%
go-udap.exe (windows amd64)~2.9 MB~930 KB~67%

Cost of UPX: one-time ~50–100ms decompression on first execution (negligible for a one-shot CLI). Some antivirus engines flag UPX-packed binaries as suspicious — if that's a concern for your distribution channel, ship the unpacked task build:all artifacts instead.

On this page