aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/platform/base.py
Commit message (Collapse)AuthorAgeFilesLines
* mach: Install Rust toolchain during bootstrap if needed (#35795)Delan Azabani2025-03-051-0/+9
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* sync cargo-deny version in python/servo/platform/base.py (#35730)Yerkebulan Tulibergenov2025-03-011-2/+2
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* tidy: Use more `cargo-deny` features (#34447)Martin Robinson2024-12-131-2/+10
| | | | | | | | | | | | Instead of parsing the `Cargo.lock` file directly in `tidy.py`. Use `cargo-deny`, which we already use to detect unapproved licenses in the dependency chain to detect duplicate and banned crates. In addition, enable all other `cargo-deny` checks and add exceptions where necessary for them. This depends on the latest release of `cargo-deny` which depends on a recent verison of `rust`. Fixes #34393. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* build: upgrade rustc to 1.81.0 (#34270)Mukilan Thiyagarajan2024-12-121-2/+1
| | | Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* mach bootstrap: Lock cargo-deny to 0.16.1 (#34258)Jonathan Schwender2024-11-151-1/+2
| | | | | | As mentioned in https://github.com/servo/servo/pull/34257 we should also lock the cargo-deny version in mach bootstrap. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* mach: introduce `BuildTarget` abstraction (#33114)Mukilan Thiyagarajan2024-08-261-6/+9
| | | | | | | | | | | | | | | | Introduce a new `BuildTarget` abstraction to centralize the code for supporting different ways of choosing the build target (e.g --android, --target x86_64-linux-android , --target aarch64-linux-ohos). This is currently handled in an adhoc fashion in different commands ( mach package, install, run) leading to a proliferation of keyword parameters for the commands and duplicated logic. The patch introduces a new `allow_target_configuration` decorator to do the validation and parsing of these parameters into the appropriate `BuildTarget` subclass, which is now stored as an instance attribute of the CommandBase class. All the code that previously relied on `self.cross_compile_target` has been switched to use the BuildTarget. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* mach: Expose a `--skip-static-analysis` to `mach boostrap` (#32587)Martin Robinson2024-06-241-4/+5
| | | | | This should speed up runners which just need to run the WPT tests. Fixes #32582.
* Add cargo-deny to mach-tidy to check license compliance. (#32465)Jonathan Schwender2024-06-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | * Use cargo-deny to check license compliance. All licenses should be MPL-2.0 or weaker. * Run cargo-deny check licenses in mach tidy * fmt * Fix inverted boolean * Move cargo deny to tidy.py * Add quotes around license in error message * Integrate `cargo-deny` into tidy fully * Fix script tests --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Fix mach bootstrap --skip-platform (#32341)Delan Azabani2024-05-221-1/+2
|
* bootstrap: Add a `--skip-platform` option (#32176)Martin Robinson2024-04-291-2/+4
| | | | This allows installign `taplo` and `crown` when you are installing dependencies manually.
* Run platform_bootstrap first (#31840)Samson2024-04-291-2/+2
|
* bootstrap: More resiliently install Deiban-like platform dependencies (#31281)Martin Robinson2024-02-071-2/+2
| | | | | | | | 1. First check to see if a package is available before trying to install it. This means that we always do our best to install everything, but don't fail if we cannot. 2. Install crown and taplo first. This means that if the platform-specific bits fail, we still install Servo-specific dependencies.
* Fix bugs in `mach test-tidy` (#31232)Mukilan Thiyagarajan2024-01-311-3/+1
| | | | | | | | | | | | | | | | | * mach: test-tidy should return 1 for failure Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * fix lint issues Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * mach: tidy should allow spec links with trailing text Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> --------- Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* tests: Add GStreamer library directory to DYLD_LIBRARY_PATH (#31163)Martin Robinson2024-01-241-3/+0
| | | | | | | This fixes an issue where the dylib for harfbuzz cannot be found when running unit tests on some systems, because unit tests don't get their rpaths adjusted during build. This is quite likely an issue with dylib dependency management. We just need a bit more exploration of how this is traditionally handled.
* build: Only set PATH for GStreamer (#31078)Martin Robinson2024-01-171-35/+16
| | | | The documentation claims that this is the only environment variable that needs to be set before build.
* crown: Add a cargo config.toml file (#31090)Martin Robinson2024-01-151-6/+1
| | | | | This makes it more foolproof to install crown from inside the Servo directory, because the root Servo config.toml overrides the rustc to use crown (an obvious circular dependency).
* Fix the build on Ubuntu 20.04 (#31019)Martin Robinson2024-01-071-13/+0
| | | | | | | | Ubuntu 20.04 doesn't have a new enough version of GStreamer, so automatically disable media when running on that platform. This also cleans up the media detection a bit, putting the result in a `enable-media` variable and moving some of the logic into the build scripts themselves rather than the platform module.
* bootstrap: Adding more output when installing dependencies (#31003)Martin Robinson2024-01-051-4/+4
| | | | | | | It's often the case (especially with the taplo installation and on Windows) that bootstrap is doing lots of stuff in the background for a long amount of time. Without output it's hard to tell what exactly is going on. This change adds more output to this process as well as removing some Pythong 2.x era code.
* Upgrade media / GStreamer / GLib (#30750)Martin Robinson2024-01-051-2/+2
| | | | | | | | | | | | | | | | | | - Upgrade the version of GStreamer for Windows This upgrades the Windows build to use the most recent version of GStreamer. This is necessary to upgrade our GStreamer dependency. - Stop shipping GStreamer binaries on Linux The binary bundle of GStreamer that we package is not used to compile -- only to run layout tests. It's too old for the APIs that we are using (as evidenced by needed 1.18 for WebRTC) and nowadays Linux distributions carry a new version so it's unecessary for our build machines. No longer using this binary bundle will allow us to upgrade our GStreamer dependency -- which now has stricter checks that we are using at least version 1.18. - Upgrade media to use newer versions of GStreamer / GLib dependencies
* Compile Servo with the latest version of rust stable (#30831)Martin Robinson2023-12-061-3/+0
| | | | | | | | | | | | | | | | 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.
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Remove some stray references to OpenSSL (#30710)Martin Robinson2023-11-091-2/+0
| | | These were left over from the change to use rustls.
* Enforce formatting of TOML files (#30128)Samson2023-09-191-1/+14
| | | | | | | | | * Fmt all toml files * bootstrap taplo * enforce toml formatting with taplo * Install taplo in CI using cargo-install action
* Use system lld on NixOS instead of rust-lld (#30123)Mukilan Thiyagarajan2023-08-181-1/+4
| | | | | | | | | | | | | | | | 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>
* Remove UWP / Hololens supportMartin Robinson2023-07-051-8/+3
|
* Windows bootstrap supportMartin Robinson2023-07-031-4/+10
|
* Implement `bootstrap-gstreamer` for all platformsMartin Robinson2023-05-251-12/+88
| | | | | | | | | | | | | | | | | | 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>
* Start organizing platform-specific Python codeMartin Robinson2023-05-191-0/+34
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.