Commit graph

2157 commits

Author SHA1 Message Date
Taym Haddadi
554b35b705
Improve formatting of Python files (#30919)
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2023-12-24 23:58:37 +00:00
Delan Azabani
0be30b30ce
Fix the WPT exporter (#30870)
* Fix the WPT exporter

* apply fixes by @mrobinson

* fix mach test-scripts on NixOS

* rename main_branch_name to default_branch
2023-12-15 11:05:00 +00:00
Martin Robinson
569c4a8823
Integrate hyper_serde into Servo source (#30803)
hyper_serde changes very infrequently and typically only in order to
upgrade Servo dependencies. crates.io lists hyper_serde as having no
dependents, and its integration will not prevent releasing new versions.
Integrating it will both reduce the number of repositories we have to
maintain as well as making it easier to upgrade Servo dependencies.
2023-12-14 11:43:10 +00:00
Samson
1105eb66e9
Use os version in taplo cache-key & setuptools 65 in py3.8 (#30848) 2023-12-11 15:06:43 +00:00
Corey Farwell
117d59d393
Replace virtualenv with Python's built-in venv (#30377)
* Replace virtualenv with Python's built-in venv.

* Apply Delan's suggestions and make a couple small fixes

- Fix a tidy warning about directories that don't exist
- Use shutil instead of the redundant get_exec_path
- Miscellaneous cleanups

* Fix typo in environment variable

* fix bug where pip still tries to the wrong site-packages

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2023-12-07 08:18:30 +00:00
Martin Robinson
7e82c5c957
Compile Servo with the latest version of rust stable (#30831)
This completes the transition to compiling Servo with rust stable. Some
nightly-only features are still used when compiling the `script` and
`crown` crates, as well as for some style unit tests. These will likely
break with newer compiler versions, but `crown` can be disabled for them
conditionally. This is just the first step.

This has some caveats:

1. We need to disable setting up the special linker on Linux. The -Z
   option isn't supported with stable rust so using this is out --
   meanwhile we can't be sure that lld is installed on most systems.
2. `cargo fmt` still uses some unstable options, so we need to rely on
   the unstable toolchain just for running `fmt`. The idea is to fix this
   gradually.
2023-12-06 17:36:07 +00:00
Martin Robinson
bbc35b682f
Remove thinlto servobuild.config option (#30830)
Rust uses a version of ThinLTO by default now [1]. This can be tweaked
by adjusting rust compiler flags, which is probably a better way of
controlling this than a custom servo configuration considering:

1. We want to remove the custom servo configuration eventually.
2. The -Z option that this configuration currently uses is unsupported
   by stable rust.

1. https://blog.rust-lang.org/inside-rust/2020/06/29/lto-improvements.html
2023-12-06 11:06:36 +00:00
Martin Robinson
23add0c1e5 Rename the master branch to main 2023-12-04 10:11:56 +01:00
Samson
604979e367
Replace script_plugins with a clippy like rustc driver (named crown) (#30508)
* Remove script_plugins

* Use crown instead of script_plugins

* crown_is_not_used

* Use crown in command base

* bootstrap crown

* tidy happy

* disable sccache

* Bring crown in tree

* Install crown from tree

* fix windows ci

* fix warning

* fix mac

libscript_plugins.dylib is not available anymore

* Update components/script/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update for nightly-2023-03-18

Mostly just based off https://github.com/servo/servo/pull/30630

* Always install crown

it's slow only when there is new version

* Run crown test with `mach test-unit`

* Small fixups; better trace_in_no_trace tests

* Better doc

* crown in config.toml

* Fix tidy for real

* no sccache on rustc_wrapper

* document rustc overrides

* fixup of compiletest

* Make a few minor comment adjustments

* Fix a typo in python/servo/platform/base.py

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

* Proper test types

* Ignore tidy on crown/tests

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-12-01 15:50:52 +00:00
season
53b0fa827d
Fix build script error.because starting with Python 3.9, the util module was moved from importlib to a separate top-level module called importlib.util. Therefore, if you are using Python 3.9 or later and you receive an AttributeError stating that module 'importlib' has no attribute 'util', it is likely due to a compatibility issue with your code. You can fix this issue by updating your code to import importlib.util directly (#30796) 2023-11-29 16:45:51 +00:00
Samson
e620381736
Pin pyopenssl (#30728)
* Update requirements.txt

* Update requirements.txt

* Update python/requirements.txt

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-11-13 13:17:08 +00:00
Martin Robinson
e44ea6290a
bootstrap: Alphabetize and add 'm4' Ubuntu dependency (#30727)
It looks like `m4` is now required for builds on Debian-like systems.
2023-11-13 12:06:26 +00:00
Samson
96d37d3785
Add --production option to mach (#30707)
* --prod(uction) mach argument

* Use profile in workflows instead of production

* Use profiles in unit tests

* ups

* Build (${{ inputs.profile }})
2023-11-10 10:38:33 +00:00
Martin Robinson
c529bfa49e
Remove some stray references to OpenSSL (#30710)
These were left over from the change to use rustls.
2023-11-09 09:17:19 +00:00
Martin Robinson
8fd370784e
Update mozjs and setuptools (#30685)
This should fix issues with Python 3.12 on Mac builders.

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2023-11-02 16:55:12 +00:00
Martin Robinson
f5627ce4cc
Remove __future__ imports that are no longer necessary (#30661)
These are no longer necessary as we always use Python 3.
2023-11-02 12:01:10 +00:00
Martin Robinson
af68769007
Remove an unused file (#30662)
This was probably used for the now removed homebrew package.
2023-11-01 20:01:01 +00:00
Martin Robinson
9d9c5d3ca9
Vendor mozdebug and stop using distutils (#30659)
The version of `mozdebug` installable via pip is two years old and
Mozilla is slow to release new versions. It also uses `distutils` which
doesn't work on newer Python versions. Vendor it and stop using
`distutils` there.
2023-10-31 09:42:14 +00:00
Mukilan Thiyagarajan
117cc1da6c
mach: use importlib module instead of imp (#30645)
* mach: use `importlib` module instead of `imp`

`imp` module has been deprecated since python 3.4
and has been removed in 3.12. The recommended alternative
is to use the `importlib` module that was introduced in
python 3.1

This is required to fix the CI failures in macos builds
since GitHub runner images for macos-13 now use python 3.12

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* mach: use `importlib` module instead of `imp`

`imp` module has been deprecated since python 3.4
and has been removed in 3.12. The recommended alternative
is to use the `importlib` module that was introduced in
python 3.1

This is required to fix the CI failures in macos builds
since GitHub runner images for macos-13 now use python 3.12

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-10-30 07:53:20 +00:00
Martin Robinson
463c61f34d
Stop using distutils (#30638)
This is removed from Python 3.12 so we can no longer rely on it. All of
this functionality is either in `setuptools` or `shutil`.
2023-10-28 17:17:57 +00:00
Mukilan Thiyagarajan
6dd359193f
Fix upload-nightly to use correct path (#30632)
Nightly builds now use production profile and thus will be
available under target/production
2023-10-28 07:10:28 +00:00
Delan Azabani
a3d2f0c586
Enable debug assertions for all builds other than official releases (#30509)
* Run main and try jobs with debug assertions

* use single quotes in workflow expressions

* set force-debug-assertions in main.yml

* set force-debug-assertions as part of decision job

* fix typo in MachCommands.build

* fix more hardcoded profile names

* fix tidy

* split cargo_profile_option on windows

* Fix running servoshell and unit tests through a symlink

* rename steps to make them less confusing

* fix more hardcoded cargo profile options

* fix missing inputs in linux-wpt and mac-wpt

* make filename an inherent method of Resource

* rework release-with-debug-assertions profile to production profile

* rework resource logic to eliminate std_test_override

* set production flag in nightly release builds

* clean up servobuild.example and windows.yml

* oops forgot to check in embedder_traits/build.rs

* fix mach test-unit behaviour through symlink

* unit tests only need current_dir and ancestors

* fix macOS package smoketest breakage

* expect css/css-color/currentcolor-003 to crash under layout 2013

* fix more references to {force,release-with}-debug-assertions

* fix local build failures under --profile production
2023-10-26 08:22:14 +00:00
Servo WPT Sync
65beca94cd
Sync WPT with upstream (24-10-2023) (#30607)
* wpt sync: adapt code for new TestRoot class

Fixes #30558

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* temp change to allow wpt sync build to pass

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Update web-platform-tests to revision b'0d5028f200c8651b17bb224657d6e1065adcff37'

* Revert "temp change to allow wpt sync build to pass"

This reverts commit bad72c7f87.

* revert metadata update for intermittent timeouts

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-10-25 07:26:53 +00:00
Delan Azabani
aabae55407
Fix filtered test counts in WPT summaries (#30591) 2023-10-20 07:20:19 +00:00
bc-universe
9d10d230ac
Add support for EndeavourOS (#30513) 2023-10-06 20:58:06 +00:00
Martin Robinson
aadf48bd4d
Bootstrap pkg-config and cmake on MacOS (#30497)
These need to be installed in order to build so we can install them via
Homebrew. Do this by simply restoring the Homebrew bootstrapping logic
we had in place previously.

Fixes #27171.
2023-10-05 01:12:29 +00:00
Mukilan Thiyagarajan
330f59a711
Fix WPT import by overriding product name to servo (#30457)
Upstream wpt script has bug where 'product' defaults to
'firefox' and this causes import of uninstalled python
modules specific to firefox runners.

Fixes #30452

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-10-04 17:50:47 +00:00
Martin Robinson
f78d53daaa
Adjust the missing taplo message (#30473)
The current message doesn't have a line break where you would expect it
to and instead has a gap due to the indentation of the code in Python.
2023-10-03 10:23:02 +00:00
Samson
d74d51190a
Update WebGPU CTS (#30454)
* Fix webgpu-cts import script

* Update webgpu-cts to f2b59e0362

* Updated expectations
2023-09-30 16:28:46 +00:00
Delan Azabani
5d8d7c79c2
fix WebGPU runtime dependencies on linux (#30407) 2023-09-22 11:05:38 +00:00
Samson
7caac9790d
Enforce formatting of TOML files (#30128)
* Fmt all toml files

* bootstrap taplo

* enforce toml formatting with taplo

* Install taplo in CI using cargo-install action
2023-09-19 08:57:27 +00:00
Carlos Bentzen
0b86d65798
Add TUXEDO OS to mach bootstrap (#30363)
Signed-off-by: Carlos Bentzen <cadubentzen@gmail.com>
2023-09-15 04:20:32 +00:00
Samson
59d134133f
Use MozTools 4 and update mozjs (#30326)
* Update mozjs

* moztools4 in bootstrap

* no autoconf

* tidy

* switch to servo-build-deps

* update mozjs for real

* glue mozjs

* fmt

* move to servo/mozjs
2023-09-11 08:23:05 +00:00
Samson
9b1247b20f
No extern crate test/tidy & better RUSTFLAGS handling in mach (#30328)
* Remove unused extern crate rustflag

* Remove tidy check alphabetical order of extern crates

rustfmt's reorder_imports already does that

* fix

* better RUSTFLAGS handling
2023-09-10 18:32:10 +00:00
Atbrakhi
3df284cf54
Move user input logic into servoshell (#30238)
* cleanup and move user input logix into servoshell

* fix fmt

* moves test from servoshell file

* move command-line args into servoshell

* remove feature media-gstreamer

* fix fmt

* move user input logic code into lib to make it more testable

* remove opts_matches in fn instead get it from main2

* remove pub and fix import

* add licence in new file

* revert passing Matches, instead pass Option String

* review update, also move sanitize fn to parser file

* fmt fix

* review fix: remove extra line
2023-09-06 11:45:56 +00:00
Samson
8a011a4487
Update mozjs and use moztools infra (#30292) 2023-09-05 16:52:50 +00:00
Martin Robinson
30dbc46d17
Let WPT commands take the --legacy-layout argument (#30239)
This also prints a better message when starting tests.
2023-08-30 11:46:57 +00:00
Samson
5e60088276
Always dummy (#30240) 2023-08-30 06:09:14 +00:00
Atbrakhi
66567faeb2
Rename ports/winit package to servoshell (#30163)
* rename winit package to servoshell

* revert previous changes and rename only package
2023-08-28 14:36:57 +00:00
Manuel Rego Casasnovas
cc4fe4981f
Add Raspbian GNU/Linux distro for mach bootstrap (#30223) 2023-08-28 11:13:25 +00:00
Martin Robinson
d6ded03a65
Get LLVM from chocolatey (#30140)
LLVM is the largest package that we get from servo-build-deps, so
installing it via chocolatey should reduce the amount of data that we
transfer from that source. In addition, it's one less dependency that we
have to manage.

It also seems that installing LLVM to the default location with choco
means that we no longer have to set the LIBCLANG_PATH environment
variable for bindgen.

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-08-21 11:19:18 +00:00
Samson
71e0372ac1
Upgrade whole webgpu stack (#29795)
* Allow noidl files in script/dom/webidls

* Upgrade wgpu to 0.16 and refresh whole webgpu implementation

* Update WebGPU test expectations

* misc

* MutNullableDom -> DomRefCell<Option<Dom for GPUTexture

* Direct use of GPUTextureDescriptor

* Remove config from GPUCanvasContext

* misc

* finally blue color

* gpubuffer "handle" error

* GPU object have non-null label

* gpu limits and info

* use buffer_size

* fix warnings

* Cleanup

* device destroy

* fallback adapter

* mach update-webgpu write webgpu commit hash in file

* Mising deps in CI for webgpu tests

* Updated expectations

* Fixups

* early reject

* DomRefCell<Option<Dom -> MutNullableDom for GPUTexture
2023-08-20 23:16:46 +00:00
Mukilan Thiyagarajan
33fa49c8ed
Fix mach test-wpt to make crash tests work (#29832)
* Fix `mach test-wpt` to make crash tests work

There are two issues related to crash tests:
1. test-wpt is unable to find existing crash tests even when
   called with --test-types=crashtests. The fix here is to
   add crashtests to the default test suite types to python/wpt/run.py
2. When running in headless mode, crashes in style threads
   don't cause servo to crash because the logic in constellation.rs
   currently calls handle_panic only when the top-level browsing
   context id is some value. Since style pool threads are shared,
   they always generate Panic messages with None as top-level
   browsing context id.

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Send bactrace to stderr and capture it in test runner

Servo's panic hook writes backtraces to stdout. This
patch changes it so they are written to stderr.

The crash test executor for servo in WPT grouping formatter
was also not capturing the output correctly for crashtests
as the log events were being aggregated based on thread name
which doesn't seem to match correctly in case of crashtests.
This patch also fixes the log grouping logic to be based on
test name.

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* crashtests: update expectations for layout 2020

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* crashtests: update expectations for layout 2013

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* remove outdated & intemittent test expectations

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-08-18 23:43:32 +00:00
Mukilan Thiyagarajan
1efecf9b50
Use system lld on NixOS instead of rust-lld (#30123)
The -Zgcc-ld=lld flag makes rust use the rust-lld
linker that is distributed as part of rust toolchain.
However, this flag doesn't work on nixos correctly
as
  1) rust-lld needs to be patched to have the correct rpath
     to find libz.so
  2) the bin/gcc-ld/ld.lld wrapper which calls rust-lld also
     needs to be patched to use the correct dynamic loader
  3) rust-lld doesn't respect NIX_LDFLAGS which contains
     the additional search path derived from buildInputs.
     The system linkers on nixos are wrapped so that
     NIX_LDFLAGS is added as the rpath to the final binary.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-08-18 06:18:05 +00:00
Samson
c0bee7cb86
Format toml files (#30112)
* Add taplo fmt config for toml fmt

* fmt toml files

* Add even-better-toml to extensions recommendations
2023-08-17 15:07:43 +00:00
Martin Robinson
46978b2543
Clean up the environment variables set for mozjs (#30106)
mozjs from the repository now has a simplified interface for setting
these.
2023-08-16 11:14:14 +00:00
Martin Robinson
83a46f68db
Replace "-mmacosx-version-min" with MACOSX_DEPLOYMENT_TARGET (#30102)
It's unclear if the compiler flag was doing anything, but I've verified
(with otool) that the environment variable does affect the minimum
version of the MacOS set in the binary. We could examine later if this
is still necessary.

This was added in #23163 when switching CI from gcc to clang.
2023-08-15 14:49:05 +00:00
Martin Robinson
16445983ec
Remove gold config option and use lld on Linux (#30100)
There are a few motivations for this change:

 1. lld is demonstrably faster than gold, but is really only stable on
    Linux at the moment. There's a good chance that it will be ready for
    all platforms soon though.
 2. Most people do not have gold installed on MacOS and Windows. You'd
    have to do this manually through homebrew. I think it's a safe
    assumption that this probably won't be slowing things down much on
    those platforms.
 3. We need to remove all configuration of the build that happens while
    running `./mach build` if we ever hope to make `cargo build`
    equivalent to the mach build. This unlocks static configuration of
    the rustflags. One of the big blockers for proper `cargo build`
    support.
2023-08-15 13:53:05 +00:00
Oriol Brufau
963104e5fc
Run same tests for layout-2020 and layout-2013 (#30092)
Most tests were only being run for layout-2013, not for layout-2020.
This wasn't great since layout-2020 is now the default.

So this patch unifies the lists of included tests for both layouts.
For layout-2013 this implies adding css/css-content/, css/css-logical/
and css/css-masking/clip/.
For layout-2020 this implies adding several additional css tests, and
also tests like dom/, js/, html/, etc.
2023-08-15 00:28:32 +00:00
Martin Robinson
78c7011240
Make native-bluetooth a default feature (#30097)
This features is turned on unconditionally by `./mach build`.
2023-08-14 14:44:47 +00:00