developing_zed__building_zed_windows.md

 1# Building Zed for Windows
 2
 3> [!NOTE]
 4> The following commands may be executed in any shell.
 5
 6## Repository
 7
 8After cloning the repository, ensure all git submodules are initialized:
 9
10```shell
11git submodule update --init --recursive
12```
13
14## Dependencies
15
16- Install [Rust](https://www.rust-lang.org/tools/install). If it's already installed, make sure it's up-to-date:
17
18  ```bash
19  rustup update
20  ```
21
22- Install the Rust wasm toolchain:
23
24  ```bash
25  rustup target add wasm32-wasi
26  ```
27
28- Install [Visual Studio](https://visualstudio.microsoft.com/downloads/) with optional component `MSVC v*** - VS YYYY C++ x64/x86 build tools`. 
29
30> [!NOTE]
31> `v***` is your VS version and `YYYY` is year when your VS was released.
32
33## Backend dependencies
34
35> [!WARNING]
36> This section is still in development. The instructions are not yet complete.
37
38If you are developing collaborative features of Zed, you'll need to install the dependencies of zed's `collab` server:
39
40- Install [Postgres](https://www.postgresql.org/download/windows/)
41- Install [Livekit](https://github.com/livekit/livekit-cli) and [Foreman](https://theforeman.org/manuals/3.9/quickstart_guide.html)
42
43Alternatively, if you have [Docker](https://www.docker.com/) installed you can bring up all the `collab` dependencies using Docker Compose:
44
45```sh
46docker compose up -d
47```
48
49## Building from source
50
51Once you have the dependencies installed, you can build Zed using [Cargo](https://doc.rust-lang.org/cargo/).
52
53For a debug build:
54
55```
56cargo run
57```
58
59For a release build:
60
61```
62cargo run --release
63```
64
65And to run the tests:
66
67```
68cargo test --workspace
69```
70
71## Troubleshooting
72
73### Can't compile zed
74
75Before reporting the issue, make sure that you have the latest rustc version with `rustup update`.
76
77### Cargo errors claiming that a dependency is using unstable features
78
79Try `cargo clean` and `cargo build`.