Commit graph

350 commits

Author SHA1 Message Date
Martin Robinson
fef332f385
Make rustup a requirement and switch to rust-toolchain.toml (#30056)
This change makes rustup a requirement for building Servo with `./mach`
and switches to the newer `rust-toolchain.toml` format. The goal here is
to make mach builds more similar to non-mach builds.

- The new format allows listing the required components, removing some of
  the complexity from our mach scripts.
- This means we must raise the required version of rustup to 1.23. The
  current version is 1.26.
- We no longer wrap every call to cargo and rustc in "rustup run" calls
  as both cargo and rustc will take care of installing and using all
  necessary components specified in `rust-toolchain.toml` when run
  inside the project directory.
2023-08-01 14:44:57 +00:00
Oriol Brufau
e38d21d33d
Run unit tests with both layout 2013 and layout 2020 (#30032)
Since #29950, unit tests were only running with the legacy layout, and
there was no way to run them for layout 2020.

This patch makes './mach test-unit' run unit tests for both.

Also doing some changes so that the layout 2020 floats.rs tests compile.
2023-07-27 05:04:55 +00:00
Martin Robinson
c58d74fe62
Remove UWP / Hololens support 2023-07-05 09:12:09 +02:00
bors-servo
9b79547b87
Auto merge of #29934 - mrobinson:move-third-party, r=atbrakhi
Create a top-level "third_party" directory

This directory now contains third_party software that is vendored into
the Servo source tree. The idea is that it would eventually hold
webrender and other crates from mozilla-central as well with a standard
patch management approach for each.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because this should not change behavior.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-06-30 15:26:55 +02:00
Martin Robinson
8be014ee46
Create a top-level "third_party" directory
This directory now contains third_party software that is vendored into
the Servo source tree. The idea is that it would eventually hold
webrender and other crates from mozilla-central as well with a standard
patch management approach for each.
2023-06-30 09:51:31 +02:00
bors-servo
47faf83a1e
Auto merge of #29947 - mrobinson:update-mozangle, r=jdm
Update mozangle, cc, and cmake

This also moves some environment variable configuration to the shared
`build_env()` method, because previously clang was only being chosen for
running `./mach build` and not `./mach test-unit` which was leading to
rebuilds and thus build failures when running `test-unit`. I guess the
cmake crate does not expect the compiler to change between subsequent
runs.

Fixes #29674

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they do not change behavior.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-06-30 09:47:08 +02:00
Martin Robinson
ddc7994673
Update mozangle, cc, and cmake
This also moves some environment variable configuration to the shared
`build_env()` method, because previously clang was only being chosen for
running `./mach build` and not `./mach test-unit` which was leading to
rebuilds and thus build failures when running `test-unit`. I guess the
cmake crate does not expect the compiler to change between subsequent
runs.
2023-06-30 09:46:45 +02:00
bors-servo
57d34605e9
Auto merge of #29923 - mrobinson:test-scripts, r=jdm
Combine all script tests into `test-scripts`

Remove:
    - tidy self test support from `./mach test`
    - `./mach test-idl`

Adds a `./mach test-scripts` command that is responsible for running all
Python script tests. Run this during the CI to catch regressions in
changes to scripts. The WebIDL tests are still *very* slow and there are
from Gecko, so only run them when "-a" is passed meaning all tests.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-06-30 00:18:58 +02:00
Martin Robinson
ae9a9e1d17
Combine all script tests into test-scripts
Remove:
    - tidy self test support from `./mach test`
    - `./mach test-idl`

Adds a `./mach test-scripts` command that is responsible for running all
Python script tests. Run this during the CI to catch regressions in
changes to scripts. The WebIDL tests are still *very* slow and there are
from Gecko, so only run them when "-a" is passed meaning all tests.
2023-06-29 19:09:33 +02:00
Martin Robinson
f017169ae4
Update scripts to reflect new WPT directory name 2023-06-26 10:48:02 +02:00
Martin Robinson
e679e1f793 Collect build timings on GitHub CI
This will help to investigate slow builds on GitHub.
2023-06-23 15:14:40 +02:00
Martin Robinson
81433a8684
Convert tidy to a non-egg Python package
It seems that servo-tidy is only used by webrender in my GitHub
searches. WebRender could simply use `rustfmt` and the tidy on pypi
hasn't been updated since 2018. Converting tidy to a normal Python
package removes the maintenance burden of continually fixing the easy
install configuration.

Fixes #29094.
Fixes #29334.
2023-06-15 13:10:06 +02:00
Martin Robinson
d4eadc9e37 Get clang-format from pip and upgrade to version 16
This allows relying on a specific version of clang-format and no longer
use any version checks. In addition, we can use --dry-run -Werror in
order to avoid having to run against every file individually.

Fix #29847.
Fix #29846.
2023-06-08 16:50:03 +02:00
sagudev
886e88d4ea Add webgpu cts vendoring mechanism 2023-06-01 10:35:52 +02:00
Martin Robinson
faa8c0e967
Remove more Python 2 compatibility code
- os.environ is always `str` in Python 3.
- The only string type is `str` so we can stop using `six.str_types`.
- `iteritems()` isn't necessary because dicts have the `items()` method.
2023-05-29 13:56:03 +02:00
Martin Robinson
debc37a7d3
Clean up cross-compilation and features
Integrate cross-compilation and media-stack handling into the
`build_like_command_arguments` decorator. This removes a lot of
repetition in the code and standardizes how targets are selected for all
similar commands.

Now cross compilation targets, feature flags, and helper variables are
stored in the CommandBase instance. This also avoids having to
continuously pass these arguments down to functions called by the
commands.
2023-05-25 16:58:05 +02:00
Martin Robinson
7d20f16d9f
Implement bootstrap-gstreamer for all platforms
This change makes it so that the Platform classes can now handle
installing GStreamer dependencies and properly setting up the
environment including when cross-compiling. For Windows and Linux
is now installed into `target/dependencies/gstreamer` when not installed
system-wide. In addition:

1. Creating and moving existing environment path append helpers to
   `util.py`.
2. Combining the `set_run_env` and `build_dev` functions and moving
   some outside code into them so that it can be shared. Now code that
   used to call `set_run_env` calls `build_dev` and then
   `os.environ.update(...)`.
3. Adding Python typing information in many places.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2023-05-25 08:22:21 +02:00
bors-servo
ec4d90d572
Auto merge of #29745 - mrobinson:compositor-side-scroll-tree, r=mukilan
Add a compositor-side scroll tree

This will allow the compositor to properly chain scrolling requests up
when a node has reached the extent of the scroll area. In addition, it
removes the use of the deprecated WebRender `scroll()` API. This fixes
scrolling on servo.org.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes:
  - Fix #29402.
  - Fix #27996.
  - Fix #27624.
  - Fix #24028.
  - Fix #23918.
  - Fix #21165.
- [x] There are tests for these changes
2023-05-23 10:51:11 +02:00
bors-servo
71c5bb02b4
Auto merge of #29754 - mrobinson:organize-python-by-platform, r=mukilan
Start organizing platform-specific Python code

This starts to split platform-specific Python code into its own module, which should help to tidy up our mach commands and make things more reusable. This is step one toward fixing #25335.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they just change mach scripts.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-05-19 13:09:29 +02:00
Martin Robinson
5be14ecc3c Start organizing platform-specific Python code
This starts to split platform-specific Python code into its own module,
which should help to tidy up our mach commands and make things more
reusable.
2023-05-19 13:08:43 +02:00
Martin Robinson
c56a814806 Add a compositor-side scroll tree
This will allow the compositor to properly chain scrolling requests up
when a node has reached the extent of the scroll area. This fixes
scrolling on servo.org.
2023-05-19 09:05:48 +02:00
Martin Robinson
6e2d1bdc79 Thread panics should be a hard-fail in smoketests
This prevents, for instance, a script thread panic from hanging Servo
and means those kind of panics won't cause CI to hang.

Fixes #29749.
2023-05-18 09:08:43 +02:00
Martin Robinson
e2cf3e8d1a Reorganize Servo's WPT Python scripts
This change moves all of Servo's WPT Python support scripts into one
directory as they were previously scattered throughout the directory
structure. This should allow more code reuse and make it easier to
understand how everything fits together.

The changes:

- `tests/wpt/update` → `python/wpt/importer`
- `etc/ci/upstream-wpt-changes/wptupstreamer` → `python/wpt/exporter`
- `etc/ci/upstream-wpt-changes/test.py` → `python/wpt/test.py`
- `etc/ci/upstream-wpt-changes/tests` → `python/wpt/tests`
- `tests/wpt/servowpt.py` →
    - `python/wpt/update.py`
    - `python/wpt/run.py`
- `tests/wpt/manifestupdate.py` → `python/wpt/manifestupdate.py`

This change also removes
 - The ability to run the `update-wpt` and `test-wpt` commands without
   using `mach`. These didn't work very well, because it was difficult
   to get all of the wptrunner and mach dependencies installed outside
   of the Python virtualenv. It's simpler if they are always run through
   `mach`.
- The old WPT change upstreaming script that was no longer used.
2023-04-20 12:24:55 +02:00
Martin Robinson
f7168282a1 Have all mach command accept "--with-layout-2020" and "--layout-2020"
Some command accepted one and some the other. This changes makes them
all accept both so it's no longer necessary to remember which uses
which.
2023-04-07 11:24:14 +02:00
Martin Robinson
5c9156e3ee Aggregate unexpected results into logs
This makes it easier to run `update-wpt` based on results from the bots.
A future version of this could aggregate all unexpected results that
were not filtered as intermittents.
2023-02-14 15:44:34 +01:00
bors-servo
4d5a804d03
Auto merge of #29294 - servo:integrate-filter-intermittents, r=delan
Integrate filter-intermittents into test-wpt

This change integrates the `filter-intermittents` command into `test-wpt`. This is in preparation for future work on tracking intermittent failures. This change also:
- Removes `ServoJsonFormatter` and replaces it with a generic WPT log handler which tracks unexpected results.
- The intermittent filter is now controlled via environment variables and the GitHub version requires a token instead of credentials.
- Output is saved to a single file and is always text.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they are changes to build infrastructure.
2023-01-27 15:43:47 +01:00
Josh Matthews
85a04cc8a7
Update clangfmt version. 2023-01-24 18:45:04 -05:00
Martin Robinson
d294a71397 Integrate filter-intermittents into test-wpt
This change integrates the filter-intermittents command into test-wpt.
This is in preparation for future work on tracking intermittent
failures. This change also:
- Removes the SrvoJson logger and replaces it with a generic WPT log
  handler which tracks unexpected results.
- The intermittent filter is now controlled via environment variables
  and the GitHub version requires a token instead of credentials.
- Output is saved to a single file and is always text.
2023-01-24 15:10:09 +01:00
Martin Robinson
42c3d05d2b Simplify Python code for running WPT tests
Combine `run.py` and `update.py` into `servowpt.py` in order to allow
them to share code. Import them directly into the mach script to avoid
having to call `compile` and `exec` on the code. This makes it clearer
how they are executed. In addition, move all of the setup into
`setupwpt.py` to avoid differences between tests executed via mach and
not. Finally, be more ambitious when detecting the build to use. If none
was specified, try to use the one that exists between "release" and
"debug."
2023-01-13 16:23:52 +01:00
Delan Azabani
ab578bc4cf mach filter-intermittents: add progress and --json output mode 2023-01-10 17:35:01 +08:00
cybai
4f446f8c85 Remove unnecessary always succeed flag 2022-08-16 00:18:37 +09:00
cybai
49d94cb08b Run WPT sync nightly on GitHub Action 2022-08-16 00:14:55 +09:00
Josh Matthews
ec9f0769cb
Update clangfmt version. 2022-08-06 00:48:15 -04:00
Gio de Guzman
43b38e3e37 update Ubuntu version check to > 21.10
Update clang-format version check to use find() instead of startswith() to deal with distro-specific discrepancy
2021-12-15 02:04:11 -06:00
yvt
332de00336 chore(mach): update the required clang-format version to 13 2021-10-16 10:17:15 +09:00
yvt
8f38a44ee7 chore(mach): update the required clang-format version to 12 2021-10-04 09:39:31 +09:00
Josh Matthews
e1f0ae8b0b
Updat clang-fmt version check. 2021-02-19 10:20:08 -05:00
Vincent Ricard
a627dde0d0 Port some code to Python3 2021-02-18 09:35:46 -05:00
Kunal Mohan
75fb6ca589 Improve intermittent filtering 2020-08-04 21:42:53 +05:30
Patrick Walton
5b36d211b4 Add an implementation of the core float and clear placement logic in layout
2020, not yet wired to the rest of layout.

This commit implements an object that handles the 10 rules in CSS 2.1:

https://www.w3.org/TR/CSS2/visuren.html#float-position

The implementation strategy is that of a persistent balanced binary search tree
of float bands. Binary search trees are commonly used for implementing float
positioning; e.g. by WebKit.  Persistence enables each object that interacts
with floats to efficiently contain a snapshot of the float list at the time
that object was laid out. That way, incremental layout can invalidate and start
reflow at any point in a containing block.

This commit features extensive use of
[QuickCheck](https://github.com/BurntSushi/quickcheck) to ensure that the rules
of the CSS specification are followed.

Because this is not yet connected to layout, floats will not actually be laid
out in Web pages yet.

Note that unit tests as set up in Servo currently require types that they
access to be public. Therefore, some internal layout 2020 types that were
previously private have been made public. This is somewhat unfortunate.

Part of #25167.
2020-07-20 12:42:34 -07:00
Kagami Sascha Rosylight
d01648d637 Fix remaining flake8 warnings 2020-06-21 03:34:32 +02:00
Josh Matthews
21b670fad8 Run only a supported set of WPT test types by default. 2020-06-03 16:37:59 -04:00
bors-servo
306e8ac5f9
Auto merge of #25853 - asajeffrey:surfmanup, r=jdm
Replace glutin by winit + surfman 0.2

<!-- Please describe your changes on the following line: -->

This PR updates surfman to 0.2, and replaces glutin with winit+surfman.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because this should all be invisible

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-04-18 21:03:25 -04:00
Alan Jeffrey
8bb1732258 Update surfman to 0.2 and remove glutin 2020-04-17 23:44:53 -05:00
Josh Matthews
b54b3aca64
Disable RUST_BACKTRACE in unit tests on macOS. 2020-04-17 18:20:35 -04:00
Josh Matthews
3a8af93abe
Update required clang-format version. 2020-04-15 22:24:09 -04:00
Warren Fisher
6fa50a423e Add default arguments so that ./mach test --all works 2020-01-19 13:20:36 -04:00
Simon Sapin
8fc072a375 Don’t run ensure_bootstrapped when rustup is not used at all.
Linux WPT tasks on our CI don’t have rustup installed.
2020-01-02 19:25:01 +01:00
Simon Sapin
895cf695c4 Fix a Python 3 warning
```
/home/simon/projects/servo/python/servo/testing_commands.py:301:
SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if err is not 0:
```
2020-01-02 16:44:17 +01:00
Simon Sapin
6f70a9c1de mach: always call ensure_bootstrapped before call_rustup_run 2020-01-02 15:30:33 +01:00