Commit Graph

132 Commits

Author SHA1 Message Date
Nan Jiang
9aa0a9fd0e Bug 1923187: part 1 - Prepare relevance scoring facilities r=adw,bdk
Differential Revision: https://phabricator.services.mozilla.com/D225140
2024-10-11 02:33:01 +00:00
Ben Dean-Kawamura
67b31442a0 Bug 1913982 - Re-enable UniFFI callback interfaces, r=nika,lina
The FFI for this changed upstream.  Instead of registering a single
function that inputs a single buffer packed with all arguments, you now
register a function for each method where there is a 1-1 mapping of
arguments. The entire interface is represented by a "vtable" -- AKA a
struct that has a field for each of the method handler functions

To implement the methods, I stole the pattern we were using for regular
calls where we define a base class that's implemented by normal code and
a subclass that's implemented by generated code.

Registering/deregistering callback interfaces is now handled by the
generated code directly.  It's simpler this way and now that we don't
have the split between regular and fixture scaffolding, there's not much
need for shared code to handle this.

Kept the decision before to only support "fire-and-forget" callbacks. I
think we will want to revisit this when the we support UniFFI async, but
we can save that for later.

Differential Revision: https://phabricator.services.mozilla.com/D222027
2024-10-02 17:49:09 +00:00
Ben Dean-Kawamura
c3b35f3427 Bug 1918509 - Generate more FFI definitions, r=lina
Generate FFI definitions for all FFI types, not just scaffolding
functions.  These definitions are not used yet, but this is prep work
for re-enabling callback interface support and adding async support.

Differential Revision: https://phabricator.services.mozilla.com/D222026
2024-10-02 17:49:09 +00:00
Ben Dean-Kawamura
ae6c62c66d Bug 1918134 - Add tests for trait interfaces, r=lina
I thought we needed to write some code to implement trait interfaces,
but they actually already work.  So, let's just add a simple test for
them.

Differential Revision: https://phabricator.services.mozilla.com/D222025
2024-10-02 17:49:08 +00:00
Iulian Moraru
1fb265ccfb Backed out 3 changesets (bug 1913982, bug 1918509, bug 1918134) for causing hazard build bustages related to UniFFI. CLOSED TREE
Backed out changeset 5052882d0b42 (bug 1913982)
Backed out changeset c9228cdd8d23 (bug 1918509)
Backed out changeset 09325d77592d (bug 1918134)
2024-10-02 05:59:33 +03:00
Ben Dean-Kawamura
c029b92a67 Bug 1913982 - Re-enable UniFFI callback interfaces, r=nika,lina
The FFI for this changed upstream.  Instead of registering a single
function that inputs a single buffer packed with all arguments, you now
register a function for each method where there is a 1-1 mapping of
arguments. The entire interface is represented by a "vtable" -- AKA a
struct that has a field for each of the method handler functions

To implement the methods, I stole the pattern we were using for regular
calls where we define a base class that's implemented by normal code and
a subclass that's implemented by generated code.

Registering/deregistering callback interfaces is now handled by the
generated code directly.  It's simpler this way and now that we don't
have the split between regular and fixture scaffolding, there's not much
need for shared code to handle this.

Kept the decision before to only support "fire-and-forget" callbacks. I
think we will want to revisit this when the we support UniFFI async, but
we can save that for later.

Differential Revision: https://phabricator.services.mozilla.com/D222027
2024-10-01 19:22:16 +00:00
Ben Dean-Kawamura
0d3a307b4a Bug 1918509 - Generate more FFI definitions, r=lina
Generate FFI definitions for all FFI types, not just scaffolding
functions.  These definitions are not used yet, but this is prep work
for re-enabling callback interface support and adding async support.

Differential Revision: https://phabricator.services.mozilla.com/D222026
2024-10-01 19:22:16 +00:00
Ben Dean-Kawamura
e90627c478 Bug 1918134 - Add tests for trait interfaces, r=lina
I thought we needed to write some code to implement trait interfaces,
but they actually already work.  So, let's just add a simple test for
them.

