Building from Source
This guide provides detailed instructions on how to build the l0-memory server and VS Code extension from source.
Prerequisites
Ensure you have the following tools installed:
- Go 1.22 or newer
- Node.js 20 or newer (including
npm) - Make (standard on macOS and Linux)
Using the Makefile
The project includes a comprehensive Makefile in the root directory that automates the most common build tasks.
Build the Server
To compile the ltm binary for your current platform:
make buildThe resulting binary will be located at server/ltm.
Build the Extension
To compile the VS Code extension and package it as a .vsix file:
make vsixThis command performs several steps:
- Compiles the Go server for multiple platforms (Linux, macOS, Windows).
- Compiles the TypeScript extension code.
- Bundles the cross-compiled binaries into the extension package.
- Generates a
.vsixfile in the root directory.
Manual Build Steps
If you prefer to build individual components manually:
Server
cd server
go build -o ltm main.goExtension
cd extension
npm install
npm run compileCross-Compilation
Because l0-memory uses a pure Go SQLite driver (no CGO), you can easily build for other platforms from your current machine.
# Example: Building for Linux ARM64 from macOS
GOOS=linux GOARCH=arm64 go build -o ltm-linux-arm64 ./serverTesting
Always run the tests after building to ensure stability.
# Run server tests
make test
# Or manually in the server directory
cd server && go test -race ./...CI/CD
The project uses GitHub Actions for continuous integration. You can refer to .github/workflows/ci.yml to see the exact steps used in the official build pipeline.