The Servo Browser Engine
Find a file
Manuel Rego Casasnovas ac24cd6139
Update new issue URL in SECURITY.md (#31698)
* Update new issue URL in SECURITY.md

Update URL for new issue so it uses the security template: https://github.com/servo/servo/issues/new?template=security-report.md

* Link to https://github.com/servo/servo/security/advisories/new instead
2024-03-15 15:03:49 +00:00
.cargo Preliminary Android build support (#31086) 2024-01-22 13:00:15 +00:00
.github Update new issue URL in SECURITY.md (#31698) 2024-03-15 15:03:49 +00:00
.vscode Format toml files (#30112) 2023-08-17 15:07:43 +00:00
components Obey white-space when intrinsically sizing an IFC (#31660) 2024-03-15 12:45:23 +00:00
docs Adjust the language used in some of the documentation (#31583) 2024-03-08 14:11:28 +00:00
etc Escaped reporting (#31691) 2024-03-15 10:58:42 +00:00
ports dependencies: Upgrade to WebRender 0.64 (#31486) 2024-03-14 17:40:54 +00:00
python Add RUSTC env to clippy command (#31694) 2024-03-15 11:32:43 +00:00
resources Cleanup UA styles for anonymous table rows and cells (#31661) 2024-03-14 11:53:27 +00:00
support clippy: fix warnings on modules outside components (#31567) 2024-03-07 23:42:39 +00:00
tests Obey white-space when intrinsically sizing an IFC (#31660) 2024-03-15 12:45:23 +00:00
third_party Fix clippy warnings in components/third_party (#31623) 2024-03-12 17:17:23 +00:00
.clang-format Run test-tidy on Windows 2019-11-21 09:56:39 +01:00
.flake8 Improve formatting of Python files (#30919) 2023-12-24 23:58:37 +00:00
.gitattributes Explicitly declare image files to be binaries in .gitattributes, so as to avoid crlf-munging 2019-07-05 09:00:56 -05:00
.gitignore Allow building with Nix on Linux distros other than NixOS (#31001) 2024-01-09 10:29:25 +00:00
.mailmap Update Tetsuharu OHZEKI's entry in mailmap 2019-11-15 00:46:45 +09:00
Cargo.lock dependencies: Upgrade to WebRender 0.64 (#31486) 2024-03-14 17:40:54 +00:00
Cargo.toml dependencies: Upgrade to WebRender 0.64 (#31486) 2024-03-14 17:40:54 +00:00
CLOBBER Add clobber mechanism 2017-05-08 16:19:56 +02:00
CODE_OF_CONDUCT.md Add CoC and Security Policy (#31622) 2024-03-12 11:24:01 +00:00
CONTRIBUTING.md Update branch name to main (#30877) 2023-12-16 09:32:20 +00:00
Info.plist remove bhtml 2018-02-11 08:02:39 +01:00
LICENSE Update MPL license to https (part 1) 2018-11-19 14:46:43 +01:00
mach Make Android build optional on Nix (#31231) 2024-02-02 02:13:24 +00:00
mach.bat Make mach.bat request Python 3 2021-05-22 18:27:10 +09:00
PULL_REQUEST_TEMPLATE.md Minor pull request template cleanup 2018-12-08 13:11:37 -08:00
README.md Add gstreamer plugins good/ugly for better codec support (#31687) 2024-03-15 09:05:26 +00:00
rust-toolchain.toml Fix crown on NixOS (#30987) 2024-01-05 02:15:16 +00:00
rustfmt.toml mach: Do not use unstable rust for rustfmt (#31441) 2024-02-28 13:53:04 +00:00
SECURITY.md Update new issue URL in SECURITY.md (#31698) 2024-03-15 15:03:49 +00:00
servo-tidy.toml dependencies: Upgrade to WebRender 0.64 (#31486) 2024-03-14 17:40:54 +00:00
servobuild.example Preliminary Android build support (#31086) 2024-01-22 13:00:15 +00:00
taplo.toml Format toml files (#30112) 2023-08-17 15:07:43 +00:00

The Servo Parallel Browser Engine Project

Servo is a prototype web browser engine written in the Rust language. It is currently developed on 64-bit macOS, 64-bit Linux, 64-bit Windows, and Android.

Servo welcomes contribution from everyone. See CONTRIBUTING.md and HACKING_QUICKSTART.md for help getting started.

Visit the Servo Project page for news and guides.

Getting Servo

git clone https://github.com/servo/servo
cd servo

Your CARGO_HOME needs to point to (or be in) the same drive as your Servo repository (See #28530).

Build Setup

If these instructions fail or you would like to install dependencies manually, try the manual build setup.

macOS

  • Ensure that the version showed by python --version is >= 3.10:
  • Install Xcode
  • Install Homebrew
  • Run curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Run ./mach bootstrap
    Note: This will install the recommended version of GStreamer globally on your system.

Linux

  • Run curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Install Python (version >= 3.10):
    • Debian-like: Run sudo apt install python3-pip python3-venv
    • Fedora: Run sudo dnf install python3 python3-pip python3-devel
    • Arch: Run sudo pacman -S --needed python python-pip
    • Gentoo: Run sudo emerge dev-python/pip
  • Run ./mach bootstrap

Windows

  • Download and run rustup-init.exe
  • Make sure to select Quick install via the Visual Studio Community installer or otherwise install Visual Studio 2022.
  • In the Visual Studio Installer ensure the following components are installed for Visual Studio 2022:
    • Windows 10 SDK (10.0.19041.0) (Microsoft.VisualStudio.Component.Windows10SDK.19041)
    • MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest) (Microsoft.VisualStudio.Component.VC.Tools.x86.x64)
    • C++ ATL for latest v143 build tools (x86 & x64) (Microsoft.VisualStudio.Component.VC.ATL)
    • C++ MFC for latest v143 build tools (x86 & x64) (Microsoft.VisualStudio.Component.VC.ATLMFC)
  • Install chocolatey
  • Install Python 3.11
  • Run mach bootstrap
    • This will install CMake, Git, and Ninja via choco in an Administrator console. Allow the scripts to run and once the operation finishes, close the new console.
  • Run refreshenv

See also Windows Troubleshooting Tips.

Android

  • Ensure that the following environment variables are set:
    • ANDROID_SDK_ROOT
    • ANDROID_NDK_ROOT: $ANDROID_SDK_ROOT/ndk/25.2.9519653/ ANDROID_SDK_ROOT can be any directory (such as ~/android-sdk). All of the Android build dependencies will be installed there.
  • Install the latest version of the Android command-line tools to $ANDROID_SDK_ROOT/cmdline-tools/latest.
  • Run the following command to install the necessary components:
    sudo $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install
     "build-tools;33.0.2" \
     "emulator" \
     "ndk;25.2.9519653" \
     "platform-tools" \
     "platforms;android-33" \
     "system-images;android-33;google_apis;x86_64"
    

For information about building and running the Android build, see the Android documentation.

Building

Servo is built with Cargo, the Rust package manager. We also use Mozilla's Mach tools to orchestrate the build and other tasks. You can call Mach like this:

On Unix systems:

./mach [command] [arguments]

On Windows Commandline:

mach.bat [command] [arguments]

The examples below will use Unix, but the same applies to Windows.

The Rust compiler

Servo's build system uses rustup.rs to automatically download a Rust compiler. This is a specific version of Rust Nightly determined by the rust-toolchain.toml file.

Normal build

To build Servo in development mode. This is useful for development, but the resulting binary is very slow:

./mach build --dev
./mach run tests/html/about-mozilla.html

Release build

For benchmarking, performance testing, or real-world use. Add the --release flag to create an optimized build:

./mach build --release
./mach run --release tests/html/about-mozilla.html

Android build

For an armv7 Android build run the following command.

./mach build --android

Checking for build errors, without building

If youre making changes to one crate that cause build errors in another crate, consider this instead of a full build:

./mach check

It will run cargo check, which runs the analysis phase of the compiler (and so shows build errors if any) but skips the code generation phase. This can be a lot faster than a full build, though of course it doesnt produce a binary you can run.

Running

Run Servo with the command:

./servo [url] [arguments] # if you run with nightly build
./mach run [url] [arguments] # if you run with mach

# For example
./mach run https://www.google.com

Commandline Arguments

  • -p INTERVAL turns on the profiler and dumps info to the console every INTERVAL seconds
  • -s SIZE sets the tile size for painting; defaults to 512
  • -z disables all graphical output; useful for running JS / layout tests
  • -Z help displays useful output to debug servo

Keyboard Shortcuts

  • Ctrl+L opens URL prompt (Cmd+L on Mac)
  • Ctrl+R reloads current page (Cmd+R on Mac)
  • Ctrl+- zooms out (Cmd+- on Mac)
  • Ctrl+= zooms in (Cmd+= on Mac)
  • Alt+left arrow goes backwards in the history (Cmd+left arrow on Mac)
  • Alt+right arrow goes forwards in the history (Cmd+right arrow on Mac)
  • Esc or Ctrl+Q exits Servo (Cmd+Q on Mac)

Runtime dependencies

Linux

  • GStreamer >=1.18
  • gst-plugins-base >=1.18
  • gst-plugins-good >=1.18
  • gst-plugins-bad >=1.18
  • gst-plugins-ugly >=1.18
  • libXcursor
  • libXrandr
  • libXi
  • libxkbcommon
  • vulkan-loader

Developing

There are lots of mach commands you can use. You can list them with ./mach --help.

The generated documentation can be found on https://doc.servo.org/servo/index.html