diff --git a/README.md b/README.md index ba2e2c9598..9e7afad0e5 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ brew install zed - [Building Zed for macOS](./docs/src/developing_zed__building_zed_macos.md) - [Building Zed for Linux](./docs/src/developing_zed__building_zed_linux.md) +- [Building Zed for Windows](./docs/src/developing_zed__building_zed_windows.md) - [Running Collaboration Locally](./docs/src/developing_zed__local_collaboration.md) ## Contributing diff --git a/docs/src/developing_zed__building_zed.md b/docs/src/developing_zed__building_zed.md index fcb7e231d8..ee67f1da9e 100644 --- a/docs/src/developing_zed__building_zed.md +++ b/docs/src/developing_zed__building_zed.md @@ -4,3 +4,4 @@ See the platform-specific instructions for building Zed from source: - [macOS](./developing_zed__building_zed_macos.md) - [Linux](./developing_zed__building_zed_linux.md) +- [Windows](./developing_zed__building_zed_windows.md) diff --git a/docs/src/developing_zed__building_zed_windows.md b/docs/src/developing_zed__building_zed_windows.md new file mode 100644 index 0000000000..a40b37e68d --- /dev/null +++ b/docs/src/developing_zed__building_zed_windows.md @@ -0,0 +1,79 @@ +# Building Zed for Windows + +> [!NOTE] +> The following commands may be executed in any shell. + +## Repository + +After cloning the repository, ensure all git submodules are initialized: + +```shell +git submodule update --init --recursive +``` + +## Dependencies + +- Install [Rust](https://www.rust-lang.org/tools/install). If it's already installed, make sure it's up-to-date: + + ```bash + rustup update + ``` + +- Install the Rust wasm toolchain: + + ```bash + rustup target add wasm32-wasi + ``` + +- Install [Visual Studio](https://visualstudio.microsoft.com/downloads/) with optional component `MSVC v*** - VS YYYY C++ x64/x86 build tools`. + +> [!NOTE] +> `v***` is your VS version and `YYYY` is year when your VS was released. + +## Backend dependencies + +> [!WARNING] +> This section is still in development. The instructions are not yet complete. + +If you are developing collaborative features of Zed, you'll need to install the dependencies of zed's `collab` server: + +- Install [Postgres](https://www.postgresql.org/download/linux/) +- Install [Livekit](https://github.com/livekit/livekit-cli) and [Foreman](https://theforeman.org/manuals/3.9/quickstart_guide.html) + +Alternatively, if you have [Docker](https://www.docker.com/) installed you can bring up all the `collab` dependencies using Docker Compose: + +```sh +docker compose up -d +``` + +## Building from source + +Once you have the dependencies installed, you can build Zed using [Cargo](https://doc.rust-lang.org/cargo/). + +For a debug build: + +``` +cargo run +``` + +For a release build: + +``` +cargo run --release +``` + +And to run the tests: + +``` +cargo test --workspace +``` + +## Troubleshooting + +### Can't compile zed + +Before reporting the issue, make sure that you have the latest rustc version with `rustup update`. + +### Cargo errors claiming that a dependency is using unstable features + +Try `cargo clean` and `cargo build`.