Skip to content

Commit a76c926

Browse files
Add documentation for building and running on WSL (#71)
* Add documentation for building and running on WSL Signed-off-by: Astraea Quinn Skoutelli <[email protected]> * Update building-and-running-on-wsl.md Co-authored-by: Josh Matthews <[email protected]> Signed-off-by: Astraea Quinn S <[email protected]> * Update building-and-running-on-wsl.md Co-authored-by: Josh Matthews <[email protected]> Signed-off-by: Astraea Quinn S <[email protected]> --------- Signed-off-by: Astraea Quinn Skoutelli <[email protected]> Signed-off-by: Astraea Quinn S <[email protected]> Co-authored-by: Josh Matthews <[email protected]>
1 parent 6be7cee commit a76c926

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- [Troubleshooting your build](hacking/troubleshooting-your-build.md)
1616
- [Building for Android\*](hacking/building-for-android.md)
1717
- [Building for OpenHarmony](hacking/building-for-openharmony.md)
18+
- [Building and running on WSL](hacking/building-and-running-on-wsl.md)
1819
- [Some basic Rust\*](hacking/some-basic-rust.md)
1920
- [Cargo and crates\*](hacking/cargo-and-crates.md)
2021
- [Working on a crate\*](hacking/working-on-a-crate.md)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Building and Running on WSL
2+
3+
To run non-headless servo shell on WSL, you will most likely need to be on Windows 10 Build 19044+ or Windows 11 as access to WSL v2 is needed for GUI.
4+
5+
## Building
6+
7+
Servo can be built on WSL as if you are building on any other Linux distribution.
8+
9+
1. Setup WSL v2. See [Microsoft's guidelines for setting up GUI apps in WSL](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps).
10+
2. Setup the environment depending on the WSL distribution that you are using (e.g. Ubuntu, OpenSuse, etc)
11+
3. Build
12+
13+
## Running
14+
15+
WSL v2 has the corresponding adaptors to display Wayland and X11 applications, though it may not always work out of the box with Servo.
16+
17+
### Troubleshooting
18+
19+
**Failed to create event loop**:
20+
21+
If you encounter an immediate crash after running that points to winit and its platform implementation, setting `WAYLAND_DISPLAY=''` stops the crash.
22+
23+
```
24+
Failed to create events loop: Os(OsError { line: 81, file: "/home/astra/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.9/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoCompositor)) }) (thread main, at ports/servoshell/desktop/cli.rs:34)
25+
0: servoshell::backtrace::print
26+
at /home/astra/workspace/servo/ports/servoshell/backtrace.rs:18:5
27+
...
28+
18: main
29+
19: <unknown>
30+
20: __libc_start_main
31+
21: _start
32+
Servo was terminated by signal 11
33+
```
34+
35+
Either export the variable, or set it before running:
36+
```shell
37+
export WAYLAND_DISPLAY=''
38+
./mach run
39+
40+
# or
41+
42+
WAYLAND_DISPLAY='' ./mach run
43+
```

0 commit comments

Comments
 (0)