developing_zed__building_zed.md

 1# Building Zed
 2
 3## Dependencies
 4
 5- Install [Rust](https://www.rust-lang.org/tools/install)
 6- Install [Xcode](https://apps.apple.com/us/app/xcode/id497799835?mt=12) from the macOS App Store
 7
 8- Install [Xcode command line tools](https://developer.apple.com/xcode/resources/)
 9
10    ```bash
11    xcode-select --install
12    ```
13
14- Ensure that the Xcode command line tools are using your newly installed copy of Xcode:
15
16    ```
17    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer.
18    ```
19
20* Install the Rust wasm toolchain:
21
22    ```bash
23    rustup target add wasm32-wasi
24    ```
25
26## Backend Dependencies
27
28If you are developing collaborative features of Zed, you'll need to install the dependencies of zed's `collab` server:
29
30- Install [Postgres](https://postgresapp.com)
31- Install [Livekit](https://formulae.brew.sh/formula/livekit) and [Foreman](https://formulae.brew.sh/formula/foreman)
32
33    ```bash
34    brew install livekit foreman
35    ```
36
37## Building Zed from Source
38
39Once you have the dependencies installed, you can build Zed using [Cargo](https://doc.rust-lang.org/cargo/).
40
41For a debug build:
42
43```
44cargo run
45```
46
47For a release build:
48
49```
50cargo run --release
51```
52
53And to run the tests:
54
55```
56cargo test --workspace
57```
58
59## Troubleshooting
60
61### Error compiling metal shaders
62
63```
64error: failed to run custom build command for gpui v0.1.0 (/Users/path/to/zed)`**
65
66xcrun: error: unable to find utility "metal", not a developer tool or in PATH
67```
68
69Try `xcode-select --switch /Applications/Xcode.app/Contents/Developer`
70
71### Cargo errors claiming that a dependency is using unstable features
72
73Try `cargo clean` and `cargo build`,