The book was changed, so we need to update the link to the new location.
Testing: Only changes comment. Reviewers can review by following the new
link.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
I never forget that day: @dependabot updates aws-lc-rs, and
cross-compilation Servo from Windows fails. We were left with two
options:
1. Get a local clone of aws-lc-rs, and modify it in a hacky way
2. Use Git Bash, but still has to set up MSYS2 etc.
Later, we've been restricted since #36070 to only use option 2 due to
restrictions imposed here. But the system is innocent, and it is
aws-lc-rs's responsibility to fix the rules. Still, @d-desiatkin and I
believed that day would come, when we would return justice to the
victim.
Freedom is better served late than never. It is now working normally
since aws-lc-rs has fixed the rules.
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
The variable is not used anywhere and `_platform_bootstrap_gstreamer`
raises an error telling the user to install gstreamer via their package
manager on Linux.
Hence, we can just remove it.
Testing: Trivial, not required.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Nowadays Servo automatically loads system default proxy. It has enabled
my NSA colleagues to visit external networks without modifying transport
layer, whereas `test-wpt` has been failing after it.
We disable the proxy unless users know what they are doing.
Testing: Tested in different physical locations with different proxy
networks.
Fixes: #41440
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This new lint checks for some easy mistakes to make with the annotation
format.
Testing: New unit tests added.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This just fixes a typo:
`download_run_resultsa_and_then_run_update` ->
`download_run_results_and_then_run_update`
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This change allows `./mach update-wpt` to accept a URL to a GitHub
Action run. If a URL is passed, it will attempt to download the stable
unexpected results from the run and update the expected test results.
Note that this currently requires having the `gh` command-line tool
installed and authenticated. Although you can download artifacts without
logging in via the web interface, doing this via the API requires an
access token.
Testing: This change adds a unit test for the regex that matches GitHub
Action URLs.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Properly handle empty commit messages when processing commits during WPT
export. We shouldn't be landing commits with empty messages into Servo,
but sometimes when a PR is in process, the body is empty. In those
cases, this change avoids an error during job execution.
Signed-off-by: chenura999 <chenuraoshada396@gmail.com>
Implements #40502
Adds `--yes` flag to mach bootstrap command which confirms installation
of all required packages.
Unlike `--force` flag (which also does that) it does NOT reinstall all
packages but only confirms them (if required at all).
Test on Ubuntu 24.04.2 LTS by removing safe development packages like
`libgstrtspserver-1.0-dev libges-1.0-dev gstreamer1.0-tools` and run
`mach bootstrap` twice to observe if `--yes` flags automatically install
all dependencies.
With this flag all dependencies were installed with any interaction but
removing some dependencies and running `./mach bootstrap` prompted me to
confirm `apt-get install` action.
---------
Signed-off-by: MCozhusheck <mackozuszek@gmail.com>
This PR introduces a new storage coordination thread, intended to serve
as the central point for managing all current and future storage
endpoints in Servo.
In addition to the new coordination thread, this PR also lays the
infrastructure required to develop a parallel, next-generation IndexedDB
implementation under the indexeddb_next feature flag living on a
separate branch.
Testing: Unit and WPT tests continue to pass
---------
Signed-off-by: Jan Varga <jvarga@igalia.com>
On NixOS, dynamically linked binaries from the Python venv (installed
via uv/pip) cannot run directly because they expect standard Linux
library paths that don't exist on NixOS.
This commit adds FHS wrappers that allow these binaries to run in an
FHS-compatible environment at runtime, without patching them.
I considered using the nixpkgs versions of ruff and pyrefly directly, or
overriding their derivations to match the versions in requirements.txt.
However, decided against it because:
- Version mismatches between nixpkgs and requirements.txt caused type
checking incompatibilities (pyrefly 0.34.0 vs 0.23.1)
- Building these tools from source in nix is slow and adds significant
time to nix-shell initialization (both are rust packages that take quite
some time to build)
Testing: just improvements to the NixOS development environment, no test
needed
**Before:**
```
➜ servo (main) ✔ nix-shell
➜ servo (main) ✔ ./mach fmt
Could not start dynamically linked executable: /home/dyego/coding/random/servo/.venv/bin/ruff
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
➜ servo (main) ✔ ./mach test-tidy
➤ Checking config file (./servo-tidy.toml)...
➤ Checking directories for correct file extensions...
Could not start dynamically linked executable: ruff
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
Error running mach:
['test-tidy']
The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
File "/home/dyego/coding/random/servo/python/servo/testing_commands.py", line 322, in test_tidy
tidy_failed = tidy.scan(not all_files, not no_progress, github_annotations)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dyego/coding/random/servo/python/tidy/tidy.py", line 919, in scan
for error in errors:
File "/home/dyego/coding/random/servo/python/tidy/tidy.py", line 401, in check_ruff_lints
for error in json.loads(e.output):
^^^^^^^^^^^^^^^^^^^^
File "/nix/store/2g9b898aq9kmizmhmhbdip5mixrc5wrk-python3-3.11.14/lib/python3.11/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/2g9b898aq9kmizmhmhbdip5mixrc5wrk-python3-3.11.14/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/2g9b898aq9kmizmhmhbdip5mixrc5wrk-python3-3.11.14/lib/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
➜ servo (main) ✔
```
(note that the `JSONDecodeError` is because we're trying to parse the
"NixOS cannot run dynamically linked executables intended..." string as
JSON)
**Now:**
```
➜ servo (fix-nix-mach) ✔ nix-shell
➜ servo (fix-nix-mach) ✔ ./mach fmt
➜ servo (fix-nix-mach) ✔ ./mach test-tidy
➤ Checking config file (./servo-tidy.toml)...
➤ Checking directories for correct file extensions...
➤ Checking type annotations in python files ...
➤ Skipping WPT lint checks, because no relevant files changed.
➤ Running `cargo-deny` checks...
➤ Checking formatting of Rust files...
➤ Checking formatting of python files...
➤ Checking formatting of toml files...
✅ test-tidy reported no errors.
➜ servo (fix-nix-mach) ✔
```
Signed-off-by: Dyego Aurélio <dyegoaurelio@gmail.com>
The current user stylesheet use in our tests is a hack that hides real
issues like #40419. Any test that requires ahem.ttf needs to include the
stylesheet like any other webpage.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
The current logic treats the explict version of release and dev build
specification i.e the `--profile release` and `--profile dev` options as
custom profiles. This breaks other logic that explictly check for
release and dev profile types, like the android build.
Normalize the `--profile` argument so that the strings `release` and
`dev` are treated correctly as `BuildType.Kind.RELEASE` and
`BuildType.Kind.DEV` respectively.
Fixes: #40752
Testing: Tested manually that building android with `--profile release`
creates the correct directory structure.
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Support for sending build notifications was removed in #37818, but the
dependency in `requirements.txt` was not removed. This PR fixest that.
Testing: This change just removes an unsued build dependency, so no
testing is necessary.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This should help identify flaky unit tests, since codecov will gather
statistics of tests (of the last 60 days) and allow us to easily
identify flaky unit-tests. [Test page on
codecov](https://app.codecov.io/github/servo/servo/tests) based on an
uploaded report from a try run.
Additionally add a catch-all parameter for `test-unit` which is passed
through to the `cargo nextest` invocation, useful for e.g. stressing a
test via `--stress-count`.
Testing: Manually tested with [try
run](https://github.com/servo/servo/actions/runs/18529823800)
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Similar to about:license in firefox. Generated with `cargo-about`.
A few open questions:
- When/how should it be updated (the command I used was `cargo about
generate etc/about.hbs > resources/resource_protocol/license.html`, it
takes ~20 seconds)
- How should `about.toml` be kept in sync with `deny.toml`
- What about licenses for packages that are not crates (i.e. gstreamer)
Fixes: #40266
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
- Remove unused accepted Copyright line `See
http://rust-lang.org/COPYRIGHT`. This URL now yields a 404, and we don't
seem to use this line anywhere in the project so we can remove it. Note:
We should probably use a regex anyway, so we can match the whole
required expression, but thats a different topic.
- Remove unused `licenses_dep_toml` table. We use cargo deny for
checking the licenses of our rust dependencies.
Testing: Changing tidy is covered by `./mach test-tidy` in CI
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
The main change is running `hdc shell power-shell setmode 602`, which
sets the device to performance mode, increasing the screen timeout and
manually waking the device up.
We add a helper class for that, so that we can use the `with` syntax to
undo these changes at the end of scope.
We also add a small HDC wrapper class, which slightly simplifies and
abstracts over some common functionality like running commands or making
a screenshot.
Testing: This is a CI script change.
Fixes: Speculative fix for speedometer sometimes timing out on HOS and
the screenshot showing a locked device screen.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Removed `setup.py`, `setup.cfg`, `mach.egg-info/`, and `PKG-INFO`. I
don't see these being used anywhere and mach isn't packaged by us. I
checked the firefox source tree and couldn't find them:
45fd8b48b2/python/mach.
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
In a fresh container skipping the apt-update will cause only 4 packages
to be installed and the rest filtered. Also add a debug print to inform
the user if packages were skipped.
Testing: Manually tested
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
`mach bootstrap` no longer installs Wireshark, as it isn't useful for
people not working directly on DevTools support. The linux runner that
runs `mach test-scripts` now installs it manually, skipping the security
prompt.
Testing: Manual test of `mach test-scripts`
Fixes: #40503
Signed-off-by: eri <eri@igalia.com>
Rename the `--scan` argument to `-w/--write-file` and the `--use`
argument to `-r/--read-file`. This is more aligned with `tshark`'s
syntax, and I think it is a more intuitive naming scheme.
Remove the `--filter` and `--range` arguments. They are very easily
replaced by more powerful tools like `grep` and `jq`. It seems
unnecessary to have them in this script (specially when the most useful
thing it does is exporting the capture as NDJSON for other tools to
process). This fixes an issue with the last message not being exported.
Change the default port to `6080`. This matches the current information
[in the
book](https://book.servo.org/hacking/using-devtools.html#connecting-to-servo)
on how to run Servo with DevTools enabled.
Testing: Checked with `math test-scripts`
---------
Signed-off-by: eri <eri@igalia.com>
An implementation detail of `./mach try` is that it creates a git commit
containing information about the try configuration. Adding `--no-verify`
skips running git pre-commit hooks, which could cause the commit to
fail. This is useful for draft / work-in-progress branches, where you
quickly want to commit something and test CI works, before fixing lints
/ formatting etc.
Testing: Manually tested with `./mach try`.
Fixes: #40475
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This is a more reasonable default as the detection of running one or
more tests is a bit inconsistent. It also makes the behavior of the
command a bit more predictable IMO.
Testing: This was tested manually as there is no tests for this
layer of the test runner
Fixes: #40407.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Add a `--coverage` flag to `./mach build` and a `./mach coverage-report`
command to use `cargo llvm-cov` to generate a coverage report from the
raw profiles.
The workflow is:
```
./mach build --coverage [--profile <cargo_profile>]
# Or test-wpt or test-devtools
./mach run --coverage [--profile <cargo_profile>]
# Note, that coverage-report needs to know the cargo build profile.
./mach coverage-report [--profile <cargo_profile>] [optional parameters for cargo-llvm-cov]
```
According to the LLVM documentation on source based coverage, the
optimization profile should not influence the accuracy of the coverage
profile, so we can gather coverage data from optimized builds.
Note that `./mach test-devtools --coverage` will not produce any
coverage profiles yet, since the test runner kills the servo binary,
which prevents writing the profile data at shutdown.
The same problem also affects `test-wpt` with `servodriver`, which will
be fixed by https://github.com/servo/servo/pull/40455.
Testing: Manually tested. A CI workflow to test wpt coverage will be
added in a follow-up PR.
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
cargo places the shared library artifact under
`target/<target_triple>/<profile>/libservoshell.so`. The openharmony
prefix, is something we do in mach for the hap, and is not relevant for
the .so (essentially a copy-paste mistake).
Can be compared by looking at the job run of
https://github.com/servo/servo/actions/runs/19125758002/job/54655560361
which failed due to the wrong path.
Testing: Not tested
Fixes: #40467
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
In the review for #40369, the name of a command-line argument was
changed, but not the code that accessed the argument. This meant that
the unexpected log was never dumped, even when there are stable
unexpected results. This change fixes that.
Testing: This should ensure that the `stable-unexpected-results-linux`
artifact
is not empty when running WPT on CI.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Comprehensively sets the version across Cargo.toml and all
installer/config files (i.e. `Info.plist`, `Servo.wxs.mako`, etc.)
Testing: Manual
Fixes: #40312
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This change switches the default test runner for WPT to be WebDriver,
enabling testdriver tests by default. In addition, it update results to
reflect the ones that you would expect when running with WebDriver.
While there are some failures that require more investigation, in
general the differences in results are fairly explicable.
Testing: This change modifies the way that tests are run and is thus
tested by all WPT-like tests.
Fixes: #34683
---------
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This change ensures that the filtered raw log file of WPT results only
contains stable unexpected results and uploads a resulting aggregated
log file as an artifact. This artifact can be used to generate new
baselines of *only* stable unexpected results, so is useful for updating
results given a CI run. A future change will add a `mach` command to do
this automatically.
Testing: The CI should run the code to produce this artifact for every
WPT run.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
- Compile the nightly in production mode
- Additionally also upload `libservoshell.so` as an artifact. This makes
it easier for interested users on HarmonyOS to test the demo app, since
we can't provide a signed version for HarmonyOS, but users can self-sign
easily if we provide the pre-compiled binary.
Testing: Not tested
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Instead of ignoring the `--headless` argument to the WPT test runner,
properly use it to turno on headless mode in Servo when its provided.
Additionally, when more than a single test is run, turn on headless mode
automatically to preserve existing behavior.
Although this change is for the legacy test driver, this will allow the
WebDriver test runner to run properly without providing the `--headless`
argument.
Testing: This modifies the way the test harness works, but the test
harness is untested.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
The patch implements Compression (https://compression.spec.whatwg.org/)
with the compression and decompression provided by the `flate2` crate
(https://crates.io/crates/flate2).
`flate2` supports several different backends, controlled through the
crate's features. By default, it uses `miniz_oxide`
(https://crates.io/crates/miniz_oxide).
`flate2` provides three modules `read`, `write` and `bufread` which work
on instances of the `std::io::Read`, `std::io::Write` and
`std::io::Bufread` traits, respectively. The `write` module is chosen in
the patch since it matches the streaming model in the specification.
Testing: Enable WPT for Compression API, and introduce WPT expectation.
---------
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
On recent versions of HarmonyOS the previous JIT detection does not
appear to work anymore, since the second `mmap` succeeds. This moves the
failure in spidermonkey to a later point, when SM remaps memory to be
writable. On recent versions of HOS I observed that the `PROT_WRITE`
permission was silently ignored by mprotect, which lead to a crash later
on the first attempt to write to the memory region.
It's not exactly easy to determine if one can write to a memory location
(if mprotect lies to you), but we can use `read` to check if the memory
region is writable (without triggering a segfault), since `read` will
return an error for invalid addresses (which is possible since the
writing is handled in the kernel).
Since this solution does add more unsafe code than before, we only use
this detection on OpenHarmony, although we could use it on more
platforms later if there are other platforms which also may have JIT
forbidden.
Testing: Removing the explicit `--pref js_disable_jit=true` means the
detection is tested in CI.
Fixes: #40029
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Sam <16504129+sagudev@users.noreply.github.com>
Use Release mode for gradle for production builds and Debug for any
other builds.
This fixes an exception when building for android with a custom cargo
profile.
`SERVO_TARGET_DIR` is read in `apk/jni/Android.mk` and specifies the
folder
libservoshell.so is expected to be in.
Testing: Tested manually with `./mach build --android --production`
Fixes: #34564
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
Changes the asset name on github releases to include the platform. We
map the default platform name (e.g. linux) to something closer to the
target triple (x86_64-linux-gnu), since the architecture and env are
important details.
This allows uploading more than one artifact per OS, which is important
for macos nightlies now.
We additionally continue uploading the artifacts under the old name,
which effectively duplicates assets, to keep the asset name stable
during a transition period. This is useful for easily bisecting servo
using release assets, without needing to consider name changes.
Testing: Tested by manually triggering a release workflow
Fixes: #39973
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Only do x86 builds on macos on push and on nightly builds. Also test
building libservo on arm mac instead of x86 mac. Also fixes an issue
when merging macos arm jobs in the try parser.
The main goal of this PR is to improve CI merge times again (since the
concurrency limit of github-hosted runners, has been slowing down the MQ
a lot).
Testing: This changes a CI workflow.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Add --skip-nextest parameter to bootstrap and apply it where nextest is
not required.
Testing: Not tested.
Fixes: #39942
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Removes files that once were used for testing tidy checks which are no
longer performed, such as:
- json formatting
- lock files check which was superseded by cargo deny,
- checking for long lines and multiline strings
- sorting alphabetically #![feature(...)] statements
Testing: Not required, unused files removed
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Nextest is a powerful test runner, with many advantages over cargo test.
Among others it will run each test in a separate process, provide a
summary of the completed test execution, supports output formats like
JUnit, and can handle flaky test by retrying. This PR does not use most
of these advanced features yet though, that will be left to future PRs.
The change also uncovered racy tests in `net` which rely on someone
initializing the `ASYNC_RUNTIME` before the test in questions is run. By
explicitly accessing the lazy static in a common setup routine, we make
sure it is initialized.
CLI differences of `cargo test` vs `cargo nextest`:
- The `--profile` option in nextest is not the cargo profile, but refers
to nextest configuration profiles.
- `--nocapture` is a direct argument to nextest, not to the testharness,
so we can remove the preceding `--` seperator.
Testing: Tested by running unit-tests in CI
Fixes: #39797
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Add a CI workflow to determine the code coverage. For now we only run
unit-tests, wpt-tests with code coverage can be added later.
We use `lld` to avoid OOM errors during linking (with `ld`, we would
need to reduce the build-concurrency drastically to prevent OOM errors
in CI)
For now, coverage would run during `full` and on-demand (i.e explicitly
requested via try). This workflow failing should not influence the
merge-queue, since we intentionally don't add this workflow to the
required status checks (yet).
Future work: It still needs some investigation to figure out if we can
get pull-request comments from the codecov bot, for coverage runs on try
branches.
Testing: [try
run](https://github.com/servo/servo/actions/runs/18431480782/job/52519348479),
[codecov report from the try
run](f41a50f321)
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Sam <16504129+sagudev@users.noreply.github.com>