From 4a18552ff869af8fb1f790cc03c735d48a14d374 Mon Sep 17 00:00:00 2001 From: Zixuan James Li Date: Thu, 8 Jun 2023 19:12:49 -0400 Subject: [PATCH] docs: Document and advocate systemd for WSL 2. systemd makes it a lot convenient to run services required for Zulip's development environment on WSL 2. Once enabled, `tools/start_service` becomes unnecessary. More info: https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/ Signed-off-by: Zixuan James Li --- docs/development/overview.md | 2 +- docs/development/setup-advanced.md | 2 +- docs/development/setup-recommended.md | 17 +++++++---------- docs/git/cloning.md | 4 ++-- tools/wsl/start_services | 10 ---------- 5 files changed, 11 insertions(+), 24 deletions(-) delete mode 100755 tools/wsl/start_services diff --git a/docs/development/overview.md b/docs/development/overview.md index 0cac9679e5..bf7c8497f4 100644 --- a/docs/development/overview.md +++ b/docs/development/overview.md @@ -84,4 +84,4 @@ machine, take a look at our tips for [using-dev-env]: using.md [testing]: ../testing/testing.md [ci]: ../git/cloning.md#step-3-configure-continuous-integration-for-your-fork -[install-via-wsl]: setup-recommended.md#windows-10 +[install-via-wsl]: setup-recommended.md#windows-10-or-11 diff --git a/docs/development/setup-advanced.md b/docs/development/setup-advanced.md index 387a4a1609..bedf4467c6 100644 --- a/docs/development/setup-advanced.md +++ b/docs/development/setup-advanced.md @@ -66,7 +66,7 @@ ignoring the parts about `vagrant` (since you're not using it). ## Installing using Vagrant with VirtualBox on Windows 10 :::{note} -We recommend using [WSL 2 for Windows development](setup-recommended.md#windows-10) +We recommend using [WSL 2 for Windows development](setup-recommended.md#windows-10-or-11) because it is easier to set up and provides a substantially better experience. ::: diff --git a/docs/development/setup-recommended.md b/docs/development/setup-recommended.md index 995f789942..a525b4c17b 100644 --- a/docs/development/setup-recommended.md +++ b/docs/development/setup-recommended.md @@ -79,7 +79,7 @@ Jump to: - [Ubuntu](#ubuntu) - [Debian](#debian) - [Fedora](#fedora) -- [Windows](#windows-10) +- [Windows](#windows-10-or-11) #### macOS @@ -157,12 +157,12 @@ official `docker-ce` package (named `docker.io` in the docker distribution, you can follow [their documentation to install Docker on Fedora](https://docs.docker.com/engine/install/fedora/). -#### Windows 10 +#### Windows 10 or 11 Zulip's development environment is most easily set up on Windows using the Windows Subsystem for Linux ([WSL 2](https://docs.microsoft.com/en-us/windows/wsl/wsl2-about)) -installation method described here. +installation method described here. We require version 0.67.6+ of WSL 2. 1. Enable virtualization through your BIOS settings. This sequence depends on your specific hardware and brand, but here are [some @@ -170,6 +170,10 @@ installation method described here. 1. [Install WSL 2](https://docs.microsoft.com/en-us/windows/wsl/setup/environment). +1. It is required to enable `systemd` for WSL 2 to manage the database, cache and other services. + To configure it, please follow [this instruction](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#systemd-support). + Then, you will need to restart WSL 2 before continuing. + 1. Launch the Ubuntu shell as an administrator and run the following command: ```bash @@ -225,8 +229,6 @@ installation method described here. start it. (If Windows Firewall creates popups to block services, simply click `Allow Access`.) ```bash - # Start database, cache, and other services - ./tools/wsl/start_services # Install/update the Zulip development environment ./tools/provision # Enter the Zulip Python environment @@ -235,11 +237,6 @@ installation method described here. ./tools/run-dev ``` - :::{note} - If you shut down WSL, after starting it again, you will have to manually start - the services using `./tools/wsl/start_services`. - ::: - 1. If you are facing problems or you see error messages after running `./tools/run-dev`, you can try running `./tools/provision` again. diff --git a/docs/git/cloning.md b/docs/git/cloning.md index fd3d63a862..cd24c01968 100644 --- a/docs/git/cloning.md +++ b/docs/git/cloning.md @@ -99,8 +99,8 @@ If you haven't already, now is a good time to install the Zulip development envi source projects in general, we recommend following our [detailed guide for first-time contributors][zulip-rtd-dev-first-time]. -If you are in the middle of installing the recommended setup on Windows 10, -you are ready to [continue with step 8](../development/setup-recommended.md#windows-10). +If you are in the middle of installing the recommended setup on Windows 10 or 11, +you are ready to [continue with step 9](../development/setup-recommended.md#windows-10-or-11). ## Step 3: Configure continuous integration for your fork diff --git a/tools/wsl/start_services b/tools/wsl/start_services deleted file mode 100755 index e3151ad693..0000000000 --- a/tools/wsl/start_services +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -x -set -e - -# These services are no longer running when WSL is restarted -# and hence they have to be manually started. -sudo service rabbitmq-server start -sudo service memcached start -sudo service redis-server start -sudo service postgresql start