Building from Source

This guide explains how to build KayakNet from source code.

Prerequisites

Required

Optional

  • Make - For build automation

  • Docker - For containerized builds

Clone Repository

git clone https://github.com/KayakNet/KayakNet.git
cd KayakNet

Build

Simple Build

Optimized Build

Flags:

  • -s - Strip symbol table

  • -w - Strip DWARF debugging info

Result: ~40% smaller binary

Cross-Compilation

Windows (from Linux/macOS):

Linux (from Windows/macOS):

macOS (from Linux/Windows):

ARM (Raspberry Pi):

Build All Platforms

Project Structure

Dependencies

View dependencies:

Update dependencies:

Testing

Run Tests

Run with Coverage

Run Specific Package

Verbose Output

Linting

Install golangci-lint

Run Linter

Docker Build

Dockerfile

Build Image

Run Container

Build Flags

Flag
Description

-s

Strip symbol table

-w

Strip DWARF info

-X main.Version=v1.0.0

Set version variable

-race

Enable race detector (testing)

Set Version at Build

Troubleshooting

"go: command not found"

Install Go and add to PATH:

"cannot find package"

Download dependencies:

CGO Issues

Disable CGO for static builds:

Large Binary Size

Use ldflags and UPX:

Last updated