Commit graph

2124 commits

Author SHA1 Message Date
Erik Hennig
bea181f5d5
asan: Add a leak suppression file with known false positives (#32511)
Co-authored-by: Jonas Zeunert <jonas@zeunert.org>
2024-06-17 10:00:22 +00:00
Samson
8b35c4094a
Add --with-asan (#31429) 2024-06-16 09:24:07 +00:00
Jonathan Schwender
43df0a48ee
mach: Use cargo rustc instead of cargo build (#32484)
This allows passing `--crate-type` and rustflags which only apply
to the top-level-crate.
The former is useful to merge the android and ohos apps
into servoshell, while the later may be useful in the
future.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-13 10:03:32 +00:00
Jonathan Schwender
fd472ebd0e
Add cargo-deny to mach-tidy to check license compliance. (#32465)
* Use cargo-deny to check license compliance.

All licenses should be MPL-2.0 or weaker.

* Run cargo-deny check licenses in mach tidy

* fmt

* Fix inverted boolean

* Move cargo deny to tidy.py

* Add quotes around license in error message

* Integrate `cargo-deny` into tidy fully

* Fix script tests

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-12 09:54:45 +00:00
Martin Robinson
f8985c5521
base: Remove ucd dependency (#32424)
Remove the `ucd` dependency which has not been updated in 8 years. In
addition, replace it with a generated UnicodeBlock enum which reflects
the modern Unicode standard. This is generated via a Python script which
is included in the repository. The generation is not part of the build
process, because the Unicode database is hosted on the web and it does
not change the frequently.

This is done instead of bringing in the more up-to-date `unicode_blocks`
dependency. `unicode_blocks` defines each block as constant, which means
that they cannot be used in match statements -- which we do in Servo.

Co-authored-by: Lauryn Menard <lauryn.menard@gmail.com>
2024-06-03 17:10:01 +00:00
Jonathan Schwender
00b77ce73c
mach: Read .servobuild as utf-8 (#32431)
Without this on my windows machine  `open` seems to default
to the `gbk` codec, and then fails to read the file if it
contains Windows style paths (e.g. both `ndk = D:\my_path` or
`ndk = D:\\my_path` cause the `f.read()` to fail ).
2024-06-03 10:54:45 +00:00
Ngo Iok Ui (Wu Yu Wei)
2ca6c4b52b
Document library crates only in mach doc (#32429)
* Document library crates only in mach doc

* Fix typo

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-02 06:59:44 +00:00
Delan Azabani
ff166ea1e3
mach: fix crash when sending notifications on Windows Server 2019 (#32352) 2024-05-23 07:30:32 +00:00
Delan Azabani
d47c8ff2ae
Fix mach bootstrap --skip-platform (#32341) 2024-05-22 06:23:57 +00:00
Mukilan Thiyagarajan
2af6fe0b30
compositor: Move WebRender-ish messages and types to webrender_traits (#32315)
* Move WebRender related types to `webrender_traits`

This refactor moves several WebRender related types
from `compositing_traits`, `script_traits` and `net_traits`
crates to the `webrender_traits` crate.

This change also moves the `Image` type and associated
function out of `net_traits` and into the `pixels` crate.

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Move `script_traits::WebrenderIpcSender` to `webrender_traits::WebRenderScriptApi`

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-05-20 10:35:18 +00:00
Martin Robinson
3398fc017b
Move non-gfx things out of gfx_traits and create a base crate (#32296)
For a long time, `gfx_traits` has held a lot of things unrelated to graphics
and also unrelated to the `gfx` crate (which is mostly about fonts).
This is a cleanup which does a few things:

1. Move non `gfx` crate things out of `gfx_traits`. This is important in
   order to prevent dependency cycles with a different integration between
   layout, script, and fonts.
2. Rename the `msg` crate to `base`. It didn't really contain anything
   to do with messages and instead mostly holds ids, which are used
   across many different crates in Servo. This new crate will hold the
   *rare* data types that are widely used.

Details:

 - All BackgroundHangMonitor-related things from base to a new
   `background_hang_monitor_api` crate.
 - Moved `TraversalDirection` to `script_traits`
 - Moved `Epoch`-related things from `gfx_traits` to `base`.
 - Moved `PrintTree` to base. This should be widely useful in Servo.
 - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it
   to `WebRenderFontApi`.
2024-05-17 12:28:58 +00:00
Samson
b5be89aebc
Update flake8 to work on python3.12 (#32264) 2024-05-09 15:47:01 +00:00
Diego Pino
5298ccb0eb
Skip installing 'clang' if 'clang' binary already exists (#32242)
Simply installing 'clang' installs the default version of Clang for
Linux. For instance, the command: 'apt install clang' installs
'clang-14' in Ubuntu 22.04.

It might be possible that a more recent version of clang is
already installed in the system. For instance, package 'clang-17'.

In the case a 'clang' binary is already installed in the system, skip
the installation of 'clang'.
2024-05-08 04:13:24 +00:00
Samson
383607d01e
Do not use crown when building docs (#32220) 2024-05-04 06:00:00 +00:00
Magnus Larsen
9acf2182cd
servoshell: Upgrade egui and many other dependencies (#31278)
* servoshell: Upgrade `egui` and many other dependencies

This upgrades:
 - `core-graphics`
 - `core-text`
 - `egui` and friends
 - `font-kit`
 - `glow` and friends
 - `harfbuzz-sys`
 - `jni`
 - `nix`
 - `raqote`
 - `raw-window-handle`
 - `winit`

* Downgrade jni until we can properly upgrade

* Update some test results

It's unclear why these are now passing, but they are.

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-05-02 16:21:07 +00:00
Martin Robinson
814bf5b6e8
mach: Upgrade boto3 and remove Python < 3.10 dependencies (#32208)
This change upgrades boto3, which will fix an upcoming urllib3 version
conflict in the WPT and also removes all remaining dependencies for
Python version < 3.10. The requirement for Servo is 3.10 now.

Fixes #32201.
2024-05-01 16:28:14 +00:00
Martin Robinson
4a12c06309
bootstrap: Add a --skip-platform option (#32176)
This allows installign `taplo` and `crown` when you are installing
dependencies manually.
2024-04-29 15:29:11 +00:00
Samson
6ca3bb440e
Run platform_bootstrap first (#31840) 2024-04-29 13:33:12 +00:00
Delan Azabani
bef6c295aa
Stop publishing the Rust book in mach doc and doc.servo.org (#32142) 2024-04-24 07:22:18 +00:00
Martin Robinson
9ee45425e9
ci: Retry hdiutil create with randomize backoff (#32005)
Regularly we see that `hdiutil creat` when creating a DMG on the MacOS
builder fails with "Resource busy." This change is an attempt to
mitigate that by retrying the command 3 time with a randomized backoff.
2024-04-05 10:51:24 +00:00
Ngo Iok Ui (Wu Yu Wei)
66878fb834
Initial internal support for multiple webviews (#31417)
* Add multiple concurrent top-level browsing contexts

Co-authored-by: Delan Azabani <dazabani@igalia.com>

* Rename variables and comments

There are some variable and comments still use browser as names.
This commit renames them to webview.

* Update log message from web view to webview

* Revert offscreen_framebuffer_id rename

* Rename all web view to webview

* Cargo fmt

* Fix viewport/event/clear coordinates when multiview is disabled

* Only deprecate things when multiview is enabled

* Update WebViewManger with shown and invisible sets

Replace visible_webviews and native_window_is_visible with shown_webviews
and invisible_webviews. Add 4 more methods to set them accordingly. The
behavior of is_effectively_visible will return true if the wbview is in
shown_webviews set but not in invisible_webviews.

* Update variant behaviors

* Rename WebViewVisibilityChanged to MarkWebViewInvisible

* Fix unit test by marking id 3 visible again

* Update MarkWebViewInvisible and add UnmarkWebViewInvisible

* Update format and doc comments

* Clean up doc comments

* Address style and naming changes

* Rename UpdateWebView to UpdateFrameTreeForWebView

* constellation: send frame tree unconditionally over focus and feature

* Clarify shown and invisible sets in constellation WebViewManager

* Eliminate forward_to_constellation!()

* Actually remove the unused macro

* Don’t gate compositor changes on multiview feature flag

* Update todo in mouse event dispatch

* Pass all visible webview ids in a single ReadyToPresent message

* Fix compile and lint errors

* servoshell: fix gap between minibrowser toolbar and webview

* Fix failure in /_mozilla/mozilla/window_resizeTo.html

* Fix compile warnings

* Remove stray dbg!()

* Remove confusing “effectively visible” logic (see #31815, #31816)

* Allow embedder to show/hide/raise webviews without ipc

* Update root pipeline only when painting order actually changes

* Stop gating old focus and SetFrameTree behaviour behind Cargo feature

* Use webview_id and WebViewId in webview-related code

* Improve logging of webview-related embedder events

* Allow webview Show and Raise events to optionally hide all others

* Don’t do anything in response to WebViewPaintingOrder

* Remove WebViewPaintingOrder, since its payload is unreliable

* On MoveResizeWebView, only update root pipeline if rect changed

* Rename IOCompositor methods for clarity

* compositor: add event tracing; log webview ops even without ipc

* Add temporary debug logging

* Add more temporary debug logging

* Remove temporary logging in compositor

* Remove temporary debug logging

* Add temporary debug logging, but defer I/O until panic

* Capture a backtrace with each crash log entry

* Proper error handling without panicking in WebViewManager

* Clean up imports in constellation

---------

Co-authored-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-03 11:06:28 +00:00
Samson
8c25336e9a
Override timeout in WebGPU CTS to always be "long" (#31952)
* Long webgpu timeout

* Update expectations

* reupdate expectations 2

* re

* update-webgpu

* Update testing_commands.py with better comment
2024-04-01 08:27:46 +00:00
Martin Robinson
65db6e3b08
wpt: Limit the console output sent to the intermittent tracker (#31895)
This is a speculative fix for #31845. Instead of sending all of the
output to the dashboard, send just the first 1024 characters. This value
can be adjusted in the future if it is too large or too small.

Fixes #31845.
2024-03-27 14:55:00 +00:00
Martin Robinson
2463017c49
tidy: Make sure to run WPT lints when --all is passed to tidy (#31874)
This also fixes the checked in WPT manifest.
2024-03-26 10:47:16 +00:00
Martin Robinson
34dd38b4cb
Replace remutex with parking_lot's ReentrantMutex (#31817)
Many things in Servo depend on `parking_lot`, so we can replace our
homegrown remutex with `parking_lot`'s version.

Fixes #12641.
2024-03-22 08:16:39 +00:00
Martin Robinson
8cf47e6009
bootstrap: Make unknown distro instructions more helpful (#31750)
It doesn't make sense to ask everyone to file a bug if their
distribution is unsupported. We have manual build instructions for some
distributions and we can add instructions for more easily.
2024-03-19 08:43:07 +00:00
Mukilan Thiyagarajan
4bca55e27a
android: add support for x86_64 images (#31725)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-03-18 09:44:10 +00:00
eri
cb3ae70340
Add RUSTC env to clippy command (#31694)
* python: add RUSTC env to clippy command

* fix: pass env explicitly
2024-03-15 11:32:43 +00:00
Delan Azabani
884d024957
Add gstreamer plugins good/ugly for better codec support (#31687)
* NixOS: add gst-plugins-{good,ugly} for better codec support

* Add gstreamer plugins good/ugly to all other package lists
2024-03-15 09:05:26 +00:00
Martin Robinson
6eb96290fa
mach: Speed up taplo runs on MacOS (#31452)
`taplo` is the TOML formatter that we use. It seems to be using a very
slow directory walking mechanism on MacOS. This change works around that
issue by explicitly listing globs of TOML files to format and check.

Before:
```text
real	0m17.632s
user	0m2.164s
sys	0m6.916s
```

After:
```text
real	0m1.519s
user	0m1.391s
sys	0m0.112s
```
2024-02-29 10:03:19 +00:00
Smitty
ffc9730a48
tidy: Fix WHATWG replacement links (#31449) 2024-02-29 06:02:41 +00:00
Martin Robinson
98bd306816
mach: Do not use unstable rust for rustfmt (#31441)
We can use stable rust if we pass the unstable configuration as
command-line arguments to rustfmt itself. This prevents needing to
install an unstable rust toolchain.

The one downside here is that it doesn't seem that "ignore" is
supported so we have to start formatting the files in "third_party."
This shouldn't be a huge issue because we don't plan to check much more
rust code into those directories.
2024-02-28 13:53:04 +00:00
dependabot[bot]
2afd5431b1
build(deps): bump mako from 1.1.2 to 1.2.2 in /python (#31434)
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.1.2 to 1.2.2.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-28 12:43:04 +00:00
Delan Azabani
faf754dfa6
Move Stylo to its own repo (#31350)
* Remove packages that were moved to external repo

* Add workspace dependencies pointing to 2023-06-14 branch

* Fix servo-tidy.toml errors

* Update commit to include #31346

* Update commit to include servo/stylo#2

* Move css-properties.json lookup to target/doc/stylo

* Remove dependency on vendored mako in favour of pypi dependency

This also removes etc/ci/generate_workflow.py, which has been unused
since at least 9e71bd6a70.

* Add temporary code to debug Windows test failures

* Fix failures on Windows due to custom target dir

* Update commit to include servo/stylo#3

* Fix license in tests/unit/style/build.rs

* Document how to build with local Stylo in Cargo.toml
2024-02-27 15:39:06 +00:00
Delan Azabani
e078a99817
style: Remove dependency on servo_config (was #31409) (#31411)
* Initial style_config crate

* Remove servo_config from style

* Remove servo_config from tests/unit/style

* Plumb servo prefs into stylo

* Clean up dependencies

* Fix formatting

* Add unit tests

* Add comment about avoiding clone

* Fix bug where getters acquire unnecessary write lock

* Remove stray dbg!()

* Plumb default prefs into Stylo as well

* Add comments about logging and mapping new pref types
2024-02-23 08:40:54 +00:00
Mukilan Thiyagarajan
8faf6839d3
install libudev-dev required by gamepad API (#31376)
Ubuntu 20.04 does not have libudev-dev causing build
failure when compiling libudev-sys, which is in-turn
needed by gilrs-core. Similarly, nix build also needs
the udev C library.

On Ubuntu 22.04, we don't see the build failures since
the build dependency 'libgstreamer-plugins-base-1.0-dev'
transitively pulls in libudev-dev.

Fixes #31373

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-02-19 12:04:38 +00:00
Martin Robinson
7e9be5ae9f
ci: Merge similar try jobs when possible (#31347)
* ci: Merge similar try jobs when possible

This comes up a lot when triggering wpt-2013 and wpt-2020. Instead of
merging the jobs and triggering both layouts, the try parser will
trigger two separate jobs. Running two of the same builds at once seems
to cause the CI to fail one of them [1]. This fixes that issue.

1. An example of this: 7892269495

* Use a list of fields for merge compatability and add more tests

* Switch from comments to assert messages

* Update python/servo/try_parser.py

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

* Remote 'Ditto'

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

---------

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-02-16 12:21:24 +00:00
Martin Robinson
5facf436f6
mach: Make ./mach try a little friendlier (#31290)
1. Move `./mach try` to `testing_commands.py which is a bit more
   consistent.
2. Make `./mach try` print out the remote name always and properly
   form the URL for ssh repositories.
3. Print out the try configuration matrix to make it more obvious
   what is being triggered remotely.
4. Better error handling. Print and error and exit if the remote isn't
   on GitHub and also clean up properly if something fails after making
   the temporary commit.
2024-02-08 11:40:15 +00:00
Martin Robinson
38b11afb22
bootstrap: More resiliently install Deiban-like platform dependencies (#31281)
1. First check to see if a package is available before trying to install
   it. This means that we always do our best to install everything, but
   don't fail if we cannot.
2. Install crown and taplo first. This means that if the
   platform-specific bits fail, we still install Servo-specific
   dependencies.
2024-02-07 14:21:34 +00:00
atbrakhi
b62d169f0f
Remove duplicate pkg in APT_PKGS (#31280)
We have `libgstreamer-plugins-base1.0-dev` twice in APT_PKGS,
looks like a duplicate, this PR removes the duplicated pkg.
2024-02-07 11:48:04 +00:00
atbrakhi
ba1803d30a
Fix ./mach bootstrap failure in debian (#31276)
Do not install `libgstreamer-plugins-good1.0-dev` on debian,
install only on ubuntu.
2024-02-07 05:18:40 +00:00
Smitty
f27227b1db
Make Android build optional on Nix (#31231)
* Make Android build optional on Nix

I want to build Servo without also installing the entire Android SDK.
This makes it so Android support is only built if `buildAndroid` is
true.

Signed-off-by: syvb <me@iter.ca>

* Add Android support to nix-shell if SERVO_ANDROID_BUILD set

---------

Signed-off-by: syvb <me@iter.ca>
2024-02-02 02:13:24 +00:00
Mukilan Thiyagarajan
04a9b8ca39
Fix bugs in mach test-tidy (#31232)
* mach: test-tidy should return 1 for failure

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* fix lint issues

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* mach: tidy should allow spec links with trailing text

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-01-31 05:50:36 +00:00
arrynfr
271176094d
Update build script to support asahi linux (#31207) 2024-01-28 21:26:38 +00:00
Martin Robinson
bbba839278
Remove the libsimpleservo C API (#31172)
This is unused and unmaintained. It also added a bit of complication
to the build.
2024-01-27 09:19:25 +00:00
Samson
a5c512808a
Matrix in CI and mach try with presets (#31141)
* Matrix in CI and mach try with presets

* small fixups

* names in trigger try run comment

* let

* f

* rename step

* fix running try on win

* fix try branch full

* py3.10

* typo

* Make unit-tests default to false, except in basic os runs

Fixes https://github.com/servo/servo/issues/31174

* make full use linux-wpt & linux-wpt also include unit-tests

so full is equal to main workflow

* Stylish fixes

* cmp json as dict
2024-01-26 12:29:37 +00:00
Martin Robinson
af6652fc09
tests: Add GStreamer library directory to DYLD_LIBRARY_PATH (#31163)
This fixes an issue where the dylib for harfbuzz cannot be found when
running unit tests on some systems, because unit tests don't get their
rpaths adjusted during build. This is quite likely an issue with dylib
dependency management. We just need a bit more exploration of how this
is traditionally handled.
2024-01-24 12:12:05 +00:00
Delan Azabani
eb95703325
constellation: focusing and closing webviews (#30842)
* constellation: focusing, closing, and native window visibility

* rename “browser” to “webview”, “unfocus” to “blur”

* remove native window visibility from constellation

* rename more “browser” to “webview”

* guard clauses

* don’t automatically focus when no webviews are focused

* comment spec steps for window.close()

* use format interpolation

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* fix formatting

* rename “Webview” to “WebView” in types and type parameters

* remove unused method

* fix libsimpleservo

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-01-24 11:45:54 +00:00
Martin Robinson
dc2df7b027
build: Add support for Visual Studio 2022 and VC143 DLLs (#31148)
* build: Add support for Visual Studio 2022 and VC143 DLLs

This change adds supports fot Visual Studio 2022 and the VC143 (current)
version of the Visual Studio CRT. In addition, it reworks the way that
Visual Studio is found, returning all installations in a generator,
separately finding it via vswhere.exe, searching paths, and via
environment variables.

All of these installations are searched for the DLLs with highest
priority given to the highest version of MS Visual Studio installed. The
hope is that this makes the process more robust and properly handles
having multiple versions installed, but only one with the correct
runtime DLLs.

* Update based on review comments

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-01-23 11:04:01 +00:00
Mukilan Thiyagarajan
cf5d9c7a28
ci: fix reference to android job filename in main.yml (#31150)
* ci: fix reference to android job filename in main.yml

* mach: fix build command to handle android

The refactoring done in PR #31092 introduced the call to
get_binary_path in the unconditional path, but did not
pass the android flag to the call.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-01-23 05:37:33 +00:00