Commit graph

27 commits

Author SHA1 Message Date
Mukilan Thiyagarajan
88a35b3cc9
mach: adopt uv and avoid system python (#34632)
This allows us to use `uv` for:
1. Installing a pinned Python version
2. Installing the dependency packages using `uv`'s pip compatible interface.
4. Bootstrapping `mach` without a Python installion on the host, using `uv
   run`

This change also introduces a new 'composite' GitHub action to setup
python in the different CI workflows. There is no support for externally
managed python installations and virtual environments. These could be
added in the future.

Fixes #34095, #34547

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-12-16 09:20:37 +00:00
Jonathan Schwender
f757fa46ac
Bump bindgen to 0.71.1 (#34562)
* Bump bindgen to 0.71.1

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Set SCCACHE_GHA_VERSION to allow purging cache

changing the version allows us to purge the cache.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* android CI: Enable sccache again

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-12-16 07:13:20 +00:00
Mukilan Thiyagarajan
a87a86f4f2
ci: add retries and caching for gradle installation (#34619)
This change uses Gradle's official `setup-gradle` action to allow the
caching of the downloaded gradle distribution and java dependencies in
the GitHub Actions cache. However, since the initial download of gradle
distribution is still handled by the `gradlew` wrapper script which
doesn't retry on network failures, this change also adds a simple retry
mechanism using shell scripting.

Fixes #34600

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-12-14 11:18:43 +00:00
Mukilan Thiyagarajan
d7cc988717
ci: disable caches on Android CI for testing (#34577)
This is to see if #34571 is related to caching in anyway. There is no
easy way to delete all Github Action caches using Github UI or cli.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-12-11 17:17:05 +05:30
Mukilan Thiyagarajan
2f64dde623
Revert "mach: switch to uv for managing python venv (#34504)" (#34548)
This reverts commit 4103421ba5.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-12-10 03:43:50 +00:00
Mukilan Thiyagarajan
4103421ba5
mach: switch to uv for managing python venv (#34504)
This patch switches servo to use `uv` for both installing a pinned
Python version as well as installing the dependency packages using
`uv`'s pip compatible interface. It also introduces a new 'composite'
GitHub action to setup python in the different CI workflows.

There is no support for externally managed python installations and
virtual environments. These could be added in the future.

Fixes #34095

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-12-09 14:52:06 +00:00
Jonathan Schwender
f96a62f0ce
Bump sccache-action to v0.0.6 (#33566)
Interesting changes since v0.0.4

- fix: avoid downloading package when local cache exists in https://github.com/Mozilla-Actions/sccache-action/pull/123
- Output sccache stats as a notice and a summary table in https://github.com/Mozilla-Actions/sccache-action/pull/113

v0.0.6 changelog: https://github.com/Mozilla-Actions/sccache-action/releases/tag/v0.0.6

v0.0.5 changelog: https://github.com/Mozilla-Actions/sccache-action/releases/tag/v0.0.5

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-09-27 15:22:35 +00:00
Mukilan Thiyagarajan
ea109d5490
android: publish nightly builds for aarch64 (#33435)
* android: publish nightly builds for aarch64

Publish the aarch64 apk and aar packages to both Github Releases
and S3 so that it can be linked from servo.org.

The focus is on getting a working version of the APK on the homepage,
so few issues are resolved with temporary solutions:
1) We publish the "release" profile instead of "production" since the
   latter will need changes in the gradle configuration (the changes
   required was previously blocked on #32720 which is now closed).
2) The scheme for the version code is simple and doesn't consider
   other factors such as API level and product variants discussed in the
   Android docs (https://developer.android.com/google/play/publishing/multiple-apks#VersionCodes)
   This should be fine for now as we don't publish to any store yet.

The change also makes it so that the 'Release nightly' workflow will
endup building all 4 variants for the Android target, but only aarch64
is uploaded. This is because GH Actions doesn't have a good way to skip
a specific job in a matrix and the additionally code complexity needed
to acheive it (either generating a JSON dynamically in a new job and using
`fromJSON` in the matrix definition or skipping each individual step
based on matrix.target and `inputs.upload`) didn't seem worth the cost
saved (this is executed only once a day).

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

* android: add attestation for nightly build artifacts

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

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-09-16 11:45:04 +00:00
Mukilan Thiyagarajan
b6d5ac09b0
mach: introduce BuildTarget abstraction (#33114)
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>
2024-08-26 13:08:21 +00:00
Samson
ebdae6094e
CI: Add separate Lint&Tidy check and remove test-tidy from linux (#33150)
* Create separate Lint&Tidy check

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Remove quick-check as it's not longer relevant

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add clippy to rust-toolchain

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fix try parser test expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* use lint in result

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Lint & Tidy -> Lint

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-23 08:58:12 +00:00
Mukilan Thiyagarajan
8052027dd4
ci: allow android builds on forks to skip keystore configuration (#32927)
Our build.gradle configuration already defaults to using the debug
keystore when the keystore is not configured so only the CI needs this
fix.

Fixes #32922

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-04 06:35:49 +00:00
Samson
2cf207ddc8
Free some space on android runners (#32907)
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-08-01 15:46:31 +00:00
Samson
d132a0273d
Update mozjs (SpiderMonkey) to 128.0 (#32769)
* Update mozjs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix changed readTransfer callback

https://bugzilla.mozilla.org/show_bug.cgi?id=1842713
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Use NewExternalArrayBuffer from glue

d33454be74
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix columnorigin and filename being in latin1

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup newexternalarray

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Float16 (this might require more work for codegen support)

https://bugzilla.mozilla.org/show_bug.cgi?id=1833647
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* js.strict is removed

https://bugzilla.mozilla.org/show_bug.cgi?id=1621603
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* asm options are now somewhere else

https://hg.mozilla.org/mozilla-central/rev/26045c88e3972957087d535e7f259e08857bd2a2
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Comment out offthread compilation

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set NDK to 26

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix 1-origin handling

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Expect `FinalizationRegistry` interface

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Good expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* more expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `WeakRef` to interfaces expectation

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* mozjs upgrade: fixes for Android

Android NDK's layout has changed in r26 and 'lib64' no longer exists
under `toolchain/llvm/prebuilt/linux-x86_64`. The libraries that used to
be it are now present in `lib` folder itself.

This patch updates the build configuration to use the `lib` folder
instead when configuring the LIBCLANG_PATH environment variable.

This patch also updates to a newer mozjs version that includes fixes for
linker errors faced on Android (see #32769).

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

* Patch libz-sys & update mozjs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* update NDK version in README

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

* Use servo/mozjs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update mozjs again

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-29 07:20:15 +00:00
Mukilan Thiyagarajan
b243457ccc
ci: fix security issue in try job workflow (#32724)
This [issue][1] was reported by GitHub user @RedYetiDev via the Security
Advisory reporting mechanism on GitHub. The fix is also based on their
proposed solution.

The issue is that `refs/pull/{pr_number}/head` points to the latest
commit of a PR and so it could be different than the commit that was
reviewed when the try label was applied. The fix is to use the exact commit
sha at the point when the try job is triggered, which is available in
the `github` context as  `github.event.pull_request.head.sha`.

[1]: https://github.com/servo/servo/security/advisories/GHSA-fxqr-xgh8-3577

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com>
2024-07-08 10:08:23 +00:00
Mukilan Thiyagarajan
24639bb540
android: sign release APK with a custom key. (#32721)
This PR adds support for signing all APKs we produce on the CI
with a custom signing key. Currently the logic falls back to
the debug key (which is generated by AGP and not persistent) if
the environment variable for the keystore is not set. This allows
local developer builds to work without requiring a key store.
Once #32720 is resolved, we could sign just the production builds
and remove the conditional logic.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-08 08:36:00 +00:00
Jonathan Schwender
26bbfe9b55
Make crown optional (#32494)
* Make `crown` optional

Add the optional `--use-crown` flag to mach

* --use-crown for all platforms in CI

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Add documentation for `--use-crown`

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Update python/servo/command_base.py

Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Raise Error if CARGO_BUILD_RUSTC conflicts with --use-crown

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* add dummy RUSTFLAG to trigger re-checking

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
2024-06-24 11:46:43 +00:00
Jonathan Schwender
1d2949f2b3
CI: Cache cargo-deny (#32543)
Use the `cargo-install` action to cache the cargo-deny output.
`cargo-deny` is currently unconditionally installed during bootstrap,
and takes around 2 minutes to install, so caching should give a
significant speedup

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-06-18 09:55:13 +00:00
Mukilan Thiyagarajan
1bcb4787d2
ci: enable sccache for Rust compilation. (#32330)
This was previously disabled in #30508 due to sccache not
working well with crown. The sccache issue (mozilla/sccache#861)
linked in that PR is now closed and [testing][1] on my fork also
seems to indicated we should be able to turn on sccache again.

[1]: 9154196647

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-21 06:10:54 +00:00
Mukilan Thiyagarajan
3b1bbc1aaf
android: add CI build for aarch64 (#32137)
I haven't tested the APK since I don't have a device with 64-bit ARM.

---

- [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 the PR only modifies CI
workflow.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-04-23 14:15:03 +00:00
Oriol Brufau
ea62a5e24f
Use --locked when building in CI (#31720)
Thus the build will immediately fail if a PR modifies Cargo.toml but
forgets to include the changes in Cargo.lock

This was previously checked by lockfile_changed.sh after building
normally, wasting resources.
2024-03-21 11:54:02 +00:00
Mukilan Thiyagarajan
4bca55e27a
android: add support for x86_64 images (#31725)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-03-18 09:44:10 +00:00
Samson
cd92a17c5e
ci: Update remaining GitHub actions to versions using Node.js 20 (#31450)
* Update sccache action

* Update baptiste0928/cargo-install

* Update github-script

* Update actions/setup-java

* Update nick-fields/retry
2024-02-29 08:24:38 +00:00
Martin Robinson
2946fa83ec
ci: Switch to actions/checkout@v4 (#31379)
This change also removes the use of `fetch-depth: 2` where it isn't
necessary. These were likely copy-and-pasted from other workflows.
2024-02-19 16:23:53 +00:00
Martin Robinson
1cc546c4fc
ci: Switch to version 4 of GitHub artifact actions (#31357)
* ci: Switch to version 4 of GitHub artifact actions

This switches to version 4 of the GitHub artifact actions, which
requires producing a single artifact per job and adding merge steps. In
addition, the names of artifacts are standardized:

- Build: <profile>-binary-<platform>
- Full WPT results (only on failure): wpt-full-logs-<platform>-<layout>
- Filtered WPT results (only on failure): wpt-filtered-logs-<platform>-<layout>

* Delete merged build timings and combine with Result job

* Always archives logs even after test failures

* Correct the name of the log files for WPT import
2024-02-17 16:59:43 +00:00
Samson
b10875956a
Delete result job in leaf workflows (#31191) 2024-01-27 00:07:04 +00:00
Samson
a5c512808a
Matrix in CI and mach try with presets (#31141)
* Matrix in CI and mach try with presets

* small fixups

* names in trigger try run comment

* let

* f

* rename step

* fix running try on win

* fix try branch full

* py3.10

* typo

* Make unit-tests default to false, except in basic os runs

Fixes https://github.com/servo/servo/issues/31174

* make full use linux-wpt & linux-wpt also include unit-tests

so full is equal to main workflow

* Stylish fixes

* cmp json as dict
2024-01-26 12:29:37 +00:00
Mukilan Thiyagarajan
d7de206dbd
Preliminary Android build support (#31086)
* Android build

* Fixes
* More fixes
  - Still failing in the linking step
* More work on getting linking working

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

* android: use mozjs with ndk r25c. loads servo.org

more android build fixes.

* fix ./mach run for android and make it follow logs

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

* add experimental logic for compositor pause/resume

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

* pass DPI from android to simpleservo

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

* ci: add android workflow

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

* switch to ANDROID_SDK_ROOT and ANDROID_NDK_ROOT vars

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

* upgrade gradle to 4.10.1

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

* upgrade to gradle 5.1.1

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

* upgrade to gradle 8 and agp 8

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

* make compositing work again with external present

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

* android: improve mach support for non-NixOS and CI

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

* fix sampler compilation bug introduced in #30490

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

* ci: add android build to main workflow

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

* gradle: set MinSdk = targetSdk = 30

NDK requires we compile against the minSdk API level
which is 30 in our case.

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

* add instructions for android in README.md

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

* apk: move servosurface to servoview

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

* apk: uncomment the mediasession callbacks on MainActivity

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

* apk: fix crash on MainAtivity.onDestroy

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

* apk: drop VR, arm 5 and unused code

This commit drops:
* support for google, oculusvr
* support for arm5 architecture

and also removes
* fakeld scripts
* unused java code

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

* cleanup shell.nix

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

* android: add FIXMEs for gstreamer code

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

* apk: remove commented code and debug logs

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

* cleanup ServoView.java

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

* mach: comment call to download gstreamer deps for android

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

* disable bluetooth for jniapi as blurdroid is broken

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

* fixup! README.md

* fixup! remove change in Cargo.toml

* fixup! move shell variables together

* fixup! cleanup jniapi/Cargo.toml comments

* delete commented gstreamer related android code

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

* remove unused config variable in servbuild

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

* android: more cleanup

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

* force no_static_freetype only for android

* use actions to manage sdk, ndk and java

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

* rename embedder event names to be more clear.

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

* link to startup crash issue

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

* fix lint issues

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

* upgrade env_logger to 0.10 with duplicate exception

libservo and android_logger can use env_logger 0.10
but quickcheck is still stuck on 0.8 and has not seen
any activity in the last 2 years. This commit adds
a duplicate exception until the quickcheck dependency
can be upgraded (or replaced)

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

* android: fix comments

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

* disable jemalloc on android

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

* fixup! replace linux with android in cfg

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-01-22 13:00:15 +00:00