Граф коммитов

56 Коммитов

Автор SHA1 Сообщение Дата
Noemi Erli a08fb1a2d8 Backed out 2 changesets (bug 1867639) for causing wrench bustages CLOSED TREE
Backed out changeset 014768de11ca (bug 1867639)
Backed out changeset 375a5bb63fa7 (bug 1867639)
2023-12-01 23:21:07 +02:00
Ben Dean-Kawamura a7cc46083d Bug 1867639 - Running mach uniffi generate. r=markh,janerik
Differential Revision: https://phabricator.services.mozilla.com/D195155
2023-12-01 14:26:04 +00:00
Ben Dean-Kawamura c34d9f3c2d Bug 1867639 - Vendor in new application-services / Glean / UniFFI. r=markh,janerik,supply-chain-reviewers,mach-reviewers,ahal
Updated uniffi-bindgen-gecko-js to work with UniFFI 0.25.2:
- Use `config.toml` to list UniFFI sources.  This makes it easier to
  associate data with them, for example the `crate_name` field that's
  now required to generate the sources.
- Enable the `extern-rustbuffer` feature on `uniffi_core`
- Updated the external types fixture to work around
  https://github.com/mozilla/uniffi-rs/issues/1872

Ran mach vendor and mach cargo vet to update the Rust crates.

Differential Revision: https://phabricator.services.mozilla.com/D195163
2023-12-01 14:26:03 +00:00
Joel Maher 29e80ac522 Bug 1859901 - Batch 18 - migrate rest of xpcshell.ini -> toml. r=aryx,extension-reviewers,application-update-reviewers,credential-management-reviewers,places-reviewers,profiler-reviewers,win-reviewers,robwu,julienw,nalexander,Standard8,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D194891
2023-11-30 16:14:52 +00:00
Tif Tran 7dc77a4f8e Bug 1861220 - Vendor application services into moz central r=lina,adw
Differential Revision: https://phabricator.services.mozilla.com/D192011
2023-10-26 23:27:39 +00:00
Drew Willcoxon 2c04bebc2e Bug 1859069 - Part 2: Generate JS bindings for the suggest component. r=lina
Depends on D191002

Differential Revision: https://phabricator.services.mozilla.com/D191003
2023-10-14 00:37:12 +00:00
Lina Butler 1466383668 Bug 1851845 - Update vendored Application Services dependencies. r=markh,adw
This commit vendors the latest changes to the Suggest and Remote
Settings Rust components.

1. From the `application-services` source tree, I ran
   `./tools/update-moz-central-vendoring.py ../m-c` to update the
   revisions in the m-c source tree.
2. I added the Remote Settings component UDL file to
   `toolkit/components/uniffi-bindgen-gecko-js/mach_commands.py`, and
   updated `toolkit/components/uniffi-bindgen-gecko-js/config.toml` to
   call the `RemoteSettings` constructor on the main thread. The
   Suggest component uses the `RemoteSettingsConfig` type in its
   public API, so we must generate bindings for the Remote Settings
   component.
3. From the m-c source tree, I ran `./mach uniffi generate` to update
   the generated UniFFI bindings.

Differential Revision: https://phabricator.services.mozilla.com/D187559
2023-09-07 05:40:28 +00:00
Drew Willcoxon 05f4096299 Bug 1851256 - Part 2: Generate JS bindings for the suggest Rust component. r=lina
This is part 2 of 3 and generates JS bindings for the `suggest` component. Part 1
is D187323.

This is my first time doing this so I'll explain how I generated this patch in
case I did something wrong:

1. Added `suggest` to `toolkit/components/uniffi-bindgen-gecko-js/mach_commands.py`
2. Added `[suggest.receiver_thread]` to `toolkit/components/uniffi-bindgen-gecko-js/config.toml` so the `SuggestStore` ctor and `interrupt()` method are main-thread
3. Ran `./mach uniffi generate`
4. Added the generated `RustSuggest.sys.mjs` to `mc/toolkit/components/uniffi-bindgen-gecko-js/components/moz.build`

