Skip to main content

Development Environment Setup

This guide covers setting up your development environment to build Glass from source.

Prerequisites

Required Tools

  • Git - For cloning the repository
  • Rust toolchain - Install via rustup
  • Platform-specific dependencies - See platform sections below

Platform-Specific Setup

macOS Dependencies

1

Install Xcode

Download from the macOS App Store or Apple Developer (requires developer account).Launch Xcode after installation and install the macOS components.
2

Install Xcode command line tools

xcode-select --install
3

Configure Xcode command line tools

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license accept
4

Install CMake

Required by wasmtime dependency:
brew install cmake

Speed Optimizations

If you build frequently, macOS may keep verifying new builds, adding seconds to each iteration:
  1. Run sudo spctl developer-mode enable-terminal
  2. In System Settings, search for “Developer Tools”
  3. Add your terminal (iTerm, Ghostty, etc.) to “Allow applications to use developer tools”
  4. Restart your terminal
To avoid continual rebuilds, don’t open the Glass codebase in your development build. Run cargo run ~/path/to/other/project instead.

Clone the Repository

Glass is a fork of Zed. All branches and PRs must target Glass-HQ/Glass, never the upstream zed-industries/zed repo.
git clone https://github.com/Glass-HQ/Glass.git
cd Glass

Building Glass

Debug Build

Run Glass in debug mode:
cargo run

Release Build

Build and run an optimized release version:
cargo run --release

Running Tests

Run the full test suite:
cargo test --workspace

Installing a Development Build

Glass doesn’t have a dedicated install script for macOS yet. You can run the built binary directly from target/release/zed or create a symlink.

Understanding the Codebase

Glass is made up of several crates:
  • gpui - GPU-accelerated UI framework providing all building blocks for Glass
  • editor - Core Editor type driving code editor and input fields
  • project - File management and navigation within the filetree
  • workspace - Local state serialization, groups projects together
  • lsp - Communication with external LSP servers
  • language - Language understanding (symbols, syntax maps)
  • collab - Collaboration server for project sharing
  • rpc - Message definitions for collaboration server
  • theme - Theme system and default themes
  • ui - Collection of UI components and common patterns
  • cli - CLI crate invoking the Glass binary
  • zed - Main entry point where everything comes together
Keep the Zed glossary handy when starting out. It lists structures and terms throughout the codebase.

Build Tools

Code Quality

Use the custom clippy script instead of cargo clippy:
./script/clippy

Visual Regression Tests (macOS only)

Glass includes visual regression tests that capture screenshots and compare against baselines:
1

Grant Screen Recording permission

System Settings > Privacy & Security > Screen RecordingEnable your terminal app (Terminal.app, iTerm2, Ghostty). Restart your terminal.
2

Generate baseline images

Before making UI changes, generate baselines from a known-good state:
git checkout origin/main
UPDATE_BASELINE=1 cargo run -p zed --bin visual_test_runner --features visual-tests
git checkout -
3

Run visual tests

cargo run -p zed --bin zed_visual_test_runner --features visual-tests

Troubleshooting

Try cleaning and rebuilding:
cargo clean
cargo build
Configure Xcode tools:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
On macOS 15+:
xcodebuild -downloadComponent MetalToolchain
Install and configure Xcode command line tools:
xcode-select --install
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=$(xcrun --show-sdk-path)"
cargo clean && cargo run
Don’t set the RUSTFLAGS environment variable - it overrides required settings in .cargo/config.toml.Add custom flags to .cargo/config.toml instead (see Windows setup section).
This can happen with the rust-lld.exe linker. Try a different linker configuration in .cargo/config.toml.

Next Steps

Contribution Guidelines

Learn our code standards and contribution workflow

Build docs developers (and LLMs) love