Commit graph

515 commits

Author SHA1 Message Date
Martin Robinson
23524a5413
libservo: Move size handling to RenderContext from WindowMethods (#35621)
This is the first step toward removing `WindowMethods`, which will
gradually be integrated into the `WebView` and `WebViewDelegate`. Sizing
of the `WebView` is now handled by the a size associated with a
`RenderingContext`. `WebView`s will eventually just paint the entire
size of their `RenderingContext`. Notes:

- This is transitionary step so now there is a `WebView::resize` and a
  `WebView::move_resize`. The first is the future which will resize the
  `WebView` and its associated `RenderingContext`. The second is a
  function that the virtual `WebView`s that will soon be replaced by a
  the one-`WebView` per `WebView` model.
- We do not need to call `WebView::move_resize` at as much any longer
  because the default size of the `WebView` is to take up the whole
  `RenderingContext`.
- `SurfmanRenderingContext` is no longer exposed in the API, as a
  surfman context doesn't naturally have a size unless a surface is
  bound to it.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-25 15:03:53 +00:00
Simon Wülker
be6765447d
Update to rust 1.85 (#35628)
* Update to rust 1.85

This is needed for cargo-deny

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Upgrade crown

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Clippy fixes

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Re-upgrade cargo-deny to 0.18

Keeping it locked to 0.18 just in case they
update their required rustc version again

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-02-24 17:44:35 +00:00
Martin Robinson
71bfd2d13f
libservo: Don't bounce ready-to-present frame notifications to the Constellation (#35369)
Instead of telling the Constellation to tell the embedder that new
frames are ready, have the compositor tell the embedder directly. This
should reduce frame latency. Now, after processing compositor
updates, run any pending `WebView::new_frame_ready` delegate methods.

This change also removes the `refresh` call from the Java interface as
that was the only other place that the compositor was rendering the
WebRender scene outside of event looping spinning. This `refresh` call
was completely unused.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-12 08:25:58 +00:00
Samson
724f701f79
crown: Pass --cfg crown to rustc from crown (#35073)
* crown: Pass `--cfg crown` to rustc from crown

also includes minor fix in crown for wrapper running based on clippy code

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

* fix doc

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

* Update python/servo/command_base.py

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>
2025-01-31 18:08:04 +00:00
Josh Matthews
a014da590a
Support future uses of traits with associated types in rooting analysis (#34359)
* crown: Support Rc<T::Promise> and callback objects parameterized over a trait..

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* crown: Verify that attributes match between trait associated types and impls.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* crown: Check type aliases as part of associated type checks.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* crown: Add periods to all diagnostic messages.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Tidy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix compile-fail test expectations.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-16 20:22:40 +00:00
Nico Burns
deb819f233
Upgrade rustc to 1.83 (#34793)
* Upgrade rustc to 1.83

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix crown (change copied from linked clippy function)

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix named lifetime lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Bump shell.nix

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix non-local impl warnings

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Format with 1.83 formatting changes

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix manual non-local impl

Signed-off-by: Nico Burns <nico@nicoburns.com>

* More fixes for crown

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix tidy

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix needless_return lints

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix doc comment lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix missing wait lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Allow needless_lifetimes lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* more doc comments

Signed-off-by: Nico Burns <nico@nicoburns.com>

* More needless_returns

Signed-off-by: Nico Burns <nico@nicoburns.com>

* is_empty lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix needless_lifetime lints

Signed-off-by: Nico Burns <nico@nicoburns.com>

* fix div_ceil lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Allow non-minimal bool

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Non-local impl in constellation

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Missing wait in constellation

Signed-off-by: Nico Burns <nico@nicoburns.com>

* fmt

Signed-off-by: Nico Burns <nico@nicoburns.com>

* remove useless lints table

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fixup comments

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Allow non-local definition in sandboxing code to simplify feature flagging

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Remove wait calls and allow zombie_processes lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-01-01 09:38:28 +00:00
Jonathan Schwender
6a816649d6
Upgrade Rust to 1.82.0 (#34592)
* Fix deprecated PanicInfo alias

Fixes:
```rust
use of deprecated type alias `std::panic::PanicInfo`: use `PanicHookInfo` instead
```

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

* build: upgrade rustc to 1.82.0

Tracking issue for the silenced lints:
https://github.com/servo/servo/issues/34591

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

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-12-12 12:00:51 +00:00
Mukilan Thiyagarajan
7fcde1f7a3
build: upgrade rustc to 1.81.0 (#34270)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-12-12 07:26:16 +00:00
Jonathan Schwender
dfcbb18a8b
android: Fix flinging downwards (#34584)
* android: Fix onScroll source

Scrolling should be based on `e2`, the second event, since dX and
dY are relative to e2 and not e1.

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

* android: Fix flinging down on android.

We need to ensure x and y are inside the window, otherwise servo will
not scroll!

Our fling implementation will set `mCurX` and `mCurY` to a very high
initial value when flinging with a negative velocity, since we don't
know the size of our content page and the android `OverScroller`
needs to know the size of the page.

Setting the page size to a ridiculously high value ensures that flinging
will not be cut of short, even if we fling farther then the edge of the
screen, starting from the touch up point.

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

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-12-12 04:54:50 +00:00
Jonathan Schwender
bb1d2bd0f2
ohos: Improve argument filtering (#34422)
This avoids future crashes if new unknown parameters
are passed by the runtime to the app.
It does make it slightly more inconvenient for the user,
since they must use `=` and space at the right place now.
This will also be updated in the book accordingly

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-12-02 08:17:53 +00:00
Jonathan Schwender
7489e3d5f4
ohos: Support swiping to go back (#34433)
Override the `onBackPress` callback, which by default
brings the application to the background and instead
tell servo to go back one page.
Users can invoke this by swiping from the left edge to the middle.
There is no equivalent callback / gesture to go forward.
In the default browser swiping from the right side to the middle
also invokes the goBack callback.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-12-01 12:06:04 +00:00
Josh Matthews
c60e4afbee
Support custom derives for generated types (#34356)
* script: Derive more Default implementations for dictionaries.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Support arbitrary derives on generated enums.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Support arbitrary derives for generated dictionaries.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Support arbitrary derives for generated unions.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Derive more impls for generated dicts and unions.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Implement FromStr for generated enums.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* crown: Allow returning unrooted values from Default::default.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-11-24 18:15:50 +00:00
Delan Azabani
67012a5091
Remove etc/shell.nix in favour of shell.nix (#34336)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
2024-11-22 04:03:35 +00:00
LN Liberda
06dce314f8
crown: fix build for rust 1.82 on musl (#34307)
Signed-off-by: LN Liberda <lauren@selfisekai.rocks>
2024-11-20 15:32:39 +00:00
Jonathan Schwender
538ac61a82
ohos: Add basic IME and keyboard support (#34188)
* ohos: Add basic IME and keyboard support

- Add extremely basic support for keyboard events
- Add basic IME support
   - Showing and hiding the IME
   - inserting text
   - deleting characters
   - very basic configuration of the IME

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

* Apply suggestions from code review

Improve the log message

Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>

* Update ports/servoshell/egl/ohos.rs

Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>

* ohos: Bump the minimum required SDK version to 5.0

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

* ohos: Remove pub from callbacks

The callbacks don't need to be public, as we will be registering them.

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

* Rename composition event

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

* ohos: clippy in log

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

* ohos: address some clippy warnings

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

* ohos: Raise Error in mach if unsupported SDK version is used.

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

* Add keyboard-types dependency for android

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

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
2024-11-15 15:04:48 +00:00
Mukilan Thiyagarajan
114cf9a1cc
ohos: avoid passing some cli arguments to servo (#34237)
These following four OHOS specific arguments are being passed by the
OHOS runtime to the EntryAbility, which then passess them on to Servo's
argument parsing logic:

* `--debugApp=false`
* `--send_to_erms_targetAppDistType=os_integration`
* `--send_to_erms_targetAppProvisionType=release`
* `--send_to_erms_targetBundleType=0`

When Servo's argument parsing logic encounters an unrecognized argument,
it terminates the process after logging an error to stderr (which is not
visible in hilog).

This patch simply filters out these arguments so the parsing logic
doesn't fail.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-11-13 12:50:40 +00:00
Samson
39ef61c324
Exclude crown from the root Cargo workspace (#34173)
* Exclude crown from workspace

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

* Update shell.nix and remove filterlock

Signed-off-by: Delan Azabani <dazabani@igalia.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2024-11-08 10:08:49 +00:00
Samson
6c2b840e37
Support associated types in must_root lint (#34163)
* Support associated types in must_root lint

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

* fix

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

* fixups

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

* fixup

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

* Fix crown violations

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

* fix eng

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

* make new test use RUSTC_BOOTSTRAP=1

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

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-11-06 18:48:57 +00:00
Clocks
cc6f7c5bc4
Conversion to Gradle KTS (#33772)
* Convert settings.gradle to Kotlin Script

Stage 1 of #33742

Signed-off-by: clocks <doomsdayrs@gmail.com>

* servoview-local: Convert build.gradle to Kotlin Script

Stage 1 of #33742

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Convert build.gradle to Kotlin Script

This was a trickier one, as I wanted to maintain compatibility with the rest of the files while facilitating this migration.

Closures are annoying, another annoyance of loosely typed languages in an OOP project.

Migration of child build scripts will require the reverse code and or migration of this scripts functions to kotlin lambdas / functions (which are just jvm functions).

Code based off of the following guide.
https://docs.gradle.org/current/userguide/kotlin_dsl.html#groovy_closures_from_kotlin

Stage 1 of #33742

Signed-off-by: clocks <doomsdayrs@gmail.com>

* servoapp: Convert build.gradle to Kotlin Script

Migrated deprecated API usages.
There are two more, but ignored for now.
("splits.density", "capitalize")

Stage 1 of #33742

Signed-off-by: clocks <doomsdayrs@gmail.com>

* servoview: Convert build.gradle to Kotlin Script

Migrated deprecated API usages.
There are two more, but ignored for now.
("splits.density", "capitalize")

Stage 1 of #33742

Signed-off-by: clocks <doomsdayrs@gmail.com>

* servoview: Replace ResourceGroovyMethods with Kotlin File.walk

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Replace Groovy Closures with Kotlin Lambda types

Stage 1 of #33742

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Move Utility fields to buildSrc

Using extra fields is quite annoying and makes it hard to maintain
 API stability.

"buildSrc" is designed for this task, and thus is being used
 for said task.

This means that when editing build.gradle files in an Android Studio,
 there is a direct reference to the source of a function.
 (Easier time referring to documentation, source of function, etc).

More information here:
https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html

Stage 1 of #33742

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Sync target SDK to 33

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Make Notification actions immutable.

Otherwise android lint will be upset.

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Move dependencies from servoview to servoapp

ServoView does not use them.

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Add POST_NOTIFICATIONS to manifest

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Add host to intent-filter

Use "*" for any host, lets hope this works.

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Solve ndkBuild tasks not being linked

The problem stems from something something groovy wishy washy unclear
 execution order something Kotlin explicit execution order.

Merge tasks exist after the project is evaluated.
 The problem is that simply running afterEvaluate causes an
 ConcurrentModificationException. This is because of creating a new
 task while looping over existing tasks. To remedy this we simply
 filter the tasks first, than create and link the new task.

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Add documentation to why some functions are extensions to Project

Signed-off-by: clocks <doomsdayrs@gmail.com>

* android: drop the host directives from AndroidManifest.xml

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

---------

Signed-off-by: clocks <doomsdayrs@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-11-01 08:04:28 +00:00
Clocks
7df18aecfe
Upgrade Android Gradle (#33681)
* Upgrade to Gradle 8.9

Gradle 8.0 is no longer supported by Android Studio.

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Upgrade to AGP to 8.7

Signed-off-by: clocks <doomsdayrs@gmail.com>

* Update to Android Build Tools 34.0.0

Signed-off-by: clocks <doomsdayrs@gmail.com>

---------

Signed-off-by: clocks <doomsdayrs@gmail.com>
2024-10-09 05:25:22 +00:00
Alex Touchet
dcedfab44f
Attempt to link to MPL-2.0 license page in Windows installer (#33711)
Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2024-10-08 09:24:23 +00:00
Jonathan Schwender
9fcfe09e51
ohos: Add toast prompt (#33621)
* ohos: Add toast prompt

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

* ohos: Add toast on `load_ended`

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

* Apply review feedback

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>
2024-10-03 16:33:21 +00:00
Jonathan Schwender
e534c7d461
ohos: Allow passing arguments to servoshell (#33588)
* ohos: Bump minimum CMake version

By bumping the minimum CMake version, we avoid a deprecation warning.
The OH 4.0 SDK ships with CMake 3.16, so we can be sure that we have CMake 3.16
or newer available.

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

* ohos: Allow passing arguments to servoshell

Allows passing options passed via `wants` to the Ability through to servoshell.
This allows easier debugging, either by calling servoshell from a test app,
or from the commandline, e.g.
```
hdc shell aa start -a EntryAbility -b org.servo.servoshell -U "https://www.wikipedia.org" \
 --pb dom.webgpu.enabled true \
 --ps dom.webgpu.wgpu_backend "gl" \
 --pi layout.threads 4
```

Note: While the OH `wants` API differentiates between boolean, string and integer values, we convert
everything back to strings, so we can reuse the same parsing code as the desktop servoshell.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
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>
2024-10-02 04:27:18 +00:00
Jonathan Schwender
7fdaccde55
ohos: Support product flavors (#33512)
* ohos: Support product flavors

Support different product flavors (e.g. with different signing
configurations) by supporting --flavor on ohos.
The flavor influences the package path for OH packages, so
allow the flavor parameter on build + package + install

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

* Fix smoketest

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

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-09-26 06:58:30 +00:00
Jonathan Schwender
88ffe9f7a5
ohos: Bundle resource files in hap (#33513)
Bundle resource files into the .hap, so they are available
as files in the application sandbox, instead of included
into the shared library.
This should slightly reduce the binary size in debug and
release mode.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-09-24 04:29:53 +00:00
Jonathan Schwender
d3d6a22d27
ohos: Add back and fwd button to vendored app (#33511)
25372340 added back and forward apis to the ohos servoshell.
157e28c5 vendored the ohos demo ArkTS app into the servo repo,
but did not include the back and forward buttons, which
were added in the meantime.
This commit adds the missing back and forward buttons to the ArkTS code.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-09-23 03:57:34 +00:00
Mukilan Thiyagarajan
157e28c59b
openharmony: add servoshell for ohos (#33295)
* openharmony: add servoshell for ohos

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

* ohos: handle missing signing config on forks

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

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-09-20 08:20:27 +00:00
Martin Robinson
aa0029c11c
Add rust-version to all Cargo.toml files (#33483)
This is another step preparing for building Servo without `mach`.

Fixes #33430.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-17 16:39:07 +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
Daniel Adams
a976db3ec0
Update layout of servoshell android app (#33294)
* Update layout of servoshell android app

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove gap after loop/idle text

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-09-04 11:30:52 +00:00
Erik Hennig
e5caa725da
Fix a memory leak in components/script/script_runtime.rs and add more leak suppressions (#33175)
* asan: Add suppression for known false positive

Signed-off-by: ede1998 <online@erik-hennig.me>

* fix: re-suppress lazy_static leaks

lazy_static is still used by dependencies and still leaks
from static variables.

Signed-off-by: ede1998 <online@erik-hennig.me>

* fix: Memory leak of Box<NetworkingTaskSource>

Signed-off-by: ede1998 <online@erik-hennig.me>

---------

Signed-off-by: ede1998 <online@erik-hennig.me>
2024-08-26 07:33:23 +00:00
Hayashi Mikihiro
6816d11f88
replace once_cell (#33080)
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2024-08-16 04:49:50 +00:00
Hayashi Mikihiro
4cc1b68546
Remove lazy static (#33078)
* remove from rand

Mutex<OsRng> can be initialized in compile time.

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* remove from layout_2020

Mutex<()> can be initialize in compile time

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* remove from media

`IS_MULTIPROCESS` doesn't be used.

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* remove lazy_static from dependencies

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* rewrite suppressed_leaks_for_asan.txt

For all of lazy_static was replaced with LazyLock.

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

---------

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2024-08-16 03:57:09 +00:00
Hayashi Mikihiro
3c271fb298
Update to rust 1.80.0 (#32896)
* Update for nix

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Update to Rust 1.80.0

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Rename to BindingMode from BindingAnnotation

https://github.com/rust-lang/rust/pull/124047
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Remove TypeVariableOriginKind

https://github.com/rust-lang/rust/pull/123016
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Remove TypeVariableOrigin

https://github.com/rust-lang/rust/pull/124955
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Remove LintDiagnostic::msg

rust-lang/rust#125410

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* common.rs fmt mistake indents

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* trace_in_no_trace.rs remove mistake space

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* trace_in_no_trace.rs remove mistake head space

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Workaround for https://github.com/servo/servo/issues/32912

It's dirty but it worked on 2000 runs

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

---------

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-08-07 08:40:18 +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
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
93fdb8263d
Make task_info as macos specific (#32693)
rust-analyzer breaks on Linux (when invoked without mach), because it
tries to compile the c files, and doesn't find `mach_init.h`
Since we don't need task_info on non-mac platforms, just make the
crate empty on other platforms.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-07-04 09:21:49 +00:00
Martin Robinson
30dad2565f
android: Rename the Android app to reflect servo.org ownership and servoshell (#32554)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-06-24 15:39:57 +00:00
Erik Hennig
8121c98834
Add suppression comments + Suppress lazy_static (#32584)
Co-authored-by: Jonas Zeunert <jonas@zeunert.org>
2024-06-23 17:21:16 +00:00
Mukilan Thiyagarajan
cc1c31ef3f
crown: remove references to workspace manifest (#32567)
The way our shell.nix works requires crown's Cargo.toml to be
self-contained so that it can be built as a nix derivation in
isolation.

Fixes #32552.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-20 06:50:50 +00:00
Jonathan Schwender
24906e1c21
Move android port code to servoshell (#32533)
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-19 03:34:08 +00:00
Martin Robinson
4a7f3bac7c
Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
Erik Hennig
3c1c395dfc
Restore accidentally deleted suppression file and suppress intentional leak in stylo #32223 (#32527)
Co-authored-by: Jonas Zeunert <jonas@zeunert.org>
2024-06-17 16:42:01 +00:00
Gae24
e6ea4a9c29
Android: fix url resolution (#32422)
* fix localhost

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* android: parse search bar field in rust

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* Update comment to reflect new function behavior

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-10 10:03:07 +00:00
Samson
b28314d33e
Update to Rust 1.78 (#32217)
* Update to rust 1.78

* Update crown for rust 1.78

* rust 1.78 is now stable

* Update for nix

* Update comment

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

* Update support/crown/src/common.rs

* Update support/crown/Cargo.toml

* Update support/crown/src/common.rs

* Fix ipc problem

* Update ipc-channel to 0.18.1

* fixed fixme

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-01 06:49:28 +00:00
dependabot[bot]
5fafc82730
build(deps): bump compiletest_rs from 0.10.2 to 0.11.0 (#32408)
Bumps [compiletest_rs](https://github.com/Manishearth/compiletest-rs) from 0.10.2 to 0.11.0.
- [Release notes](https://github.com/Manishearth/compiletest-rs/releases)
- [Commits](https://github.com/Manishearth/compiletest-rs/compare/v0.10.2...v0.11.0)

---
updated-dependencies:
- dependency-name: compiletest_rs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 08:01:34 +00:00
Gae24
fe6e1cfb29
Android: load url from Intent, plus fixed some warnings (#32160)
* update gitignore folder with android build files

* address some warnings

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix servo not loading url from Intent

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* format

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* InitOptions, added url field to avoid override homepage url

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* actually there is a gitignore file in the android folder

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* Restore buildToolsVersion property

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2024-04-29 13:14:10 +00:00
Mukilan Thiyagarajan
c50df5ccbe
nix build: replace fetchCargoTarball with importCargoLock (#31825)
[`importCargoLock`][1] allows us to use the existing Cargo.lock
file. This means we no longer need to update the sha256 hash
whenever the dependencies are upgraded. It also integrates
with nix's rustToolchain support via `cargoSetupHooks` and
automatically vendors the dependencies, allowing us to simplify
the logic for `filterlock` derivation.

[1]: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md#vendoring-of-dependencies-vendoring-of-dependencies

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-03-25 05:32:55 +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
eri
6c7fe31db1
clippy: fix warnings on modules outside components (#31567) 2024-03-07 23:42:39 +00:00