Skip to content

Commit

Permalink
Bug 1818349 Part 1: Vendor new version of application-services r=markh
Browse files Browse the repository at this point in the history
  • Loading branch information
skhamis committed Mar 7, 2023
1 parent a34741e commit bbbee19
Show file tree
Hide file tree
Showing 23 changed files with 466 additions and 301 deletions.
10 changes: 5 additions & 5 deletions .cargo/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ git = "https://github.com/FirefoxGraphics/wpf-gpu-raster"
rev = "a6514854d4518b02f2805719ff6cd74dae7dfde6"
replace-with = "vendored-sources"

[source."https://github.com/bendk/application-services"]
git = "https://github.com/bendk/application-services"
rev = "ecb35df5fc40357c49922f90e86bf4147fa52953"
replace-with = "vendored-sources"

[source."https://github.com/chris-zen/coremidi.git"]
git = "https://github.com/chris-zen/coremidi.git"
rev = "fc68464b5445caf111e41f643a2e69ccce0b4f83"
Expand Down Expand Up @@ -80,6 +75,11 @@ git = "https://github.com/mozilla-spidermonkey/jsparagus"
rev = "688a6574cf830b4a3adaf9c5d41efc1f7dd4017f"
replace-with = "vendored-sources"

[source."https://github.com/mozilla/application-services"]
git = "https://github.com/mozilla/application-services"
rev = "fe2867dbe82a2aaa85a856648107be94b1534683"
replace-with = "vendored-sources"

[source."https://github.com/mozilla/audioipc"]
git = "https://github.com/mozilla/audioipc"
rev = "fb7a2b12ced3b43e6a268621989c6191d1ed7e39"
Expand Down
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ warp = { git = "https://github.com/glandium/warp", rev = "4af45fae95bc98b0eba1ef
cssparser = { git = "https://github.com/servo/rust-cssparser", rev = "b196a164dcbb317016d4aa6c58c13147e6045ebb" }

# application-services overrides to make updating them all simpler.
interrupt-support = { git = "https://github.com/bendk/application-services", rev = "ecb35df5fc40357c49922f90e86bf4147fa52953" }
sql-support = { git = "https://github.com/bendk/application-services", rev = "ecb35df5fc40357c49922f90e86bf4147fa52953" }
sync15 = { git = "https://github.com/bendk/application-services", rev = "ecb35df5fc40357c49922f90e86bf4147fa52953" }
tabs = { git = "https://github.com/bendk/application-services", rev = "ecb35df5fc40357c49922f90e86bf4147fa52953" }
viaduct = { git = "https://github.com/bendk/application-services", rev = "ecb35df5fc40357c49922f90e86bf4147fa52953" }
webext-storage = { git = "https://github.com/bendk/application-services", rev = "ecb35df5fc40357c49922f90e86bf4147fa52953" }
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "fe2867dbe82a2aaa85a856648107be94b1534683" }
sql-support = { git = "https://github.com/mozilla/application-services", rev = "fe2867dbe82a2aaa85a856648107be94b1534683" }
sync15 = { git = "https://github.com/mozilla/application-services", rev = "fe2867dbe82a2aaa85a856648107be94b1534683" }
tabs = { git = "https://github.com/mozilla/application-services", rev = "fe2867dbe82a2aaa85a856648107be94b1534683" }
viaduct = { git = "https://github.com/mozilla/application-services", rev = "fe2867dbe82a2aaa85a856648107be94b1534683" }
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "fe2867dbe82a2aaa85a856648107be94b1534683" }

# Patch mio 0.6 to use winapi 0.3 and miow 0.3, getting rid of winapi 0.2.
# There is not going to be new version of mio 0.6, mio now being >= 0.7.11.
Expand Down
2 changes: 1 addition & 1 deletion third_party/rust/error-support-macros/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{"Cargo.toml":"2a41a998c288fd049dd4dd62bc20e3ad13ded43642c27880dd5af0260bb72865","src/argument.rs":"1e4ec4140c536d2feea30eb1e4eef3a6e24533192108e91610ee5c2e75eb5e75","src/lib.rs":"fbd9c048ac86c16ef388fbb9a3c40f60d3aecab41a902740c81b3df6ee6631fe"},"package":null}
{"files":{"Cargo.toml":"2a41a998c288fd049dd4dd62bc20e3ad13ded43642c27880dd5af0260bb72865","src/argument.rs":"bb97e801ce2c80b878328b15783678b913c2f34cf6f26a60d894c8da6b4e47aa","src/lib.rs":"8dd5b6225791730881a3500c3013c48678879430d859d0b92ac9dad4c42b04e0"},"package":null}
26 changes: 15 additions & 11 deletions third_party/rust/error-support-macros/src/argument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

