Commit graph

1439 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
Martin Robinson
6f4f237fbd
Remove lzma path workaround for MacOS (#30053)
Now that the new version of GStreamer fixes this issue, we can remove
the workarounds for this problem as well as all of the homebrew
bootstrapping logic.
2023-08-01 11:11:46 +00:00
Martin Robinson
e153bcb40b
Remove homebrew packaging (#30047)
This hasn't been updated since 2017 and homebrew installation is also
provided via a cask which downloads the latest version from the website
[^1]. I think this code is basically unused.

[^1]: 9e944ae828/Casks/servo.rb
2023-08-01 06:55:08 +00:00
Martin Robinson
2ecdb8f45e
Embed git hash using vergen instead of mach (#30030)
Embed the git hash into the servo binary using vergen instead of using
custom Python code in mach. The benefit here is ones less difference
between a normal cargo run and building via mach in addition to removing
a bunch of code.
2023-07-28 05:03:06 +00:00
Martin Robinson
17a5b9200d
Remove old code for out-of-date CA stores (#30031)
This code was written to handle both Python 2 (which we no longer
support) and old Windows CI machines that did not have up-to-date CA
stores. I think we can remove this now.
2023-07-27 15:26:22 +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
605bf52334
mach bootstrap should also bootstrap GStreamer on Windows (#30018)
Fixes #30007.
2023-07-21 14:50:09 +00:00
Mukilan Thiyagarajan
ef88355248 Fix package name for windows nightly
Also remove the 2020 specific packages.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-07-09 13:48:57 +05:30
Martin Robinson
d31cdb682f
Make the choice of layout runtime setting
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2023-07-06 14:49:24 +02:00
bors-servo
f11c6045e3
Auto merge of #29970 - mrobinson:remove-uwp, r=jdm
Remove UWP / Hololens support

<!-- 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 remove a feature.

<!-- 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-07-05 17:12:48 +02:00
Martin Robinson
c58d74fe62
Remove UWP / Hololens support 2023-07-05 09:12:09 +02:00
Martin Robinson
1eb3e85d69
Collect android build setup into two methods
This is small refactor which tries to isolate all of the Android setup
into a couple methods, so that it is easier to reason about in the
scripts. This doesn't change any behavior but does fix a few small
linting errors in the existing code.

Note: The Android build is currently broken and this change doesn't fix
it. It shouldn't break it any more though.
2023-07-05 07:47:00 +02:00
Martin Robinson
633d9b0eb9 Windows bootstrap support 2023-07-03 21:40:24 +02:00
bors-servo
ed72efa154
Auto merge of #29956 - mrobinson:update-mozangle, r=jdm
Update mozangle

This should allow servo to take advantage of faster compilation times on Windows.

<!-- 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

<!-- 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-07-02 02:23:26 +02:00
Martin Robinson
96eeb5865c Update mozangle
This should allow servo to take advantage of faster compilation speeds
on Windows.
2023-07-01 18:41:54 +02:00
Martin Robinson
e681e2b3f3 Set the Windows subsystem using a rust directive
This is one less thing that mach has to do now.
2023-07-01 15:04:26 +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
bors-servo
7ffb9b2d49
Auto merge of #29917 - mrobinson:more-environment-cleanup, r=jdm
Clean up environment variables in `command_base.py`

- The `HOST_FILE` setting is completely unused by the code.
- Remove some likely Python 2 compatibility code.
- Remove things pertaining to Ubuntu 16.04 which is EOL.
- Remove a workaround for MacOS which no longer applies.

<!-- 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 mostly remove dead build script code.

<!-- 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-24 14:27:15 +02:00
Samson
0256ac9c62
Update command_base.py
Fixup for https://github.com/servo/servo/pull/29912#issuecomment-1605347271
2023-06-24 12:05:32 +02:00
bors-servo
edeed11cef
Auto merge of #29912 - mrobinson:try-gold-on-windows, r=jdm
Don't explicitly disable gold on Windows

This seems to be working fine now on CI, so I think we can remove this
workaround.

<!-- 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 are just build 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-23 17:25:47 +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
f162d28e6d
Clean up environment variables inn command_base.py
- The `HOST_FILE` setting is completely unused by the code.
- Remove some likely Python 2 compatibility code.
- Remove things pertaining to Ubuntu 16.04 which is EOL.
- Remove a workaround for MacOS which no longer applies.
2023-06-22 19:47:20 +02:00
Martin Robinson
da581535d1
Don't explicitly disable gold on Windows
This seems to be working fine now on CI, so I think we can remove this
workaround.
2023-06-22 11:54:37 +02:00
Martin Robinson
a57c49a4bb Implement ./mach bootstrap for MacOS 2023-06-22 11:14:00 +02:00
bors-servo
7aaad0aa7e
Auto merge of #29903 - mrobinson:improve-windows-build-instructions, r=mrego
Simplify the build instructions in README.md

- Add a chocolatey configuration that installs all dependencies and split
  the instructions into a normal and manual installation section. In
  addition fix a warning print statement for the Windows build that would
  trigger a Python exception.
- Simplify the build instructions in the README and move all manual
  setup details to: https://github.com/servo/servo/wiki/Building

<!-- 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 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-22 08:21:21 +02:00
Martin Robinson
8bac189ea2
Simplify the build instructions
- Add a chocolatey configuration that installs all dependencies and split
  the instructions into a normal and manual installation section. In
  addition fix a warning print statement for the Windows build that would
  trigger a Python exception.
- Simplify the build instructions in the README and move all manual
  setup details to: https://github.com/servo/servo/wiki/Building
2023-06-21 19:37:46 +02:00
bors-servo
7590b47dbd
Auto merge of #29901 - mukilan:switch-nightly-to-2020-layout, r=mrobinson
Default nightly builds to layout 2020

This PR switches the filenames used by nightly builds so that the default `servo-latest.{ext}` packages use the 2020 engine and the 'servo-latest-legacy-layout.{ext}` packages use the 2013 engine.

Since the platform workflows are reused by  the main, quick-check, PR and WPT import flows and since the 2013/2020 flags are also controlled by try branches, I've kept the changes isolated to  `nightly.yml` and `package_commands.py` and have avoided changing the input parameters. If we want to deault all the workflows to 2020, I can decline this PR and raise a new one.

---
<!-- 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 modify packaging logic.
2023-06-21 15:12:34 +02:00
Mukilan Thiyagarajan
bca529da92 Default nightly builds to layout 2020
Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>
2023-06-21 16:14:02 +05:30
Martin Robinson
4d7f250159
Clean up rustdoc run
1. The options specified in `rustdoc-with-private` are essentially the
   default now so we can remove this script.
2. `./mach browse-doc` is redundant with `./mach doc --open` which uses
   the underlying cargo functionality to browse the documentation.

Fixes #29888.
2023-06-20 12:42:43 +02:00
bors-servo
db684cb9f1
Auto merge of #29882 - mukilan:fix-windows-nightly, r=mrobinson
Fix windows nightly build failure

PR #29865 changed the target directory for windows to be different from the source folder. However, the 'upload-nightly' command assumes the packages are stored in the default cargo target directory (./target), so the nightly jobs for windows were failing to find the packages.

This PR fixes the 'upload-nightly' command to account for non-default target directories specified via CARGO_TARGET_DIR.

---
- [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 fix a bug in packaging logic.
2023-06-16 10:53:17 +02:00
Mukilan Thiyagarajan
715343b473 Fix windows nightly build failure.
PR #29865 changed the target directory for windows
to be different from the source folder. However,
the 'upload-nightly' command assumes the packages
are stored in the default cargo target directory
(./target), so the nightly jobs for windows were
failing to find the packages.

This PR fixes the 'upload-nightly' command to
account for non-default target directories
specified via CARGO_TARGET_DIR.
2023-06-16 12:39:24 +05:30
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
bors-servo
f63f981654
Auto merge of #29862 - mukilan:default-to-layout-2020, r=jdm
Use layout 2020 by default

This PR switches `./mach build` to use layout 2020 by default. It doesn't switch the nightly builds served from download.servo.org to layout 2020. I can add that change to this PR if we are ready to make the switch in nightly builds as well.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #29843
- [x] These changes do not require tests because modify mach build configuration.
2023-06-09 15:05:50 +02:00
Mukilan Thiyagarajan
8a46a4ee05 Use layout 2020 by default
Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>
2023-06-08 23:13:53 +05:30
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
bors-servo
23a383540b
Auto merge of #29791 - sagudev:webgpu-cts, r=jdm
Vendoring machanism for webgpu cts & update

- Add `update-webgpu` command to mach to vendor webgpu cts.
- Update webgpu cts (480edec387)  & expectations (even though most are failing due to out of date impl)
- Ignore vendored path from tidy check

---
<!-- 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 #27508

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they are tests

<!-- 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-03 01:16:29 +02:00
6543
e36444b6ce
recognize artix as valid distribution 2023-06-01 17:06:18 +02:00
sagudev
886e88d4ea Add webgpu cts vendoring mechanism 2023-06-01 10:35:52 +02:00
bors-servo
fc07c21276
Auto merge of #29811 - mrobinson:remove-more-python-2, r=jdm
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.

<!-- 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 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-05-29 18:15:28 +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
bors-servo
cab7694b08
Auto merge of #29807 - sagudev:pyfail, r=mrobinson
Propagate status on `build_like_command_arguments`

As observed in #29805

---
<!-- 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 #29806

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- 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-29 13:39:41 +02:00
Martin Robinson
4d8c227774
Do not pass features when running ./mach test-unit 2023-05-29 10:09:54 +02:00
sagudev
f2e067099f Propagate status on build_like_command_arguments 2023-05-29 08:12:25 +02:00
Martin Robinson
3fcff73f4d Only check the GStreamer installation when building
Instead of always checking whether GStreamer is installed in mach's
`build_env`, only do this when actually building. Also, use the instance
variable to find features and look for the "media-gstreamer" feature
instead of looking for !"media-dummy."

Fixes #29797.
2023-05-27 12:31:06 +02:00