Differential Revision: https://phabricator.services.mozilla.com/D222025
2024-10-01 19:22:15 +00:00
Ben Dean-Kawamura
16ea6863b4 Bug 1921280 - Vendor in the latest app-services commit, r=adw,urlbar-reviewers
This brought in a breaking change: `Suggestion.icon` is now the `bytes`
type.  To accomidate that, added UniFFI support for bytes and updated
the SuggestBackendRust code since that field is now a Uint8Array on the
JS side.

Differential Revision: https://phabricator.services.mozilla.com/D223774
2024-09-30 14:07:55 +00:00
Ben Dean-Kawamura
b4054f4e78 Bug 1910404 - UniFFI proc-macro support, r=lina,firefox-build-system-reviewers,glandium
Switched to library mode for generating bindings.

Updated our strategy for UniFFI components/fixtures.  There's now a
crate for components and a crate for fixtures.  These crates are a
dependency of gkrust-shared and also built as standalone libraries which
UniFFI uses to generate the bindings.

One upshot of this is that we no longer need the `crate_name` or
`udl_file` config values.  library-mode can figure out the udl paths
automatically.

Differential Revision: https://phabricator.services.mozilla.com/D221824
2024-09-16 15:18:07 +00:00
Sammy Khamis
de064bb2e7 Bug 1911626: Vendor in application-services with tabs exposing closing the connection r=lina
Differential Revision: https://phabricator.services.mozilla.com/D222064
2024-09-13 05:13:43 +00:00
Ben Dean-Kawamura
79788192df Bug 1915644 - Generate a single scaffolding file, r=markh
Differential Revision: https://phabricator.services.mozilla.com/D220635
2024-09-10 17:44:06 +00:00
Ben Dean-Kawamura
e3caa3bae4 Bug 1915642 - C++ intermediate representation, r=markh
Use an intermediate representation for the C++ codegen.  This means
converting types from `uniffi::interface` into something that can be
directly rendered in the templates.  "Intermediate representation" is
maybe too fancy of a term, but I like the compiler metaphor.

See the bug description for the theory behind this.  I like the
difference when seeing it in practice.  The template code definitely
gets simpler.

Also, start using the `Component` type, which combines a
`ComponentInterface` and `Config`, rather than always using a tuple.

Differential Revision: https://phabricator.services.mozilla.com/D220634
2024-09-10 17:44:05 +00:00
Sandor Molnar
05645328cd Backed out 2 changesets (bug 1915642, bug 1915644) for causing build bustages @ UniFFICallbacks.cpp
Backed out changeset 56886ded7f3c (bug 1915644)
Backed out changeset 8e63d2de8f52 (bug 1915642)
2024-09-10 18:37:38 +03:00
Ben Dean-Kawamura
7114ad319a Bug 1915644 - Generate a single scaffolding file, r=markh
Differential Revision: https://phabricator.services.mozilla.com/D220635
2024-09-10 14:00:35 +00:00
Ben Dean-Kawamura
6a4933416b Bug 1915642 - C++ intermediate representation, r=markh
Use an intermediate representation for the C++ codegen.  This means
converting types from `uniffi::interface` into something that can be
directly rendered in the templates.  "Intermediate representation" is
maybe too fancy of a term, but I like the compiler metaphor.

See the bug description for the theory behind this.  I like the
difference when seeing it in practice.  The template code definitely
gets simpler.

Also, start using the `Component` type, which combines a
`ComponentInterface` and `Config`, rather than always using a tuple.

Differential Revision: https://phabricator.services.mozilla.com/D220634
2024-09-10 14:00:35 +00:00
Ben Dean-Kawamura
2491f6b3cc Bug 1914241 - Upgrade UniFFI to 0.28.1, r=glandium,supply-chain-reviewers
- Ran `cargo update -p glean`
- Removed build/rust/heck now that everything depends on 0.5.
- Ran `mach vendor rust`