Depends on D187323

Differential Revision: https://phabricator.services.mozilla.com/D187324
2023-09-05 21:11:58 +00:00
Ben Dean-Kawamura b981925956 Bug 1848041 - Fix variable name mismatch in UniFFIFixtureScaffolding.cpp. r=markh
Differential Revision: https://phabricator.services.mozilla.com/D185857
2023-08-15 16:41:16 +00:00
Mark Hammond 0b8d728def Bug 1846347 - update application-services to fix tab syncing. r=skhamis
Differential Revision: https://phabricator.services.mozilla.com/D184986
2023-08-01 15:45:56 +00:00
Jan-Erik Rediger 1c2fbc9d73 Bug 1840044 - Update to Glean 53.1.0, UniFFI 0.24.1 and latest application-services. r=TravisLong,nika,markh,supply-chain-reviewers
Update:
  - Glean to v53.1.0
  - UniFFI to v0.24.1
  - application-services to a recent nightly that uses the above
    versions

- Updated `rusqlite` in toolkit/library/rust/shared/Cargo.toml
- Updated `uniffi-bindgen-gecko-js` to work with the new UniFFI.  Also
  updated it's askama version.
- Vetted new cargo dependencies

Ran `mach uniffi generate` to regenerate the code.

Differential Revision: https://phabricator.services.mozilla.com/D181872
2023-07-26 15:34:27 +00:00
Sandor Molnar fb1981e4cf Backed out changeset 93b5aead9fb9 (bug 1840044) for causing multiple failures, incl. build bustages CLOSED TREE 2023-07-20 22:00:20 +03:00
Jan-Erik Rediger f74614d6b0 Bug 1840044 - Update to Glean 53.1.0, UniFFI 0.24.1 and latest application-services. r=TravisLong,nika,markh,supply-chain-reviewers
Update:
  - Glean to v53.1.0
  - UniFFI to v0.24.1
  - application-services to a recent nightly that uses the above
    versions

- Updated `rusqlite` in toolkit/library/rust/shared/Cargo.toml
- Updated `uniffi-bindgen-gecko-js` to work with the new UniFFI.  Also
  updated it's askama version.
- Vetted new cargo dependencies

Ran `mach uniffi generate` to regenerate the code.

Differential Revision: https://phabricator.services.mozilla.com/D181872
2023-07-20 17:22:56 +00:00
Mike Hommey 95467ef153 Bug 1836415 - Upgrade uniffi-bindgen-gecko-js to clap 4. r=bdk
Differential Revision: https://phabricator.services.mozilla.com/D179752
2023-06-07 22:44:15 +00:00
Iulian Moraru 9ed9b5d1c8 Backed out 3 changesets (bug 1836415) for causing wd failures on allow_hosts.py.
Backed out changeset dbbb407831c0 (bug 1836415)
Backed out changeset a1fbb5a4179b (bug 1836415)
Backed out changeset e2d49a57b1c9 (bug 1836415)
2023-06-08 01:27:49 +03:00
Mike Hommey 1dbec4a158 Bug 1836415 - Upgrade uniffi-bindgen-gecko-js to clap 4. r=bdk
Differential Revision: https://phabricator.services.mozilla.com/D179752
2023-06-07 20:23:25 +00:00
Mike Hommey 25a2da729c Bug 1836402 - Disable clap default features in uniffi-bindgen-gecko-js. r=bdk,supply-chain-reviewers
The tool is not directly user visible, and it's not super useful for
features like color to be enabled.

