Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Latest commit

 

History

History
210 lines (159 loc) · 3.49 KB

File metadata and controls

210 lines (159 loc) · 3.49 KB

Building FTL

This monorepo embraces a polyglot philosophy, using the best tool for each job:

  • Go for the CLI (excellent for command-line tools, great ecosystem)
  • Rust for WebAssembly components (performance, safety, WASM support)
  • Multiple languages for SDKs (meet developers where they are)

Prerequisites

Required

  • Go 1.21+ for the FTL CLI
  • Rust 1.75+ with cargo for WebAssembly components
  • Make for build automation

Optional but Recommended

  • cargo-component for building WebAssembly components
    cargo install cargo-component
  • Spin CLI for testing WebAssembly applications
    curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash

Quick Start

Build everything:

make all

This will:

  1. Build the FTL CLI (Go)
  2. Build WebAssembly components (Rust)

Development Workflow

Quick development cycle:

make dev

This runs formatting, builds the CLI, and runs tests.

Run tests:

make test

Format code:

make fmt

Check code quality:

make lint

Individual Component Builds

FTL CLI (Go)

# Using make (recommended)
make build

# Or directly with Go
go build -o bin/ftl ./cmd/ftl

The CLI binary will be at bin/ftl

WebAssembly Components

# Using make
make build-components

# Or directly with cargo-component
cargo component build --workspace --release --target wasm32-wasip1

Components will be in target/wasm32-wasip1/release/

SDKs

Each SDK can be built/tested independently:

Rust SDK:

cd sdk/rust
cargo build
cargo test

Python SDK:

cd sdk/python
pip install -e .
pytest

TypeScript SDK:

cd sdk/typescript
npm install
npm run build
npm test

Go SDK:

cd sdk/go
go build ./...
go test ./...

Installation

Install the FTL CLI to your system:

# Install to ~/.local/bin (user installation)
make install

# Install to /usr/local/bin (system-wide, requires sudo)
make install-system

Testing

Run all tests:

make test

Run specific test suites:

# Test Go CLI only
make test-cli

# Test Rust SDKs only
make test-sdk

# Test WebAssembly components
make test-components

Generate coverage reports:

make coverage
# Open coverage-go.html in your browser

Troubleshooting

Missing cargo-component

If you see warnings about cargo-component not being installed:

cargo install cargo-component

Missing Spin CLI

If you see warnings about spin not being installed:

curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash

Go module issues

If you encounter Go module problems:

go mod tidy
go mod download

Rust toolchain issues

Ensure you have the correct Rust toolchain:

rustup update
rustup target add wasm32-wasip1

Release Builds

For optimized release builds:

# Build everything in release mode
make all

# The CLI will have version information embedded:
./bin/ftl --version

Cross-Platform Building

The project supports cross-platform builds:

macOS (Apple Silicon or Intel)

All components build natively on macOS.

Linux (x86_64 or ARM64)

All components build natively on Linux.

Windows

  • Go CLI builds natively
  • Rust components require WSL2 or Windows-native Rust toolchain
  • Use Git Bash or WSL2 for make commands

Contributing

See CONTRIBUTING.md for development guidelines and contribution process.