Differential Revision: https://phabricator.services.mozilla.com/D219800
2024-09-09 15:42:32 +00:00
Noemi Erli
e999b9af70 Backed out 2 changesets (bug 1888472) for causing failures in LateWriteChecks.cpp CLOSED TREE
Backed out changeset 20292c37151c (bug 1888472)
Backed out changeset 66ec9b374142 (bug 1888472)
2024-09-06 21:02:17 +03:00
lougeniac64
5ccdefe6b6 Bug 1888472 - Vendored A-S with webext-storage bridged engine logic r=lina
Differential Revision: https://phabricator.services.mozilla.com/D213095
2024-09-06 16:11:26 +00:00
Butkovits Atila
549a9db1e5 Backed out 2 changesets (bug 1888472) for causing failures at test_StorageSyncService.js. CLOSED TREE
Backed out changeset c6d3b6e81216 (bug 1888472)
Backed out changeset 9a58bdc9bb10 (bug 1888472)
2024-09-04 23:19:33 +03:00
lougeniac64
2f839d0a37 Bug 1888472 - Vendored A-S with webext-storage bridged engine logic r=lina
Differential Revision: https://phabricator.services.mozilla.com/D213095
2024-09-04 18:02:51 +00:00
Drew Willcoxon
18fdf339a0 Bug 1916530 - Vendor application-services dbeaef2eb28e9da7cc2f96e26296513cc4e07c07. r=bdk
This vendors in dbeaef2eb2

Differential Revision: https://phabricator.services.mozilla.com/D220931
2024-09-03 20:05:11 +00:00
Ben Dean-Kawamura
35bdc1bca2 Bug 1914019 - Rename UniFFI template helper methods, r=lina
The "js_" or "cpp_" prefixes help clarify the differences between
similar methods.  "js_name" is the name of something in the JS code and
"cpp_name" is the name of something in the C++ code.

Differential Revision: https://phabricator.services.mozilla.com/D219686
2024-08-20 18:41:10 +00:00
Ben Dean-Kawamura
3f160ecae8 Bug 1913183 - Vendor in app-services, r=nanj,supply-chain-reviewers,urlbar-reviewers,adw
Removed the `IsValid` check when converting a `RustBuffer` to an
`OwnedRustBuffer`.  The vendored changes revealed some issues with this
logic.  See https://bugzilla.mozilla.org/show_bug.cgi?id=1913183#c4 for
details.

Differential Revision: https://phabricator.services.mozilla.com/D219189
2024-08-16 16:18:07 +00:00
Butkovits Atila
c1a96ccedd Backed out changeset c48afa57d242 (bug 1913183) for causing failures at test_quicksuggest_fakespot.js. CLOSED TREE 2024-08-15 23:44:03 +03:00
Ben Dean-Kawamura
d0725f213e Bug 1913183 - Vendor in app-services, r=nanj,supply-chain-reviewers
Removed the `IsValid` check when converting a `RustBuffer` to an
`OwnedRustBuffer`.  The vendored changes revealed some issues with this
logic.  See https://bugzilla.mozilla.org/show_bug.cgi?id=1913183#c4 for
details.

Differential Revision: https://phabricator.services.mozilla.com/D219189
2024-08-15 19:35:32 +00:00
Iulian Moraru
10e749124c Backed out changeset 7ef1531763cd (bug 1913183) for causing mass assertion failures on OwnedRustBuffer.cpp. CLOSED TREE 2024-08-15 16:04:43 +03:00
Ben Dean-Kawamura
694b313f93 Bug 1913183 - Vendor in app-services, r=nanj,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D219189
2024-08-15 12:30:13 +00:00
Ben Dean-Kawamura
1af4217925 Bug 1899351 - remove ScaffoldingCall.h. r=nika,markh
The C++ templates were hard to understand and modify.  Instead of using
the templates, let's monomorphize by hand and generate equivalent
classes for each FFI function signature.

I tried a slightly different approach for the template code. .  In the
template struct itself, we now generate some simple Rust structs with
all the data the templates need. I like this because it's easier to
compute these values in Rust than in an Aksama template.