Differential Revision: https://phabricator.services.mozilla.com/D179742
2023-06-02 21:40:30 +00:00
Mark Banner 130a655906 Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
2023-05-20 12:26:53 +00:00
Mark Banner 8219a5c503 Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00
Mathew Hodson 9840cc5f84 Bug 1782784 - Convert UniFFI JS bindings to ESM. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D176210
2023-05-08 13:36:45 +00:00
Sandor Molnar f781ded94d Backed out changeset 298628389ab9 (bug 1782784) for causing bc failures in browser/base/content/test/static/browser_all_files_referenced.js CLOSED TREE 2023-05-05 15:07:25 +03:00
Mathew Hodson e5411d438b Bug 1782784 - Convert UniFFI JS bindings to ESM. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D176210
2023-05-05 11:03:49 +00:00
Jan-Erik Rediger 5cd8c5650a Bug 1812615 - Update to Glean v52.2.0, glean_parser 7.0.0 and UniFFI 0.23. r=chutten,markh,glandium,supply-chain-reviewers
The in-tree UniFFI bindings were regenerated with:

    ./mach uniffi generate

Differential Revision: https://phabricator.services.mozilla.com/D168060
2023-01-31 11:12:05 +00:00
Ben Dean-Kawamura bcea304dfa Bug 1786673 - Additional UniFFI type checking r=markh,skhamis
- Implemented `checkType` on more UniFFI FFIConverters.
- Updated the way we handle locating the errors.
   - The old system was that `checkType` inputted a `name` parameter.  I
     think the idea was that parent types would calculate a name
     parameter for their children.  However, this wasn't great because
     it meant we would need to build the strings up-front and throw
     them away in the vast majority of cases where there was no type
     error.
   - The new system is that we use the `UniFFITypeError` class, which
     has a `prependPath` method.  This gets called by the parent type
     FFIConverter to basically do the same work, but it only needs to
     happen when there's actually an error.
   - I think the resulting error messages are pretty good.  I got this
     when passing a list with garbage data to setLocalTabs: "TypeError:
     remoteTabs[0].title: undefined is not a string"
- Added the `UniFFI.sys.mjs` module, which contains shared, non-generated,
  UniFFI JS code.  This is prep-work for
  https://bugzilla.mozilla.org/show_bug.cgi?id=1804078.

Differential Revision: https://phabricator.services.mozilla.com/D166479
2023-01-17 16:07:40 +00:00
Ben Dean-Kawamura 79c4dcd5b0 Bug 1788306: UniFFI callback interfaces, r=nika
Started callback interface functionality to UniFFI.  Currently this only
supports the async fire-and-forget use case, where Rust queues a JS
function to run, but doesn't wait (or `await`) for the response.

The basic system is:

  - The JS code registers a callback interface handler with the C++
    code.  This handler is responsible for the specifics of invoking the
    callback.
  - The C++ code defines a function to call a JS handler.  Once the JS
    handler registers itself with C++, the C++ registers it's function
    with Rust.
  - The C++ code queues the call to the JS main thread.
  - Because of how UniFFI handles callback interfaces, the C++ code can
    be "dumb".  UniFFI sends a object id, method id, and RustBuffer
    encoding all arguments.  This means C++ doesn't need to care about
    the specific arguments, they get unpacked by JS.

I tried to keep the generated code as simple as possible by moving the
complexity to static code.  For JS this meant writing a generic
`UniFFICallbackHandler` class in the static code that the generated code
constructs.  For C++ this meant the generated code defines a
`UniFFIGetCallbackInterfaceInfo` function that returns a struct with all
the data specific to a callback interface (it's name, the UniFFI
scaffolding init function, etc).  The static code can then define a
generic `QueueCallback` function that looks up the callback interface
info using the interface ID and then makes the call.

Allow UniFFI functions to run on the main thread rather than always
being dispatched to a worker thread.  This allows us to test invoking
callback interfaces from the main thread thread. I don't think we will
use this much currently, since we don't want to block the main thread
for any significant amount of time. However, this will pair well with
the next step in the project which is async -- allowing async Rust
functions to call async JS functions. In that scenario, dispatching to
the worker thread is unnecessary.

Callback interface objects present a potential memory leak, since you
can easily create a cycle between a JS Callback object and a UniFFIed
Rust object, and the GC has no way of detecting it.  To try to detect
these there's some shutdown code that checks that there are no callbacks
registered during shutdown and prevents any future callbacks from being
registered.

