The Servo Browser Engine
Find a file
dependabot[bot] 3fba332316
build(deps): bump bytemuck from 1.14.0 to 1.14.1 (#31176)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.14.0 to
1.14.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Lokathor/bytemuck/blob/main/changelog.md">bytemuck's
changelog</a>.</em></p>
<blockquote>
<h2>1.14.1</h2>
<ul>
<li>docs clarifications.</li>
</ul>
<h2>1.14</h2>
<ul>
<li><code>write_zeroes</code> and <code>fill_zeroes</code> functions:
Writes (to one) or fills (a slice)
zero bytes to all bytes covered by the provided reference. If your type
has
padding, this will even zero out the padding bytes.</li>
<li><code>align_offset</code> feature: causes pointer alignment checks
to use the
<code>align_offset</code> pointer method rather than as-casting the
pointer to <code>usize</code>.
This <em>may</em> improve codegen, if the compiler would have otherwise
thought that
the pointer address escaped. No formal benchmarks have been done either
way.</li>
<li><code>must_cast</code> feature: Adds <code>must_*</code> family of
functions. These functions will
fail to compile if the cast requested can't be statically known to
succeed.
The error messages can be kinda bad when this happens, but eliminating
the
possibility of a runtime error might be worth it to you.</li>
</ul>
<h2>1.13.1</h2>
<ul>
<li>Remove the requirement for the <em>source</em> data type to be
<code>AnyBitPattern</code> on
<code>pod_collect_to_vec</code>, allowing you to pod collect vecs of
<code>char</code> into vecs of
<code>u32</code>, or whatever.</li>
</ul>
<h2>1.13</h2>
<ul>
<li>Now depends on <code>bytemuck_derive-1.4.0</code></li>
<li>Various small enhancements that would have been patch version
updates, but
which have been rolled into this minor version update.</li>
</ul>
<h2>1.12.4</h2>
<ul>
<li>This has additional impls for existing traits and cleans up some
internal code,
but there's no new functions so I guess it counts as just a patch
release.</li>
</ul>
<h2>1.12.3</h2>
<ul>
<li>This bugfix makes the crate do stuff with <code>Arc</code> or not
based on the
<code>target_has_atomic</code> config. Previously, some targets that
have allocation but
not atomics were getting errors. This raises the MSRV of the
<code>extern_crate_alloc</code> feature to 1.60, but opt-in features are
<em>not</em> considered
to be hard locked to 1.34 like the basic build of the crate is.</li>
</ul>
<h2>1.12.2</h2>
<ul>
<li>Fixes <code>try_pod_read_unaligned</code> bug that made it always
fail unless the target
type was exactly pointer sized in which case UB <em>could</em> happen.
The
<code>CheckedBitPattern::is_valid_bit_pattern</code> was being asked to
check that a
<em>reference</em> to the <code>pod</code> value was a valid bit
pattern, rather than the actual
bit pattern itself, and so the check could in some cases be
illegally</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1e1a22e5ea"><code>1e1a22e</code></a>
chore: Release bytemuck version 1.14.1</li>
<li><a
href="2ae1a14a3f"><code>2ae1a14</code></a>
changelog</li>
<li><a
href="8dc32b1e50"><code>8dc32b1</code></a>
Explicitly document that pod_read_unaligned and try_pod_read_unaligned
don't ...</li>
<li><a
href="085a5f573e"><code>085a5f5</code></a>
Revise the crate-level docs.</li>
<li><a
href="c705218630"><code>c705218</code></a>
Added custom crate path with tests (<a
href="https://redirect.github.com/Lokathor/bytemuck/issues/209">#209</a>)</li>
<li><a
href="fd27a5b018"><code>fd27a5b</code></a>
Add from_box_bytes and box_bytes_of with BoxBytes type (<a
href="https://redirect.github.com/Lokathor/bytemuck/issues/211">#211</a>)</li>
<li><a
href="d10fbfc6ff"><code>d10fbfc</code></a>
allow deriving <code>CheckedBitPattern</code> for enums with fields (<a
href="https://redirect.github.com/Lokathor/bytemuck/issues/171">#171</a>)</li>
<li>See full diff in <a
href="https://github.com/Lokathor/bytemuck/compare/v1.14.0...v1.14.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bytemuck&package-manager=cargo&previous-version=1.14.0&new-version=1.14.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-25 17:11:45 +00:00
.cargo Preliminary Android build support (#31086) 2024-01-22 13:00:15 +00:00
.github build: Add support for Visual Studio 2022 and VC143 DLLs (#31148) 2024-01-23 11:04:01 +00:00
.vscode Format toml files (#30112) 2023-08-17 15:07:43 +00:00
components layout: Shape text only once (#31146) 2024-01-25 14:33:47 +00:00
docs Fix crown on NixOS (#30987) 2024-01-05 02:15:16 +00:00
etc Preliminary Android build support (#31086) 2024-01-22 13:00:15 +00:00
ports constellation: focusing and closing webviews (#30842) 2024-01-24 11:45:54 +00:00
python tests: Add GStreamer library directory to DYLD_LIBRARY_PATH (#31163) 2024-01-24 12:12:05 +00:00
resources Add support for table fixups (#30868) 2023-12-22 12:11:58 +00:00
support build: Add support for Visual Studio 2022 and VC143 DLLs (#31148) 2024-01-23 11:04:01 +00:00
tests Implement Event.composedPath (#31123) 2024-01-23 14:56:01 +00:00
third_party Use Int8array, int16array, uint16array, int32array & uint32array in WebIDL (#31164) 2024-01-25 14:28:43 +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 build(deps): bump bytemuck from 1.14.0 to 1.14.1 (#31176) 2024-01-25 17:11:45 +00:00
Cargo.toml Preliminary Android build support (#31086) 2024-01-22 13:00:15 +00:00
CLOBBER Add clobber mechanism 2017-05-08 16:19:56 +02:00
CONTRIBUTING.md Update branch name to main (#30877) 2023-12-16 09:32:20 +00:00
dependencyci.yml Don't report smallbitvec as an error. 2017-10-16 11:38:34 -04: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 Allow building with Nix on Linux distros other than NixOS (#31001) 2024-01-09 10:29:25 +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 build: Add support for Visual Studio 2022 and VC143 DLLs (#31148) 2024-01-23 11:04:01 +00:00
rust-toolchain.toml Fix crown on NixOS (#30987) 2024-01-05 02:15:16 +00:00
rustfmt.toml Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
servo-tidy.toml Preliminary Android build support (#31086) 2024-01-22 13:00:15 +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.

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, Ninja, via choco in an
    • 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.

Cloning the Repo

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

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

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

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.

Building for Android target

Prerequisites: Servo's build system assumes that both the Android SDK & NDK are already installed and expects the paths to be specified via the environment variables ANDROID_SDK_ROOT and ANDROID_NDK_ROOT.

Servo also expects the following components are installed via sdkmanager:

For building:

sdkmanager install platform-tools platforms;android-33

To run in emulator, also install the related components:

sdkmanager install emulator system-images;android-33;google_apis;x86

Build commands: For ARM (armv7-linux-androideabi, most phones):

./mach build --release --android
./mach package --release --android

For x86 (typically for the emulator):

./mach build --release --target i686-linux-android
./mach package --release --target i686-linux-android

Install the APK to the device or emulator:

./mach install --release --android

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.16
  • gst-plugins-bad >=1.16
  • 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