Giter Site home page Giter Site logo

servo's Introduction

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 (#28530).
  • The Servo repository is big! If you have an unreliable network connection, consider making a shallow clone.

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 you’re 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 doesn’t 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

servo's People

Contributors

bholley avatar borischiou avatar bors-servo avatar brson avatar canova avatar cybai avatar dependabot-preview[bot] avatar dependabot[bot] avatar emilio avatar ferjm avatar frewsxcv avatar gw3583 avatar heycam avatar jdm avatar kichjang avatar kmcallister avatar larsbergstrom avatar loirooriol avatar manishearth avatar mbrubeck avatar metajack avatar mrobinson avatar ms2ger avatar nox avatar paulrouget avatar pcwalton avatar servo-wpt-sync avatar simonsapin avatar tetsuharuohzeki avatar upsuper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

servo's Issues

rustc compatibility?

I've been trying for weeks, every few days, latest servo master and latest incoming branch of rust but I keep on getting rustc compile errors so I must be doing something wrong!

Ubuntu 12.04, this is one that I've been seeing a bit and am getting on today's servo/master & rust/incoming of but it's not the only one I've seen:

rustc  -O -L ../mozjs/ /home/rvagg/git/servo/src/rust-mozjs/js.rc -o js-test --test
/home/rvagg/git/servo/src/rust-mozjs/name_pool.rs:24:12: 24:17 error: expected `;` or `}` after expression but found `c_str`
/home/rvagg/git/servo/src/rust-mozjs/name_pool.rs:24         ret c_str; // ...and so this ptr ought to be valid.

I really want this baby to compile! Suggestions?

Ref tests leak dom nodes

For some reason, running the ref tests (the png compositor) ends up leaking dom nodes, while the screen compositor does not. If I comment out the following lines in content_task it does not leak:

            let compartment = option::expect(self.compartment, ~"TODO error checking");                                                                        
            compartment.define_functions(debug_fns);                                                                                                           
            define_bindings(*compartment,                                                                                                                      
                            option::get(self.document),                                                                                                        
                            option::get(self.window));   

I have a 127 error

compile: rt/i686-unknown-linux-gnu/arch/i386/_context.o
/bin/sh: 1: /home/projects/rust/build-incoming/llvm/i686-unknown-linux-gnu/Release+Asserts/bin/llvm-mc: not found
make: *** [rt/i686-unknown-linux-gnu/arch/i386/_context.o] Error 127

How can I solve this problem??
When I make the rust source, it happens

Clean up core text / core graphics bindings

Some of the CG bindings are in rust-cocoa. They should be moved to rust-core-graphics, and rust-cocoa removed from servo. quartz_native_font contains some core text bindings that should be moved to rust-core-text.

They all need high-level bindings that manage destruction properly.

rename RCU to COW

our technique isn't actually particularly related to RCU from the kernel. It's more like copy-on-write.

no io::WriterUtil

rustc -O -L ../mozjs/ /media/debian-home/nadav/projects/servo/src/rust-mozjs/js.rc -o js-test --test
/media/debian-home/nadav/projects/servo/src/rust-mozjs/js.rs:6:7: 6:22 error: failed to resolve import
/media/debian-home/nadav/projects/servo/src/rust-mozjs/js.rs:6 import io::WriterUtil;
^~~~~~~~~~~~~~~
/media/debian-home/nadav/projects/servo/src/rust-mozjs/global.rs:45:11: 45:26 error: failed to resolve import
/media/debian-home/nadav/projects/servo/src/rust-mozjs/global.rs:45 import io::WriterUtil;
^~~~~~~~~~~~~~~
error: failed to resolve imports

Store image futures in display list instead of images

At the moment, the display list builder requests images from the image decoder then stores them in the display list, causing all image decoding to be sequential. Instead, we should request the image, then store a future in the display list for the renderer to wait on later.

Need to rewrite core::future to be sendable.

Fail to build on Mac OS X 10.7

Making all in shaping
make[4]: Nothing to be done for `all'.
make[4]: Nothing to be done for `all-am'.
make[3]: Nothing to be done for `all-am'.
make check -C src/rust-harfbuzz RUSTFLAGS="-L ../harfbuzz/src/.libs/"
rustc -L ../harfbuzz/src/.libs/ /Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rc -o harfbuzz-test --test
/Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rs:7:22: 7:30 error: unresolved typename: uint32_t
/Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rs:7 type hb_codepoint_t = uint32_t;
/Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rs:9:21: 9:28 error: unresolved typename: int32_t
/Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rs:9 type hb_position_t = int32_t;
/Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rc:1:0: 1:0 note: 'i32' is imported here
/Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rc:1 #[link(name = "harfbuzz",
/Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rc:7:7: 7:35 note: 'i32' is imported here
/Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rc:7 import libc::types::common::c99::*;
/Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rs:13:27: 13:30 error: 'i32' is glob-imported from multiple different modules.
/Users/ramitos/servo/src/rust-harfbuzz/harfbuzz.rs:13 type union__hb_var_int_t = i32;
make[1]: *** [harfbuzz-test] Error 101
make: *** [check-rust-harfbuzz] Error 2

build fails on ubuntu 12.04 "I need autoconf 2.13"

any way to avoid this problem? (other than building autoconf 2.13?)

autoconf --version
autoconf (GNU Autoconf) 2.68

if building that specific version is the only solution maybe a section in the readme to do it the least intrusive way for the rest of the system would be nice :)

Pick a license

Servo still does not claim to be distributed under any license. There are probably only two options, MIT (the Rust license) and MPL.

We do have an OFL licensed font in the repo.

branch incoming failed build: llvm-mc: not found

compile: rt/i686-unknown-linux-gnu/arch/i386/_context.o
/bin/sh: 1: /home/projects/rust/build-incoming/llvm/i686-unknown-linux-gnu/Release+Asserts/bin/llvm-mc: not found
make: *** [rt/i686-unknown-linux-gnu/arch/i386/_context.o] Error 127
cfg: shell host triple i686-unknown-linux-gnu
cfg: host for i686-unknown-linux-gnu is i386
cfg: unix-y environment
cfg: using gcc
cfg: no pandoc found, omitting doc/rust.pdf
cfg: no llnextgen found, omitting grammar-verification
cfg: no pandoc found, omitting library doc build
cfg: including install rules
compile: rt/i686-unknown-linux-gnu/arch/i386/_context.o
/bin/sh: 1: /home/projects/rust/build-incoming/llvm/i686-unknown-linux-gnu/Release+Asserts/bin/llvm-mc: not found
make: *** [rt/i686-unknown-linux-gnu/arch/i386/_context.o] Error 127

Switch from cairo to skia

Let's do it before we get to locked in. The version of azure that we're on won't do a standalone skia build because it has dependencies on gecko internals, but we need to upgrade azure again anyway.

Let's also build skia in-tree. Not building cairo in tree results in problems on os x.

Support TESTNAME env var in makefiles

Rust's makefiles can narrow down the tests run using TESTNAME, but servo doesn't support this. Requires editing makefiles of all the subprojects too.

Add an HTML parsing test harness

Similar to ref tests, I think we should use WebDriver to get Firefox to serialize the DOM, serialize servo's DOM in the same format, and compare.

Fix reftest

Since the latest round of churn it always fails to open the test files.

make check failed: Segmentation fault (core dumped) rust-http-client

current trunk servo , rust (servo:82de5c89ac9ad79591a5bb249075825ae4d59a51 Thu 23 Aug 2012 02:49:22 AM IDT, rust:8ee79c79aada1b5943b5ada11570f9b903c74579 Tue 21 Aug 2012 08:00:06 AM IDT)

running 6 tests
test test_simple_response ... ignored
test request::should_request_slash_when_path_is_empty ... ok
make[1]: *** [check] Segmentation fault (core dumped)
make[1]: Leaving directory servo/build/src/rust-http-client'
make: *** [check-rust-http-client] Error 2

harfbuzz build fails on libharfbuzz_la-hb-blob.lo

I have no idea what I'm doing, but this is something:
https://gist.github.com/2879750

make[3]: Entering directory `/code/servo/build/src/harfbuzz/src'
  GEN hb-gobject-enums.cc
  GEN hb-ot-shape-complex-indic-machine.hh
  GEN /code/servo/src/harfbuzz/src/.gitignore
make all-am
make[4]: Entering directory `/code/servo/build/src/harfbuzz/src'
  CXX libharfbuzz_la-hb-blob.lo
mv: cannot stat `.deps/libharfbuzz_la-hb-blob.Tpo': No such file or directory
make[4]: *** [libharfbuzz_la-hb-blob.lo] Error 1

(I'm running Ubuntu 12.04 64-bit, by the way, and rustc aabf84c.)

Replace makefiles with cargo

Rust + recursive Makefiles is pretty lame experience.

I prefer to use a Rust-based build system that doesn't yet exist. Would be good for the health of cargo.

Remove parallel layout

It is very unsafe code, using shared boxes across multiple tasks. I think proceeding with this sort of design without figuring out a way to encapsulate the unsafety better will make maintenance and debugging difficult. We should back off of this approach for now.

Build failed on Snow Leopard

I installed latest rust

WCLui-iMac:build WCL$ rustc -v
rustc 0.4 (9c98d0f 2012-09-08 20:04:21 -0700)

host: x86_64-apple-darwin

Installed all dependencies as illustrated in

https://github.com/mozilla/servo/blob/master/README.md

pulled latest servo from git. But I am getting build failed with rust-cocoa.

Error :

$ make check && make
make check -C src/rust-cocoa
cc /Users/WCL/servoGit/servo/src/rust-cocoa/msgsend.c -o msgsend.o -c
ar rcs libmsgsend.a msgsend.o
rustc /Users/WCL/servoGit/servo/src/rust-cocoa/cocoa.rc -o cocoa-test --test
warning: no debug symbols in executable (-arch x86_64)
./cocoa-test

running 2 tests
doSomething
test base::test_custom_obj ... ok
nsapp: 4324354752
test base::test_nsapp ... ok

result: ok. 2 passed; 0 failed; 0 ignored

make check -C src/rust-core-foundation
rustc /Users/WCL/servoGit/servo/src/rust-core-foundation/core_foundation.rc -o rustcorefoundation-test --test
/Users/WCL/servoGit/servo/src/rust-core-foundation/number.rs:25:20: 25:24 error: obsolete syntax: lower-case kind bounds
/Users/WCL/servoGit/servo/src/rust-core-foundation/number.rs:25 fn new_number<T:copy ConvertibleToCFNumber>(n: T) -> CFNumber {
^~~~
note: the send, copy, const, and owned kinds are represented as traits now, and should be camel cased
error: aborting due to previous error
make[1]: *** [rustcorefoundation-test] Error 101
make: *** [check-rust-core-foundation] Error 2

any Idea what wrong. I tried reinstalling rust several times, and tried building servo many time but same error.

Thanks for help.

Need sandboxing library

We want to fit sandboxing into the design earlier than later. We can start with a simple seccomp sandbox with some IPC that looks something like Rust pipes. That should be enough for sandboxing image decoders at least.

test-js-image.html no longer animates

I've checked and the timers are functioning, and the JS callback is executing successfully (according to the return value, at least). Something's changed.

mv: cannot move `servo/src/libparserutils/src/charset/aliases.inc' to `src/charset': No such file or directory

current trunk servo , rust (servo:82de5c89ac9ad79591a5bb249075825ae4d59a51 Thu 23 Aug 2012 02:49:22 AM IDT, rust:8ee79c79aada1b5943b5ada11570f9b903c74579 Tue 21 Aug 2012 08:00:06 AM IDT)

servo/src/rust-http-client/http_client.rs:246:11: 246:18 warning: implicitly copying a non-implicitly-copyable value
servo/src/rust-http-client/http_client.rs:246 return events;
^~~~~~~
touch libhttp_client.dummy
make[1]: Leaving directory servo/build/src/rust-http-client' make -C src/libparserutils make[1]: Entering directoryservo/build/src/libparserutils'
cd servo/src/libparserutils && perl build/make-aliases.pl
mv servo/src/libparserutils/src/charset/aliases.inc src/charset
mv: cannot move servo/src/libparserutils/src/charset/aliases.inc' tosrc/charset': No such file or directory
make[1]: *
* [src/charset/aliases.inc] Error 1
make[1]: Leaving directory `servo/build/src/libparserutils'
make: *** [src/libparserutils/libparserutils.dummy] Error 2

"make check" Error with OS X Lion 10.7.4 "make[1]: *** [cocoa-test] Error 101"

make check

make check -C src/rust-cocoa
rustc  /Users/user/servo/src/rust-cocoa/cocoa.rc -o cocoa-test --test
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
make[1]: *** [cocoa-test] Error 101
make: *** [check-rust-cocoa] Error 2

RUST_LOG=rustc=0,::rt::backtrace rustc /Users/user/servo/src/rust-cocoa/cocoa.rc -o cocoa-test --test

rust: task failed at 'Assertion res as int != 0 failed', /Users/user/rust/src/libcore/flate.rs:48
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/user/rust/src/rustc/driver/rustc.rs:265
rust: domain main @0x7fc819800010 root task failed
rust: task failed at 'killed', /Users/user/rust/src/libcore/task.rs:549

Improve HTML parsing

We haven't decided for sure whether we want to use a Java->Rust translation of the reference parser, or to use a handwritten one in Rust. Either way we need something a lot better than what we have.

The easiest way to get started so to just start extending the existing handwritten one.

Needs a decent testing strategy.

images need be fetched via ResourceTask

images are loaded by apply_style directly from disk. In order to use the resource manager to load the image we need to know the url of the current document (in order to resolve relative paths), and that url isn't available to the layout task currently.

It seems like layout shouldn't be responsible for loading images anyway, so something needs to be reconsidered here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.