the `-p servo` (formerly libservo) lib target was busted for anyone
genuinely consuming it as a library, but we didn’t catch it because the
CI job designed to check it built `-p servo` with --all-targets, which
unlike library consumers pulls in [dev-dependencies].
this patch fixes the compile error, and fixes the CI check to build `-p
servo` in a more realistic configuration.
Testing: tested in CI, and locally with `cargo build -p servo --locked`
Fixes: #43168
Signed-off-by: delan azabani <dazabani@igalia.com>
As discussed on zulip we would like to rename `libservo` to `servo`
(again) before a future crates.io release.
Servo is a library, so the `lib` prefix is somewhat redundant. We
already renamed the binary of ServoShell to `servoshell`, to reduce
confusion of users of what servo is.
Note: This PR does not touch all occurrences of `libservo`. Specifically
CI job names remain untouched, since the risk of breaking something is
higher here, harder to test for and the name not user facing.
Testing: CI testing of this change should give us good confidence.
Manual testing of `./mach doc` and `./mach build` showed no issues on
macos. [Full try
run](https://github.com/jschwe/servo/actions/runs/22909562747)
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
- Rename instead of copy the `cargo-timings` folder
- Fail the action if artifact not found in upload-artifact. This should
prevent things like #43102
- Update `actions/upload-artifact` to v7
Testing: If this can merge, it is successful.
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This is a preparation for publishing to crates.io. Changes include:
- Add `servo-` prefixes to avoid name collisions on crates.io
- Use `-` instead of `_` in package names.
- Rename the crates to their original names in Cargo.toml,
to keep the diff minimal
- Rename `media` to `servo-media-thread` to avoid name collision with
`servo-media` (originally from the media repository).
This is an outcome of the previous discussion at [#general > Switch
remaining git dependencies to
crates.io](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Switch.20remaining.20git.20dependencies.20to.20crates.2Eio/with/576336288)
Testing: This should be mostly covered by our CI, but some amount of
breakage is to be expected, since some package names could still be
referenced from scripts which are not tested or run in CI. [mach try
run](https://github.com/jschwe/servo/actions/runs/22502945949)
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
That respects the user locale better than hardcoding en-US. This can
also be manually set with the `LANG` environment variable.
Testing: Manual testing with the devtools to check the header sent and
the value of `navigator.language`
Signed-off-by: webbeef <me@webbeef.org>
This change merges http://github.com/servo/media into this repository.
It is only used by Servo and version upgrades are complicated by having
two repositories. In addition, this avoids the need to refer to
individual commit hashes in the Servo `Cargo.toml`. The hope is that
merging these two repositories will lead to better code organization /
simplification like we have seen with the WebXR support. Initiailly, the
idea was that this media support could be shared with the wider Rust
ecosystem, but I think that hasn't worked out as planned due to the fact
that it is difficult to use the various media packaes outside of the
Servo project and the fact that no one seems to be doing this.
Some changes were made when importing the code:
- The second commit in this PR addresses new clippy warnings from the
imported code.
- GStreamer Packages are no longer renamed in the media code, so that
they are named the same as they are currently in Servo.
- Some examples are not ported as they require being run interactively
and depend on older version of important libraries like winit.
Having these dependencies in the core part of Servo isn't very
convenient. Removed examples:
- `audio_decoder.rs`: This is meant to be run interactively with a
file so isn't very useful for testing.
- Depended on winit GUI (`player` subdirectory):
- `media_element_source_node.rs`
- `play_media_stream.rs`
- `simple_player.rs`
- `muted_player.rs`
- `siple_webrtc.rs`: Depended on `webrtc` library:
Testing: This is covered by existing tests. In addition, the job which
runs
the media examples is added to the unit test workflow.
---------
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
- Allowing overriding the target repository, to allow generating regular
servo releases directly
- Releases to servo/servo require manual publishing (policy decision)
- Generate artifact attestation for the remaining artifacts.
- Remove unused `GITHUB_HOMEBREW_TOKEN` secret
- Since getting the names of release artifacts right, and keeping them
in sync can be error-prone, we now use artifact-ids and pass them around
via `outputs`, so we can't accidentally get the artifact name wrong.
- Fix a deprecation warning in `upload_nightly.py` by explicitly
creating an `Auth.Token` object, instead of just passing the token as a
string.
- We can't use `${{ env.RELEASE_REPO }}` when calling the reusable
upload_release.yml workflow, so we need to copy the expression.
- To be able to use the github token to upload releases to servo/servo
(without adding another secret, which could be leaked), we need to add
`permissions: content: write` to the release job. The nightly job
doesn't need this permission, hence there is some unfortunate
duplication. This should be improved in future work, where we can
refactor the upload_python script, to support uploading all artifacts
from a single job, instead of one per platform as we have now.
Testing:
- [manual run for servo/servo, i.e. "regular
release"](https://github.com/servo/servo/actions/runs/21217481628)
- [manual run for
servo/servo-nightly-builds](https://github.com/servo/servo/actions/runs/21214516079)
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This change moves the upload and attestation steps to the nightly
workflow. This results in overall slightly more code, but reduces the
amount of code that has access to extra privileges.
Additionally, this refactoring will allow to easily change the target
repo for the nightly release, i.e. allowing us to reuse the nightly
workflow for our monthly releases in the servo/servo repo (in a
follow-up PR).
We change upload_nightly to get an additional `packages` parameter, that
we use instead of a hardcoded table of expected packages per platform.
`download-artifact` doesn't preserve the whole directory structure, so
it would be a bit cumbersome to preserve that.
Since we anyway only use the upload script in CI, we can just directly
specify the packages in the CI, which also makes things slightly more
flexibel if we want to add new packages or platforms.
There are still more improvements to come, specifically also to the
`upload_nightly` script, with the goal to minimize the amount of code
that needs to be trusted.
Testing: Manually triggering the [release
workflow](https://github.com/servo/servo/actions/runs/20996682863/job/60358012404)
via workflow-dispatch.
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
There are two duplicate artifacts for Linux:
1. release-binary-linux
2. linux-release
When I unzip them, they have exactly same size and number of files, with
slightly different folder structure.
This PR only keeps `linux-release` from `./mach package` to save some
workload/space for the runner. We rename it to `release-binary-linux` to
be consistent with other OS artifacts.
Also fixed a bug where we always used release build for benchmark
instead of requested profile:
For `test-speedometer` and `test-dromaeo`, instead of passing hard-coded
profile `-r`, we use `--bin ${{ inputs.binary-path }} --profile ${{
inputs.profile }}` instead. Both `--bin` and `--profile` are necessary,
as the binary path assumed by the profile is not always correct.
Testing: Try run:
Full:
https://github.com/servo/servo/actions/runs/20330441348
macOS ARM (as it is not included in full profile nowadays):
https://github.com/servo/servo/actions/runs/20331385391
x86_64:
https://github.com/servo/servo/actions/runs/20332775039
Bencher:
https://github.com/servo/servo/actions/runs/20359208540
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This should fix comments about missing junit.xml files, when the CI job
failed before executing the unit-tests.
Testing: Not tested, this is essentially a speculative fix. Not sure how
to test it.
Fixes: #40985
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Some unit-tests are flaky, so we rerun them normally. We didn't do this
until now when measuring coverage, which has been a source of failures
for the coverage job.
Additionally, we can also remove the install lld step, since we are now
using a newer version of Rust, where we can just use lld out of the box.
Testing: [mach try
linux-coverage](https://github.com/servo/servo/actions/runs/19704473261)
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
the runner timeout jobs are a helpful safeguard against bugs (or github
infra failures) that cause jobs to not get picked up by self-hosted
runners, but all they do is wait two minutes and cancel the run,
clogging up our github-hosted runner capacity (limited to 60).
this patch removes the timeout jobs, based on the expectation that our
CI system is reliable enough to not need that automated safeguard.
if you have a build that gets stuck on “Waiting for a runner to pick up
this job...”, it may be a bug or a github infra failure. you can cancel
the build yourself, but please take a screenshot and report it first!
Testing:
- [mach try windows linux
lint](https://github.com/servo/servo/actions/runs/19659755273)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
https://github.com/codecov/test-results-action
The repository now carries a deprecation warning and warns about upload
issues (which we seem to be hitting).
Migrate to the codecov action as recommended.
Testing: CI change
Fixes: Should hopefully fix CI errors.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.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>
Before, we used shorthands for profiles selection (`--release`,
`--production`), but it would be more correct to just use actual
`--profile` so we do not need shorthands for all of them.
Motivation: I want to create "profiling" builds in CI.
Testing: CI change is covered by CI.
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.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>
`./mach test-unit` now requires nextest.
`./mach bootstrap` is skipped on self-hosted runners, which don't have
nextest installed yet, so we need to install it manually. The action is
also much faster than installing from source, so this also benefits the
github-hosted coverage job.
Testing: Not needed, this just installs another tool in CI.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Follow-up to #39812, using nextests builtin retry feature to rerun flaky
unit-tests.
This also adds a per-test timeout, replacing the global timeout set for
the retry action. We could also add a global timeout for nextest tests,
but per-test timeouts should be sufficient and noticably speedup CI when
individual unit tests get stuck.
Testing: [mach
try](https://github.com/servo/servo/actions/runs/18519094535) running
the unit-tests with retries in CI.
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.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>
As previously proposed on zulip and discussed in the coordination
meeting, add a check to CI to see if
servo still compiles with our minimum supported Rust version.
To avoid requiring changes, we define our MSRV as the current version we
are using now (1.85.0).
This does not prevent us from updating the default compiler version,
which we should still do, to
get benefits like faster compile times, newer lints and making sure
crown stays up-to-date.
We simply test that libservo compiles in CI, since libservo (and
dependencies) is what embedders would care about. We also don't need
mach (or bootstrap!) for this, so we just use cargo build.
Testing: This PR adds a CI test. [`./mach try windows-build-libservo
linux-build-libservo
mac-build-libservo`](https://github.com/jschwe/servo/actions/runs/16901171766)
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
this patch updates linux.yml, mac.yml, and windows.yml to run the
devtools test suite (#36325), whenever unit tests are enabled in those
workflows. plus three changes that speed up the tests from 73 → 65 → 56
→ 51 seconds:
- we replace the hardcoded sleep(1) after starting servoshell with a
loop that waits until the devtools port is open (this also fixes
intermittent failures when servoshell starts too slowly, especially on
macOS)
- we start the internal web servers once, and reuse them across all
tests
- we run servoshell in headless mode (this is also required because most
CI runners have no GUI)
finally we fix two bugs that cause very noisy but not very interesting
error messages:
- in the test code, we use a [context
manager](https://docs.python.org/3/reference/datamodel.html#context-managers)
to ensure the devtools client is disconnected unconditionally, even if
test methods or assert helper methods raise exceptions (this was causing
errors on all platforms)
- in the devtools server, we treat “connection reset” errors when
reading from the client like a normal EOF, rather than as a failure
(this was causing errors on Windows)
on self-hosted linux builds, there are still spurious error messages
like the following, but we can fix them later:
```
error: XDG_RUNTIME_DIR not set in the environment.
libEGL warning: egl: failed to create dri2 screen
```
Testing: this patch effectively adds 44 tests to CI
Fixes: #36325
---------
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
Add `build-args` input in CI and try_parser job definition so we can
pass own build args to `./mach build`
Testing: There are tests for try parser and I tested CI in my fork.
Fixes: partial fix#36823
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This allows changing number of chunks used for WPT testing (sometimes
useful for WebGPU).
Testing: Manual try runs
Fixes: #30062
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>