Differential Revision: https://phabricator.services.mozilla.com/D212342
2024-07-26 18:38:05 +00:00
Tamas Szentpeteri
72c29c954f Backed out changeset 8dfe5421b0ca (bug 1899351) for causing hazard bustages on OwnedRustBuffer.cpp. CLOSED TREE 2024-07-24 21:31:50 +03:00
Ben Dean-Kawamura
b370b4df6c Bug 1899351 - remove ScaffoldingCall.h. r=nika,markh
The C++ templates were hard to understand and modify.  Instead of using
the templates, let's monomorphize by hand and generate equivalent
classes for each FFI function signature.

I tried a slightly different approach for the template code. .  In the
template struct itself, we now generate some simple Rust structs with
all the data the templates need. I like this because it's easier to
compute these values in Rust than in an Aksama template.

Differential Revision: https://phabricator.services.mozilla.com/D212342
2024-07-24 14:30:09 +00:00
Noemi Erli
21f78de73c Backed out changeset 17db47e97052 (bug 1899351) for causing failures in OwnedRustBuffer.cpp CLOSED TREE 2024-07-23 22:47:36 +03:00
Ben Dean-Kawamura
2f26a4bc8c Bug 1899351 - remove ScaffoldingCall.h. r=nika,markh
The C++ templates were hard to understand and modify.  Instead of using
the templates, let's monomorphize by hand and generate equivalent
classes for each FFI function signature.

I tried a slightly different approach for the template code. .  In the
template struct itself, we now generate some simple Rust structs with
all the data the templates need. I like this because it's easier to
compute these values in Rust than in an Aksama template.

Differential Revision: https://phabricator.services.mozilla.com/D212342
2024-07-23 17:16:45 +00:00
Cristina Horotan
edf60cab49 Backed out changeset a2c22cb98397 (bug 1899351) for causing build bustage at UniFFICall.h and mochitest failures. CLOSED TREE 2024-07-23 18:20:10 +03:00
Ben Dean-Kawamura
a563802d85 Bug 1899351 - remove ScaffoldingCall.h. r=nika,markh
The C++ templates were hard to understand and modify.  Instead of using
the templates, let's monomorphize by hand and generate equivalent
classes for each FFI function signature.

I tried a slightly different approach for the template code. .  In the
template struct itself, we now generate some simple Rust structs with
all the data the templates need. I like this because it's easier to
compute these values in Rust than in an Aksama template.

Differential Revision: https://phabricator.services.mozilla.com/D212342
2024-07-23 14:38:11 +00:00
Ben Dean-Kawamura
45b82977f4 Bug 1907964 - Include field values in Error messages, r=markh
Differential Revision: https://phabricator.services.mozilla.com/D216813
2024-07-17 14:16:25 +00:00
Ben Dean-Kawamura
3c9e7d3c64 Bug 1907973 - Load FTS5 extension for Suggest, r=nanj,urlbar-reviewers,adw
We need to do this now that we're creating FTS tables. I believe this
should fix the vendoring issues.  The following tests were failing
before and now are succeeding on my machine:

./mach test browser/components/urlbar/tests/quicksuggest/unit
./mach test browser/components/search/test/browser/telemetry/browser_search_telemetry_sources.js

Differential Revision: https://phabricator.services.mozilla.com/D216598
2024-07-15 20:48:11 +00:00
Ben Dean-Kawamura
2b43301057 Bug 1907898 - Vendor in application-services, r=nanj
Differential Revision: https://phabricator.services.mozilla.com/D216571
2024-07-15 20:48:11 +00:00
Norisz Fay
166c36e9ae Backed out changeset 96bdce602082 (bug 1907898) for causing mass failures on multiple paths CLOSED TREE 2024-07-15 20:38:30 +03:00
Ben Dean-Kawamura
608f7c26ec Bug 1907898 - Vendor in application-services, r=nanj
Differential Revision: https://phabricator.services.mozilla.com/D216571
2024-07-15 15:05:05 +00:00
Lina Butler
bcca4259f7 Bug 1880183 - Vendor the latest Application Services. r=bdk
This version includes the new
`SuggestStoreBuilder#remoteSettingsBucketName()` API.

