Commit graph

2036 commits

Author SHA1 Message Date
Mukilan Thiyagarajan
0615428aa9
android: fix application name used in ./mach run (#32652)
This patch also switches the code to python format strings
so that the application name can be interpolated where
needed.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-01 08:10:00 +00:00
Martin Robinson
e331cc67c3
mach: Expose a --skip-static-analysis to mach boostrap (#32587)
This should speed up runners which just need to run the WPT tests.

Fixes #32582.
2024-06-24 17:13:09 +00:00
Martin Robinson
30dad2565f
android: Rename the Android app to reflect servo.org ownership and servoshell (#32554)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-06-24 15:39:57 +00:00
Jonathan Schwender
26bbfe9b55
Make crown optional (#32494)
* Make `crown` optional

Add the optional `--use-crown` flag to mach

* --use-crown for all platforms in CI

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Add documentation for `--use-crown`

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Update python/servo/command_base.py

Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Raise Error if CARGO_BUILD_RUSTC conflicts with --use-crown

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* add dummy RUSTFLAG to trigger re-checking

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
2024-06-24 11:46:43 +00:00
Martin Robinson
cd2ab36759
Rename gfx to fonts (#32556)
This crate only takes care of fonts now as graphics related things are
split into other crates. In addition, this exposes data structures at
the top of the crate, hiding the implementation details and making it
simpler to import them.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-19 20:26:19 +00:00
Mukilan Thiyagarajan
4803514196
mach: fix test-tidy to handle missing merge commit (#32551)
This restores the behaviour prior to #32540 where the case where no
merge commit being found (which happens on CI in forks because we do
a shallow clone) is handled as if no changes where found.

Fixes #32550.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-19 07:01:58 +00:00
Jonathan Schwender
24906e1c21
Move android port code to servoshell (#32533)
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-19 03:34:08 +00:00
Martin Robinson
946e41e59d
ci: Use a servo.org email address for the servo-wpt-sync GitHub bot (#32515)
This is the new address of the WPT sync bot.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-06-18 16:38:26 +00:00
Martin Robinson
4a7f3bac7c
Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
Mukilan Thiyagarajan
42b09d483f
mach: fix test-tidy to not skip Cargo.lock (#32540)
PR #32465 broke the lint because it initializes FileList with a
file name (./Cargo.lock). This causes it to always return an empty
list when the `only_changed_files` parameter is `False` since `os.walk`
requires a directory and not a file.

Fixes #32530.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-18 07:39:38 +00:00
Jonathan Schwender
79cd87a3c3
Fix android build on Fedora 40. (#32532)
* Postfix PATH with android toolchain:
  We only need to edit path for the linker specified
  in the `.cargo/config.toml` to be found. Adding the
  NDK clang to the end of PATH is sufficient for that.
  Adding the NDK clang to the front can cause problems
  however, since it causes the NDK `clang` to be
  preferred over the system clang. This can cause
  problems on some systems, where compiling
  e.g. buildscripts for HOST subsequently fails.
* Prefix target compiler and compiler flags variables
  with `TARGET_` so as not to influence compilation
  for HOST targets.
 * SET `CLANG_PATH` to avoid [bindgen #2682]

 [bindgen #2682]: https://github.com/rust-lang/rust-bindgen/issues/2682

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-18 04:15:29 +00:00
Jonathan Schwender
3381f2a704
Add OpenHarmony support to mach and CI (#32507)
* Add ohos to mach

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Add OpenHarmony build to CI

* Rename ohos sdk action

I decided to rename the upstream ohos sdk action to
setup-ohos-sdk, making it clearer that is a github
action repository.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Remove commented line

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-17 11:27:23 +00:00
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