Added a `config.toml` file and code to parse it.  This is needed to
specify which functions should run on the main thread.

Updated the git commits for the several UniFFI examples/fixtures.

Differential Revision: https://phabricator.services.mozilla.com/D156116
2023-01-03 20:57:53 +00:00
Ryan VanderMeulen 88a2250e32 Backed out 2 changesets (bug 1805809, bug 1804360) for breaking Fenix UI tests (bug 1806321).
Backed out changeset e753835928e7 (bug 1804360)
Backed out changeset 2d62469a1741 (bug 1805809)
2022-12-18 13:42:34 -05:00
Mike Hommey 8fd72b5fca Bug 1805809 - Update uniffi to 0.21.1 for more determinism across platforms. r=janerik,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D164896
2022-12-16 22:25:57 +00:00
Csoregi Natalia ffeed88c2a Backed out changeset e6becf16d643 (bug 1788306) for causing bustage on UniFFICallbacks.cpp. CLOSED TREE 2022-12-15 01:16:12 +02:00
Ben Dean-Kawamura 22d5d42244 Bug 1788306: UniFFI callback interfaces, r=nika
Started callback interface functionality to UniFFI.  Currently this only
supports the async fire-and-forget use case, where Rust queues a JS
function to run, but doesn't wait (or `await`) for the response.

The basic system is:

  - The JS code registers a callback interface handler with the C++
    code.  This handler is responsible for the specifics of invoking the
    callback.
  - The C++ code defines a function to call a JS handler.  Once the JS
    handler registers itself with C++, the C++ registers it's function
    with Rust.
  - The C++ code queues the call to the JS main thread.
  - Because of how UniFFI handles callback interfaces, the C++ code can
    be "dumb".  UniFFI sends a object id, method id, and RustBuffer
    encoding all arguments.  This means C++ doesn't need to care about
    the specific arguments, they get unpacked by JS.

I tried to keep the generated code as simple as possible by moving the
complexity to static code.  For JS this meant writing a generic
`UniFFICallbackHandler` class in the static code that the generated code
constructs.  For C++ this meant the generated code defines a
`UniFFIGetCallbackInterfaceInfo` function that returns a struct with all
the data specific to a callback interface (it's name, the UniFFI
scaffolding init function, etc).  The static code can then define a
generic `QueueCallback` function that looks up the callback interface
info using the interface ID and then makes the call.

Allow UniFFI functions to run on the main thread rather than always
being dispatched to a worker thread.  This allows us to test invoking
callback interfaces from the main thread thread. I don't think we will
use this much currently, since we don't want to block the main thread
for any significant amount of time. However, this will pair well with
the next step in the project which is async -- allowing async Rust
functions to call async JS functions. In that scenario, dispatching to
the worker thread is unnecessary.

Callback interface objects present a potential memory leak, since you
can easily create a cycle between a JS Callback object and a UniFFIed
Rust object, and the GC has no way of detecting it.  To try to detect
these there's some shutdown code that checks that there are no callbacks
registered during shutdown and prevents any future callbacks from being
registered.

Added a `config.toml` file and code to parse it.  This is needed to
specify which functions should run on the main thread.

Updated the git commits for the several UniFFI examples/fixtures.

Differential Revision: https://phabricator.services.mozilla.com/D156116
2022-12-14 21:50:23 +00:00
Sylvestre Ledru 04363d3827 Bug 1802689 - Add missing licenses info in Cargo.toml r=mhoye,necko-reviewers,kershaw,valentin
Differential Revision: https://phabricator.services.mozilla.com/D163157
2022-12-13 09:14:44 +00:00
Mark Hammond 2f47e5f65a Bug 1803726 (part 2) - regenerate uniffi JS. r=bdk
Differential Revision: https://phabricator.services.mozilla.com/D163673
2022-12-04 10:30:30 +00:00
Ben Dean-Kawamura 1ee90cf9ed Bug 1795289 - Implementing UniFFI external types, r=markh
Added support for external types and a test for it.