This commit also makes the chrome JS-exposed `SuggestStoreBuilder`
methods synchronous.

Differential Revision: https://phabricator.services.mozilla.com/D201774
2024-06-20 23:01:41 +00:00
Mark Hammond
634cfd6c88 Bug 1899410 (part 2) - generate uniffi js bindings. r=skhamis
Depends on D211929

Differential Revision: https://phabricator.services.mozilla.com/D211930
2024-05-28 22:59:03 +00:00
Nan Jiang
e4be17224d Bug 1895888 - Vendor fully-implemented Rust relevancy component r=bdk
Differential Revision: https://phabricator.services.mozilla.com/D209964
2024-05-09 19:56:58 +00:00
Nan Jiang
794a3b872b Bug 1893189 - Vendor the latest (2024-04-24) A-S into mozilla-central r=bdk
Differential Revision: https://phabricator.services.mozilla.com/D208509
2024-04-29 18:24:40 +00:00
Ben Dean-Kawamura
f31ea0b4c0 Bug 1893194 - Rename UniFFIScaffoldingType, r=markh
See https://bugzilla.mozilla.org/show_bug.cgi?id=1893194 for an
explanation of the naming change.

Differential Revision: https://phabricator.services.mozilla.com/D208518
2024-04-25 16:11:28 +00:00
florin.bilt
a293dcd46c Bug 1890589 - Fix toml linter to remove 'lineno' lines and adjust the manifest test r=perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D207290
2024-04-17 14:26:25 +00:00
Ben Dean-Kawamura
3b11fe2957 Bug 1890866 - Reorganize the UniFFI fixtures/examples. r=markh
Differential Revision: https://phabricator.services.mozilla.com/D207208
2024-04-15 18:07:00 +00:00
Ben Dean-Kawamura
10e1ae132d Bug 1888683 - Checking in automated code changes. r=janerik,supply-chain-reviewers,glandium
This is the result of running `mach vendor rust`, `mach cargo vet prune` and `mach uniffi generate`

Depends on D206130

Differential Revision: https://phabricator.services.mozilla.com/D206131
2024-04-10 17:23:01 +00:00
Ben Dean-Kawamura
a7fd73cc91 Bug 1888683 - Upgrade UniFFI to 0.27.1. r=markh,janerik,glandium,supply-chain-reviewers,mach-reviewers,android-reviewers,kaya
Update:
  - UniFFI to 0.27.1
  - Glean to 59.0.0
  - App-services to a recent version

This removes the need for the goblin build hack, although we still have
duplicate versions of goblin since UniFFI is ahead of the moz-central
version.  I think that should be easy to resolve as a follow-up.

Updating uniffi-bindget-gecko-js based on upstream changes:
  - Clone objects before lowering them
    (https://github.com/mozilla/uniffi-rs/pull/1880)
  - Use u64 for the RustBuffer length and capacity field
    (https://github.com/mozilla/uniffi-rs/pull/1978)

I didn't implement the new callback interface VTable code.  Instead I
simply disabled the one fixture that tests it.  I'd rather implement
https://bugzilla.mozilla.org/show_bug.cgi?id=1888668 first, since that
will simplify the process a bunch. The only real-world use-case for
callbacks that I know of is Mark's logging changes, but that will
require implementing trait interfaces anyways so I'd rather wait than
write a bunch of C++ code that we then throw away.

Differential Revision: https://phabricator.services.mozilla.com/D206130
2024-04-10 17:23:00 +00:00
Cristian Tuns
69b2210be2 Backed out 2 changesets (bug 1888683) for causing hazard bustages in UniFFIPointer.cpp CLOSED TREE
Backed out changeset 42fe954d2d47 (bug 1888683)
Backed out changeset 2403582c3c8d (bug 1888683)
2024-04-09 21:54:42 -04:00