pub(crate) fn validate(arguments: &syn::AttributeArgs) -> syn::Result<()> {
// For now we validate that there are no arguments.
// if we want to improve the macro to support attributes, for example,
// if we'd like to pass in the return type of the body we can modify this
// logic to parse and return the type.
if !arguments.is_empty() {
return Err(syn::Error::new(
proc_macro2::Span::call_site(),
"Expected #[handle_error] with no arguments",
));
use syn::spanned::Spanned;

const ERR_MSG: &str = "Expected #[handle_error(path::to::Error)]";

/// Returns the path to the type of the "internal" error.
pub(crate) fn validate(arguments: &syn::AttributeArgs) -> syn::Result<&syn::Path> {
if arguments.len() != 1 {
return Err(syn::Error::new(proc_macro2::Span::call_site(), ERR_MSG));
}

let nested_meta = arguments.iter().next().unwrap();
if let syn::NestedMeta::Meta(syn::Meta::Path(path)) = nested_meta {
Ok(path)
} else {
Err(syn::Error::new(nested_meta.span(), ERR_MSG))
}
Ok(())
}
17 changes: 7 additions & 10 deletions third_party/rust/error-support-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ mod argument;
/// }
/// }
///
/// #[handle_error]
/// // The `handle_error` macro maps from the error supplied in the mandatory argument
/// // (ie, `Error` in this example) to the error returned by the function (`ExternalError`
/// // in this example)
/// #[handle_error(Error)]
/// fn do_something() -> std::result::Result<String, ExternalError> {
/// // The `handle_error` macro maps from `Error` to `ExternalError`
/// Err(Error{})
/// }
///
Expand All @@ -72,18 +74,13 @@ fn impl_handle_error(
arguments: &syn::AttributeArgs,
) -> syn::Result<proc_macro2::TokenStream> {
if let syn::Item::Fn(item_fn) = input {
argument::validate(arguments)?;
let err_path = argument::validate(arguments)?;
let original_body = &item_fn.block;

let mut new_fn = item_fn.clone();
new_fn.block = parse_quote! {
{
// Note: the `Result` here is a smell
// because the macro is **assuming** a `Result` exists
// that reflects the return value of the block
// An improvement would include the error of the `original_block`
// as an attribute to the macro itself.
(|| -> Result<_> {
(|| -> ::std::result::Result<_, #err_path> {
#original_body
})().map_err(::error_support::convert_log_report_error)
}
Expand All @@ -95,7 +92,7 @@ fn impl_handle_error(
} else {
Err(syn::Error::new(
input.span(),
"#[handle_error] can only be used on functions",
"#[handle_error(..)] can only be used on functions",
))
}
}
2 changes: 1 addition & 1 deletion third_party/rust/sync15/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{"Cargo.toml":"1f11acaa90a112979205b4c7af9ba0c015afab5f3141dd082d58c862c84490e3","README.md":"6d4ff5b079ac5340d18fa127f583e7ad793c5a2328b8ecd12c3fc723939804f2","src/bso/content.rs":"d2d650f4932e9a7068a25dd7df0085b92cd8976a0635320e6ae306d5a425075c","src/bso/crypto.rs":"27602dcccb37d3a55620ee4e16b705da455d49af575de115c7c79c0178eb1d6d","src/bso/mod.rs":"09e723dc7e99295ecafdcadffaf604d66ea27cf2b7f1fd9ab3cac4f4698ff6a7","src/bso/test_utils.rs":"4ec5a2df5e1c0ec14dc770681e959bdcef6ef04f6fde435999197f46a8ae4831","src/client/coll_state.rs":"b0c47e44168ea2c7017cd8531f76bb230f9be66b119bb7416537b8693a1d0a0a","src/client/coll_update.rs":"cc12dfde0817eae68aa8e176497ed16e9e3307f72a33faa3fe329d7a3bfd1598","src/client/collection_keys.rs":"c27b2277a3a52033b58ab01490fc2ea7007494195dd5e6dc2c6931a4ca96795a","src/client/mod.rs":"9500b1d22a5064bbbd6a3d6bcc63fc4191e8ea4605ded359bc6c2dc2887626a3","src/client/request.rs":"8841524e37d8195867bdf6ba98c75f610cf47a4644adeebd6372cc6713f2260a","src/client/state.rs":"4e31193ef2471c1dfabf1c6a391bcb95e14ddb45855786a4194ff187d5c9347c","src/client/status.rs":"f445a8765dac9789444e23b5145148413407bb1d18a15ef56682243997f591bf","src/client/storage_client.rs":"3637b4522048353b06ad24031c150c66c13d9c27cef293e400db88807421633c","src/client/sync.rs":"ed7225c314df27793ed5de6da93cc4b75a98da1c14ac82e37a723a99821d4dc7","src/client/sync_multiple.rs":"3729d4afd90ab1bd9982a3506252c99d8f37619cc1792ef4feba352ad01a7192","src/client/token.rs":"b268759d31e0fe17e0e2a428694cd9a317fcfbdd52f023d5d8c7cc6f00f1a102","src/client/util.rs":"71cc70ee41f821f53078675e636e9fad9c6046fa1a989e37f5487e340a2277d6","src/client_types.rs":"3c3cac1540b92482f43660d9e43bdde8481c4cc1a98253a68c80e791231f5976","src/clients_engine/engine.rs":"b4a9c92f251b23e5a5452930e4472e7fea9ed12784a78836ce7337a94457ab86","src/clients_engine/mod.rs":"461729e6f89b66b2cbd89b041a03d4d6a8ba582284ed4f3015cb13e1a0c6da97","src/clients_engine/record.rs":"69357413571d688eea3a5207f9b88088cde285b9373c7bd4ea1e018dbc823dd2","src/clients_engine/ser.rs":"9796e44ed7daf04f22afbb51238ac25fd0de1438b72181351b4ca29fd70fd429","src/device_type.rs":"fe217453f19b374abcc10e9f503b25f4f712b555497bebe5aefcf2e9b258d28e","src/enc_payload.rs":"aa3eea7df49b24cd59831680a47c417b73a3e36e6b0f3f4baf14ca66bd68be6b","src/engine/bridged_engine.rs":"9c0d602b3553932e77a87caba9262d3a0fc146500c6d46f1770273be6636d064","src/engine/changeset.rs":"5e323aa07f0b18d22495a695b829326d18287ff75155b4818adf66b86e16ba00","src/engine/mod.rs":"f84a254642c1876fe56506703fb010a7866eb5d40af3fc238bf92b62a61cb6cc","src/engine/request.rs":"f40bac0b3f5286446a4056de885fd81e4fa77e4dc7d5bbb6aa644b93201046de","src/engine/sync_engine.rs":"5314d0163ccc93d78f5879d52cf2b60b9622e80722d84d3482cfa7c26df6bfdd","src/error.rs":"a45cfe02e6301f473c34678b694943c1a04308b8c292c6e0448bf495194c3b5e","src/key_bundle.rs":"ff8b10b95add934ecbc434b37ed089805886828ed159fd38bd692d1f01d06f7f","src/lib.rs":"25bec0ac0f8ed0e6a341f645f7f265c7e9a19332c13d05876f7332eccbd2a2de","src/record_types.rs":"02bb3d352fb808131d298f9b90d9c95b7e9e0138b97c5401f3b9fdacc5562f44","src/server_timestamp.rs":"0020f31971ccbfc485894cabc3087459d42252b86d7de07f2136997864b0373b","src/telemetry.rs":"35e0313a052f16326e451e3d6e371337c1d71a471f32234ad9649fc1fa9f2237"},"package":null}
{"files":{"Cargo.toml":"1f11acaa90a112979205b4c7af9ba0c015afab5f3141dd082d58c862c84490e3","README.md":"6d4ff5b079ac5340d18fa127f583e7ad793c5a2328b8ecd12c3fc723939804f2","src/bso/content.rs":"d2d650f4932e9a7068a25dd7df0085b92cd8976a0635320e6ae306d5a425075c","src/bso/crypto.rs":"27602dcccb37d3a55620ee4e16b705da455d49af575de115c7c79c0178eb1d6d","src/bso/mod.rs":"09e723dc7e99295ecafdcadffaf604d66ea27cf2b7f1fd9ab3cac4f4698ff6a7","src/bso/test_utils.rs":"4ec5a2df5e1c0ec14dc770681e959bdcef6ef04f6fde435999197f46a8ae4831","src/client/coll_state.rs":"4301526b987532cd7ebd5d089980c9524aa29360e08fa0c1f5437696ed354822","src/client/coll_update.rs":"627e2266c5c8f1c5e0bc83061fa14c1287c7d17c78b47882543521f75543b499","src/client/collection_keys.rs":"c27b2277a3a52033b58ab01490fc2ea7007494195dd5e6dc2c6931a4ca96795a","src/client/mod.rs":"8f588d4a035cf79d96f2500f06d5651c1a7c566127c456ffa5429811ddce3fd6","src/client/request.rs":"8841524e37d8195867bdf6ba98c75f610cf47a4644adeebd6372cc6713f2260a","src/client/state.rs":"4e31193ef2471c1dfabf1c6a391bcb95e14ddb45855786a4194ff187d5c9347c","src/client/status.rs":"f445a8765dac9789444e23b5145148413407bb1d18a15ef56682243997f591bf","src/client/storage_client.rs":"8de72d4ba3ca4f68c8e1898466de83a2b543545a18679800cb4f7fbda2dc3183","src/client/sync.rs":"a04478c4e31bbf39f593decfc4844bfb7e678907031f0a93d1e005cf0047ebb4","src/client/sync_multiple.rs":"3729d4afd90ab1bd9982a3506252c99d8f37619cc1792ef4feba352ad01a7192","src/client/token.rs":"b268759d31e0fe17e0e2a428694cd9a317fcfbdd52f023d5d8c7cc6f00f1a102","src/client/util.rs":"71cc70ee41f821f53078675e636e9fad9c6046fa1a989e37f5487e340a2277d6","src/client_types.rs":"3c3cac1540b92482f43660d9e43bdde8481c4cc1a98253a68c80e791231f5976","src/clients_engine/engine.rs":"0eaa078978c95fc96284b48a7458ebff49f0aa70b1148ef019b9350b5ba4d0d4","src/clients_engine/mod.rs":"461729e6f89b66b2cbd89b041a03d4d6a8ba582284ed4f3015cb13e1a0c6da97","src/clients_engine/record.rs":"69357413571d688eea3a5207f9b88088cde285b9373c7bd4ea1e018dbc823dd2","src/clients_engine/ser.rs":"9796e44ed7daf04f22afbb51238ac25fd0de1438b72181351b4ca29fd70fd429","src/device_type.rs":"fe217453f19b374abcc10e9f503b25f4f712b555497bebe5aefcf2e9b258d28e","src/enc_payload.rs":"aa3eea7df49b24cd59831680a47c417b73a3e36e6b0f3f4baf14ca66bd68be6b","src/engine/bridged_engine.rs":"9c0d602b3553932e77a87caba9262d3a0fc146500c6d46f1770273be6636d064","src/engine/changeset.rs":"949c520e508da0158b2df9fa20235f942ad8096cebbfc942b0fae41c35830c6b","src/engine/mod.rs":"cb638c2170c3785785877dfd059f26fbbfeae5edc599745dd861e4c299d310ad","src/engine/request.rs":"5923025fb9550178339f880a1bf8526d8e853e7a0b2bce6d9d687cc808ac0085","src/engine/sync_engine.rs":"9a5c6993dcceec8f82ead97a6d1840c7ed7dc6b326f7234c77f18848b6baf836","src/error.rs":"a45cfe02e6301f473c34678b694943c1a04308b8c292c6e0448bf495194c3b5e","src/key_bundle.rs":"ff8b10b95add934ecbc434b37ed089805886828ed159fd38bd692d1f01d06f7f","src/lib.rs":"eca1fa801820238141c4badeeec45d430aaec8b2ce088446ef94456d51014889","src/record_types.rs":"02bb3d352fb808131d298f9b90d9c95b7e9e0138b97c5401f3b9fdacc5562f44","src/server_timestamp.rs":"0020f31971ccbfc485894cabc3087459d42252b86d7de07f2136997864b0373b","src/telemetry.rs":"35e0313a052f16326e451e3d6e371337c1d71a471f32234ad9649fc1fa9f2237"},"package":null}
Loading

0 comments on commit bbbee19

Please sign in to comment.