Differential Revision: https://phabricator.services.mozilla.com/D159384
2022-11-10 17:00:50 +00:00
Mark Hammond cf1e2c2545 Bug 1791851 - regenerate uniffi r=teshaq,LougeniaBailey,bdk
Differential Revision: https://phabricator.services.mozilla.com/D157980
2022-10-25 20:03:22 +00:00
Sammy Khamis 0d48542497 Bug 1791851 - Add tabs as a uniffi component r=teshaq,LougeniaBailey,bdk
Differential Revision: https://phabricator.services.mozilla.com/D157979
2022-10-25 20:03:22 +00:00
Jan-Erik Rediger 2003f2a8b0 Bug 1796087 - Update to Glean v51.5.0 and UniFFI 0.21.0. r=chutten,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D159689
2022-10-20 12:42:47 +00:00
pmcmanis b3d8c6d5d8 Bug 1793786 - Update Glean version to 51.4.0 r=chutten,supply-chain-reviewers,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158759
2022-10-07 20:19:49 +00:00
Butkovits Atila 1bed1fd6e7 Backed out changeset a5df97f61fec (bug 1793786) for causing build bustages. CLOSED TREE 2022-10-07 16:35:21 +03:00
pmcmanis 5d43825505 Bug 1793786 - Update Glean version to 51.4.0 r=chutten,supply-chain-reviewers,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158759
2022-10-07 13:05:21 +00:00
Mark Hammond 5ecc219891 Bug 1790931 - vendor a new application-services so golden_gate doesn't get stale. r=bdk
Differential Revision: https://phabricator.services.mozilla.com/D157402
2022-09-19 23:37:51 +00:00
Mark Hammond c6d2e38561 Bug 1788553 - all uniffi generated .jsm files now have a 'Rust' prefix. r=bdk
Differential Revision: https://phabricator.services.mozilla.com/D156628
2022-09-07 21:43:18 +00:00
Sammy Khamis c86ed069c6 Bug 1788412 - Add support generating UniFFi for custom types r=bdk,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D156112
2022-09-02 02:56:12 +00:00
Andi-Bogdan Postelnicu 5981839b9a Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio
Updated with rustfmt 1.5.1-stable (4b91a6e 2022-08-08)
# ignore-this-changeset

Depends on D154661

Differential Revision: https://phabricator.services.mozilla.com/D154662
2022-08-16 07:08:28 +00:00
Ben Dean-Kawamura d7f0b286fe Bug 1766045 - Fixes to make the hybrid builds work r=markh,teshaq
This is a repsonse to the build errors I noticed with
build-macosx64-hybrid/plain, build-win64-hybrid/plain, and
build-linux64-hybrid/plain.

I'm not exactly sure why those build had errors but others didn't, but
my guess is that it was a combination of:
  - A clang++ producing different warnings/errors.
  - The uniffied builds being arranged slightly differently, which
    surfaced errors based on missing include statements.

Differential Revision: https://phabricator.services.mozilla.com/D153414
2022-08-03 18:59:38 +00:00
Ben Dean-Kawamura 22448c3f68 Bug 1766045 - Adding xpcshell tests for our UniFFI fixtures r=teshaq,markh
To test the bindings generation, we generate JS bindings for a set of test
Rust crates, then run xpcshell tests against those bindings.

Currently these tests only run when the `--enable-uniffi-fixtures`
option is set, so they need to be run manually be a dev.  I'd love to
create a system where these can optionally run in CI, but I'm not sure
how to do that.

Differential Revision: https://phabricator.services.mozilla.com/D144469
2022-08-03 18:59:37 +00:00
Ben Dean-Kawamura e965ed0056 Bug 1766045 - Adding mach command to generate UniFFI files r=glandium
Added `mach uniffi generate` which executes `uniffi-bindgen-gecko-js` to
generate UniFFI bindings. It's unfortunate that we need to check these
files in, but I couldn't figure out a way to auto-generate them as part
of the build process.

Adding `#include "nsIContent.h"` to dom/base/nsINodeList.h.  I think
that should have been present before, but things built okay because of
the way things got combined in the uniffied .cpp files. Adding these new
webIDL files bumped `NodeListBinding.cpp` to a new uniffied .cpp file
which caused the build to fail.

Differential Revision: https://phabricator.services.mozilla.com/D144468
2022-08-03 18:59:36 +00:00
Ben Dean-Kawamura fd4cfd1807 Bug 1766045 - Vendoring in Rust code for uniffi-bindgen-gecko-js r=glandium,supply-chain-reviewers
- Added `--enable-uniffi-fixtures` flag.  When set, we will compile in
  the UniFFI test fixtures into our shared Rust crate and eventually
  into `libxul`.
- Vendoring in the Rust crates needed for `uniffi-bindgen-gecko-js`

Differential Revision: https://phabricator.services.mozilla.com/D144467
2022-08-03 18:59:36 +00:00
Ben Dean-Kawamura 1cf71b7095 Bug 1766045 - Initial work for UniFFI JS bindings r=nika
Generate the C++ and JS code to handle UniFFI bindings.  The WebIDL code
is completely static and doesn't need to be generated.

There's support for both synchronus and async functions, but we haven't
decided the how we want this to be configured.  In practice, almost all
functions will need to be async, so for now we're just forcing all
functions to be.

The `uniffi-bindgen-gecko-js` crate builds the binary that generates the
bindings.  This binary needs to be fed a list of UDL files, the path of
the .cpp file to generate, and the directory to generate .jsm files in
(and also all of those arguments again, but for the test fixtures).
This is quiet a horrible UI, but it's going to be wrapped in a mach
command.

The `uniffi-js` directory contains shared C++ code for
`uniffi-bindgen-gecko-js`.  As much as possible we tried to put the
functionality here and have the generated code simply forward function
calls here.

Still Todo:
  - CallbackInterfaces
  - Custom and external types
  - Datetime and TimeInterval

Differential Revision: https://phabricator.services.mozilla.com/D144472
2022-08-03 18:59:35 +00:00
Butkovits Atila a8ad39a288 Backed out 6 changesets (bug 1766045) for causing build bustages. CLOSED TREE
Backed out changeset 113593df6272 (bug 1766045)
Backed out changeset f137315bb6af (bug 1766045)
Backed out changeset d86ad195a9a0 (bug 1766045)
Backed out changeset e8bc2ec40cff (bug 1766045)
Backed out changeset 2d33e41ac507 (bug 1766045)
Backed out changeset 4d5874e16302 (bug 1766045)
2022-08-03 17:40:30 +03:00
Ben Dean-Kawamura 5af71e0b39 Bug 1766045 - Fixes to make the hybrid builds work r=markh
This is a repsonse to the build errors I noticed with
build-macosx64-hybrid/plain, build-win64-hybrid/plain, and
build-linux64-hybrid/plain.

I'm not exactly sure why those build had errors but others didn't, but
my guess is that it was a combination of:
  - A clang++ producing different warnings/errors.
  - The uniffied builds being arranged slightly differently, which
    surfaced errors based on missing include statements.

Differential Revision: https://phabricator.services.mozilla.com/D153414
2022-08-03 13:48:29 +00:00
Ben Dean-Kawamura bc8ce7e47d Bug 1766045 - Adding xpcshell tests for our UniFFI fixtures r=teshaq,markh
To test the bindings generation, we generate JS bindings for a set of test
Rust crates, then run xpcshell tests against those bindings.

Currently these tests only run when the `--enable-uniffi-fixtures`
option is set, so they need to be run manually be a dev.  I'd love to
create a system where these can optionally run in CI, but I'm not sure
how to do that.

Differential Revision: https://phabricator.services.mozilla.com/D144469
2022-08-03 13:48:29 +00:00