From 9bccd0e4fc626002e7f30a54818291bba599bac3 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 12:38:04 +0100 Subject: [PATCH 01/13] Replace `example` with `bin` in header generation docs --- README.md | 4 ++-- guide/src/introduction/quickstart.md | 4 ++-- guide/src/usage/_.md | 4 ++-- guide/src/usage/lib-rs.md | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ee0d3cf2dc..47fcc920fa 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ pub fn generate_headers() -> ::std::io::Result<()> { - See [the dedicated chapter on `src/lib.rs`][lib-rs] for more info. -#### Step 3: `examples/generate-headers.rs` +#### Step 3: `src/bin/generate-headers.rs` ```rust ,ignore fn main() -> ::std::io::Result<()> { @@ -141,7 +141,7 @@ fn main() -> ::std::io::Result<()> { cargo build # --release # Generate the C header -cargo run --features headers --example generate-headers +cargo run --features headers --bin generate-headers ``` - See [the dedicated chapter on header generation][header-generation] for diff --git a/guide/src/introduction/quickstart.md b/guide/src/introduction/quickstart.md index 5d57f34dfa..c5cdfdae94 100644 --- a/guide/src/introduction/quickstart.md +++ b/guide/src/introduction/quickstart.md @@ -95,7 +95,7 @@ pub fn generate_headers() -> ::std::io::Result<()> { - See [the dedicated chapter on `src/lib.rs`][lib-rs] for more info. -#### Step 3: `examples/generate-headers.rs` +#### Step 3: `src/bin/generate-headers.rs` ```rust ,ignore fn main() -> ::std::io::Result<()> { @@ -110,7 +110,7 @@ fn main() -> ::std::io::Result<()> { cargo build # --release # Generate the C header -cargo run --features headers --example generate-headers +cargo run --features headers --bin generate-headers ``` - See [the dedicated chapter on header generation][header-generation] for diff --git a/guide/src/usage/_.md b/guide/src/usage/_.md index f5017a4733..f4a809ad3f 100644 --- a/guide/src/usage/_.md +++ b/guide/src/usage/_.md @@ -38,7 +38,7 @@ pub fn generate_headers() -> ::std::io::Result<()> { } ``` -### `examples/generate-headers` +### `src/bin/generate-headers.rs` ```rust ,norun fn main() -> ::std::io::Result<()> { @@ -49,7 +49,7 @@ fn main() -> ::std::io::Result<()> { - And run: ```bash - cargo run --example generate-headers --features headers + cargo run --bin generate-headers --features headers ``` to generate the headers. diff --git a/guide/src/usage/lib-rs.md b/guide/src/usage/lib-rs.md index 04437e55a5..c96d5008bf 100644 --- a/guide/src/usage/lib-rs.md +++ b/guide/src/usage/lib-rs.md @@ -67,7 +67,7 @@ file(name), or into the given `Write`-able / "write sink": ``` ```rust ,norun - //! examples/generate-headers.rs + //! src/bin/generate-headers.rs fn main() -> ::std::io::Result<()> { ::crate_name::generate_headers() } @@ -76,16 +76,16 @@ file(name), or into the given `Write`-able / "write sink": - And run: ```bash - cargo run --example generate-headers --features headers + cargo run --bin generate-headers --features headers ``` to generate the headers. - - You may also want to add: + - You may also want to add: ```toml # Cargo.toml - [[example]] + [[bin]] name = "generate-headers" required-features = ["headers"] ``` @@ -115,7 +115,7 @@ fn generate_headers() -> ::std::io::Result<()> { and run ```bash -cargo run --example generate-headers --features headers -- /path/to/headers.h +cargo run --bin generate-headers --features headers -- /path/to/headers.h ``` From f44732598d9758cffd245ff724d204a9acb1712c Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 12:37:43 +0100 Subject: [PATCH 02/13] Officially bump MSRV to 1.66.1 --- .github/workflows/gh-pages.yml | 8 ++++---- README.md | 2 +- rust-toolchain | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 8829a84e31..19f26b39e8 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -22,7 +22,7 @@ jobs: - macos-latest # - windows-latest rust: - - 1.60.0 + - 1.66.1 - stable # - nightly steps: @@ -63,7 +63,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.60.0 + toolchain: 1.66.1 override: true - name: Clone repo @@ -94,7 +94,7 @@ jobs: - macos-latest - windows-latest rust: - # - 1.60.0 + # - 1.66.1 - stable - nightly steps: @@ -147,7 +147,7 @@ jobs: with: profile: default override: true - toolchain: 1.60.0 + toolchain: 1.66.1 - name: Install `mdbook` uses: peaceiris/actions-mdbook@v1 diff --git a/README.md b/README.md index 47fcc920fa..711d1a82a3 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ https://github.com/getditto/safer_ffi) ## Prerequisites -Minimum Supported Rust Version: `1.60.0` +Minimum Supported Rust Version: `1.66.1` # Quickstart diff --git a/rust-toolchain b/rust-toolchain index 4d5fde5bd1..0403bed10c 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.60.0 +1.66.1 From fb6e67d633b09bdfd138cd8d9f1a9dc8e0c21d70 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 13:06:12 +0100 Subject: [PATCH 03/13] Version discrepancy nit --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 93e557fd1a..9e3568d744 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ path = "src/_lib.rs" [package] name = "safer-ffi" -version = "0.1.0" # Keep in sync +version = "0.1.0-rc1" # Keep in sync authors = ["Daniel Henry-Mantilla "] edition = "2021" From 47b40181179a16d170a2769a2b14c240cbe20ff5 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 13:06:30 +0100 Subject: [PATCH 04/13] Add releasability-to-crates.io CI check --- .github/workflows/gh-pages.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 19f26b39e8..5910c3156f 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -45,6 +45,26 @@ jobs: command: check args: --features proc_macros,log,out-refs + releasable-to-crates-io: + name: Check the crate can be released to crates.io + runs-on: ubuntu-latest + needs: check + steps: + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.66.1 + override: true + + - name: Clone repo + uses: actions/checkout@v2 + + - uses: actions-rs/cargo@v1 + with: + command: package + args: --allow-dirty --no-verify + check-features: name: Check all the features combinations on MSRV runs-on: ubuntu-latest From b84622050ba662e67b94ec4223a5da5377e87f7a Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 13:20:24 +0100 Subject: [PATCH 05/13] Feature cleanup. - This removes the `out-refs` feature (now always bundled). - This removes the `csharp-headers` feature (now part of `headers`). --- .github/workflows/gh-pages.yml | 14 ++--- Cargo.lock | 94 +++++++++++++++++++++++------- Cargo.toml | 19 ++---- build.rs | 3 +- ffi_tests/Cargo.toml | 2 +- js_tests/Cargo.toml | 1 - src/_lib.rs | 18 +++--- src/dyn_traits/_mod.rs | 5 +- src/dyn_traits/futures/executor.rs | 10 ++++ src/headers/_mod.rs | 14 +---- src/layout/_mod.rs | 11 +--- src/layout/impls.rs | 1 - src/layout/macros.rs | 4 +- src/layout/niche.rs | 1 - tests/layout_macros.rs | 1 - 15 files changed, 115 insertions(+), 83 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 5910c3156f..0efa718c89 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -73,10 +73,9 @@ jobs: matrix: feature--std: ['', '--features alloc', '--features std'] feature--async-fn: ['', '--features async-fn'] - feature--headers: ['', '--features headers', '--features csharp-headers'] + feature--headers: ['', '--features headers'] feature--dyn-traits: ['', '--features dyn-traits', '--features futures', '--features tokio'] # feature--log: ['', '--features log'] - feature--out-refs: ['', '--features out-refs'] feature--js: ['', '--features js'] steps: - name: Install Rust toolchain @@ -98,7 +97,6 @@ jobs: ${{ matrix.feature--async-fn }} ${{ matrix.feature--headers }} ${{ matrix.feature--dyn-traits }} - ${{ matrix.feature--out-refs }} ${{ matrix.feature--js }} # == BUILD & TEST == # @@ -114,9 +112,9 @@ jobs: - macos-latest - windows-latest rust: - # - 1.66.1 + - 1.66.1 - stable - - nightly + # - nightly steps: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 @@ -158,7 +156,7 @@ jobs: # Deploy to Github pages # deploy: if: github.ref == 'refs/heads/master' - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 needs: - build-and-test steps: @@ -172,7 +170,7 @@ jobs: - name: Install `mdbook` uses: peaceiris/actions-mdbook@v1 with: - mdbook-version: '0.3.7' + mdbook-version: '0.4.4' - name: Clone repo uses: actions/checkout@v2 @@ -188,7 +186,7 @@ jobs: - name: Build guide and documentation run: | (cd guide - (cd src && sed -e "s@{ROOT_PATH}@${URL_ROOT_PATH}@" links.md.template > links.md) + (cd src && sed -e "s,{ROOT_PATH},${URL_ROOT_PATH}," links.md.template > links.md) mdbook build mkdir -p book/{assets,rustdoc} cp -r assets/* book/assets/ diff --git a/Cargo.lock b/Cargo.lock index 791c8efab1..c3e50479a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -327,21 +327,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" -[[package]] -name = "mini_paste" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2499b7bd9834270bf24cfc4dd96be59020ba6fd7f3276b772aee2de66e82b63" -dependencies = [ - "mini_paste-proc_macro", -] - -[[package]] -name = "mini_paste-proc_macro" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c5f1f52e39b728e73af4b454f1b29173d4544607bd395dafe1918fd149db67" - [[package]] name = "miniz_oxide" version = "0.5.1" @@ -463,9 +448,9 @@ checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "paste" -version = "1.0.7" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" [[package]] name = "percent-encoding" @@ -568,7 +553,7 @@ checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "safer-ffi" -version = "0.1.0" +version = "0.1.0-rc1" dependencies = [ "async-compat", "futures", @@ -577,8 +562,8 @@ dependencies = [ "libc", "log", "macro_rules_attribute", - "mini_paste", "napi-dispatcher", + "paste", "safer-ffi", "safer_ffi-proc_macros", "scopeguard", @@ -696,13 +681,14 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.2" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" dependencies = [ "autocfg", "num_cpus", "pin-project-lite", + "windows-sys", ] [[package]] @@ -890,6 +876,72 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "with_builtin_macros" version = "0.0.3" diff --git a/Cargo.toml b/Cargo.toml index 9e3568d744..70d68a20bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,11 +23,10 @@ default = [ # Document under the following features: all but for debug or experimental. docs = [ - "csharp-headers", + "headers", "default", "nightly", "tokio", - "uninit", ] nightly = [] @@ -62,18 +61,11 @@ tokio = [ "futures", ] -out-refs = [ - "uninit", -] - headers = [ "inventory", "safer_ffi-proc_macros/headers", "std", ] -csharp-headers = [ - "headers", -] # Tweak the generated `.h` ever so slightly. c-headers-with-fn-style = [ "headers", @@ -98,7 +90,7 @@ macro_rules_attribute = "0.1.0" safer-ffi.path = "." safer-ffi.features = [ "async-fn", - "csharp-headers", + "headers", "dyn-traits", "tokio", ] @@ -125,18 +117,17 @@ macro_rules_attribute.version = "0.1.0" napi.package = "napi-dispatcher" napi.path = "napi-dispatcher" -paste.package = "mini_paste" -paste.version = "0.1.*" +# paste.package = "mini_paste" +paste.version = "1.0.12" scopeguard.version = "1.1.0" tokio.optional = true -tokio.version = "1.21.2" +tokio.version = "1.26.0" tokio.features = [ "rt", ] -uninit.optional = true uninit.version = "0.5.0" uninit.default-features = false diff --git a/build.rs b/build.rs index 7b83c7bfd4..436ab04557 100644 --- a/build.rs +++ b/build.rs @@ -3,7 +3,8 @@ fn main() { if cfg!(feature = "proc_macros") { println!("cargo:warning=[safer-ffi] \ - `proc-macros` feature is deprecated and will be removed\ + `proc-macros` feature is deprecated and will be removed \ + (now built-in)\ "); } } diff --git a/ffi_tests/Cargo.toml b/ffi_tests/Cargo.toml index 5738753f45..b734b709e6 100644 --- a/ffi_tests/Cargo.toml +++ b/ffi_tests/Cargo.toml @@ -21,7 +21,7 @@ features = [ ] [features] -generate-headers = ["safer-ffi/csharp-headers"] +generate-headers = ["safer-ffi/headers"] [profile.dev] panic = "unwind" diff --git a/js_tests/Cargo.toml b/js_tests/Cargo.toml index 7d6220d8e6..dbf8e99a9a 100644 --- a/js_tests/Cargo.toml +++ b/js_tests/Cargo.toml @@ -20,7 +20,6 @@ futures = "0.3.15" path = ".." features = [ # "debug_proc_macros", - "out-refs", ] [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/src/_lib.rs b/src/_lib.rs index 9617905903..b952166e24 100644 --- a/src/_lib.rs +++ b/src/_lib.rs @@ -2,13 +2,17 @@ #![allow(clippy::all)] #![cfg_attr(rustfmt, rustfmt::skip)] #![cfg_attr(feature = "nightly", - feature(doc_cfg, trivial_bounds) + feature(doc_cfg) )] #![cfg_attr(not(feature = "std"), no_std, )] -#![allow(nonstandard_style, trivial_bounds, unused_parens)] +#![allow( + nonstandard_style, + trivial_bounds, + unused_parens, +)] #![warn( missing_copy_implementations, missing_debug_implementations, @@ -20,7 +24,6 @@ unused_must_use, )] #![doc = include_str!("../README.md")] -#![cfg(not(rustfmt))] #[macro_use] extern crate macro_rules_attribute; @@ -242,7 +245,7 @@ __cfg_headers__! { mod headers; #[allow(missing_copy_implementations, missing_debug_implementations)] - #[doc(hidden)] pub + #[doc(hidden)] /** Not part of the public API */ pub struct FfiExport { pub name: &'static str, @@ -285,6 +288,9 @@ pub mod dyn_traits; #[cfg(feature = "futures")] +#[cfg_attr(all(docs, feature = "nightly"), + doc(cfg(feature = "futures")) +)] #[doc(no_inline)] pub use dyn_traits::futures; @@ -393,10 +399,6 @@ mod prelude { }, }; - #[cfg(feature = "out-refs")] - #[cfg_attr(all(docs, feature = "nightly"), - doc(cfg(feature = "out-refs")) - )] pub use ::uninit::prelude::{ // Out reference itself Out, diff --git a/src/dyn_traits/_mod.rs b/src/dyn_traits/_mod.rs index 3c151111ed..ca4ceb613a 100644 --- a/src/dyn_traits/_mod.rs +++ b/src/dyn_traits/_mod.rs @@ -4,8 +4,11 @@ use_prelude!(); -#[cfg(feature = "futures")] #[path = "futures/_mod.rs"] +#[cfg(feature = "futures")] +#[cfg_attr(all(docs, feature = "nightly"), + doc(cfg(feature = "futures")) +)] pub mod futures; #[doc(no_inline)] diff --git a/src/dyn_traits/futures/executor.rs b/src/dyn_traits/futures/executor.rs index 8993db70d7..c720e027e4 100644 --- a/src/dyn_traits/futures/executor.rs +++ b/src/dyn_traits/futures/executor.rs @@ -36,6 +36,9 @@ match_! {([] [Send + Sync]) {( $([ $($SendSync:tt)* ])* ) => ( $( impl VirtualPtr { #[cfg(feature = "tokio")] + #[cfg_attr(all(docs, feature = "nightly"), + doc(cfg(feature = "tokio")) + )] pub fn spawn_within_tokio_reactor ( self: &'_ Self, @@ -92,7 +95,11 @@ match_! {([] [Send + Sync]) {( $([ $($SendSync:tt)* ])* ) => ( } } + #[cfg(feature = "tokio")] + #[cfg_attr(all(docs, feature = "nightly"), + doc(cfg(feature = "tokio")) + )] pub fn block_on_within_tokio_reactor ( self: &'_ Self, @@ -135,6 +142,9 @@ match_! {([] [Send + Sync]) {( $([ $($SendSync:tt)* ])* ) => ( )}} cfg_match!(feature = "tokio" => { + #[cfg_attr(all(docs, feature = "nightly"), + doc(cfg(feature = "tokio")) + )] impl FfiFutureExecutor for ::tokio::runtime::Handle { fn dyn_spawn ( self: &'_ Self, diff --git a/src/headers/_mod.rs b/src/headers/_mod.rs index 67295ebbf1..b4532f273f 100644 --- a/src/headers/_mod.rs +++ b/src/headers/_mod.rs @@ -369,7 +369,6 @@ impl Builder<'_, WhereTo> { guard = guard, ), - #[cfg(feature = "csharp-headers")] | Language::CSharp => writeln!(definer.out(), include_str!("templates/csharp/_prelude.cs"), NameSpace = Self::pascal_cased_lib_name(), @@ -424,7 +423,6 @@ impl Builder<'_, WhereTo> { guard = self.guard(), ), - #[cfg(feature = "csharp-headers")] | Language::CSharp => { let pkg_name = Self::pascal_cased_lib_name(); write!(definer.out(), @@ -457,7 +455,6 @@ impl Builder<'_, WhereTo> { } /// Return a Pascal Cased (UpperCamelCase) version of the lib name. - #[cfg(feature = "csharp-headers")] fn pascal_cased_lib_name() -> String { Self::lib_name() .chars() @@ -496,11 +493,7 @@ enum Language { /// C, _lingua franca_ of FFI interop. C, - /// C# (experimental). - #[cfg(feature = "csharp-headers")] - #[cfg_attr(feature = "nightly", - doc(cfg(feature = "csharp-headers")) - )] + /// C# CSharp, } @@ -524,7 +517,6 @@ hidden_export! { | Language::C => { ::define_self(&crate::headers::languages::C, definer) }, - #[cfg(feature = "csharp-headers")] | Language::CSharp => { ::define_self(&crate::headers::languages::CSharp, definer) }, @@ -550,7 +542,6 @@ fn __define_fn__ ( { let dyn_lang: &dyn HeaderLanguage = match lang { | Language::C => &languages::C, - #[cfg(feature = "csharp-headers")] | Language::CSharp => &languages::CSharp, }; dyn_lang.emit_function( @@ -583,7 +574,6 @@ hidden_export! { "{} (", f_name.trim(), ), - #[cfg(feature = "csharp-headers")] | Language::CSharp => write!(out, "{} (", f_name.trim(), ), @@ -607,7 +597,6 @@ hidden_export! { Arg::CLayout::name_wrapping_var(&crate::headers::languages::C, arg_name), ), - #[cfg(feature = "csharp-headers")] | Language::CSharp => write!(out, "\n {marshaler}{}", Arg::CLayout::name_wrapping_var(&crate::headers::languages::CSharp, arg_name), @@ -641,7 +630,6 @@ hidden_export! { ) }, - #[cfg(feature = "csharp-headers")] | Language::CSharp => { writeln!(out, concat!( diff --git a/src/layout/_mod.rs b/src/layout/_mod.rs index 98e3cad9c4..3a89b3eda3 100644 --- a/src/layout/_mod.rs +++ b/src/layout/_mod.rs @@ -116,7 +116,6 @@ impl CType for T { | _case if language.is::() => { ::c_define_self(definer) }, - #[cfg(feature = "csharp-headers")] | _case if language.is::() => { ::csharp_define_self(definer) }, @@ -142,7 +141,6 @@ impl CType for T { | _case if language.is::() => { ::c_var(var_name).to_string() }, - #[cfg(feature = "csharp-headers")] | _case if language.is::() => { let sep = if var_name.is_empty() { "" } else { " " }; format!("{}{sep}{var_name}", Self::csharp_ty()) @@ -155,14 +153,7 @@ impl CType for T { fn csharp_marshaler () -> Option { - cfg_match!({ - feature = "csharp-headers" => { - ::legacy_csharp_marshaler() - }, - _ => { - unimplemented!("missing `csharp-headers` Cargo feature"); - }, - }) + ::legacy_csharp_marshaler() } } } diff --git a/src/layout/impls.rs b/src/layout/impls.rs index 10b33dc784..1ac8cd82f3 100644 --- a/src/layout/impls.rs +++ b/src/layout/impls.rs @@ -1032,7 +1032,6 @@ impl_ReprC_for! { unsafe { /* `HasNiche` from `niche.rs` impls `ReprC` for `Option` types. */ -#[cfg(feature = "out-refs")] impl_ReprC_for! { unsafe { @for['out, T : 'out + Sized + ReprC] Out<'out, T> diff --git a/src/layout/macros.rs b/src/layout/macros.rs index 121d9de220..546c2f4d9d 100644 --- a/src/layout/macros.rs +++ b/src/layout/macros.rs @@ -29,7 +29,7 @@ macro_rules! __cfg_js__ {( // nothing )} -#[cfg(feature = "csharp-headers")] +#[cfg(feature = "headers")] #[macro_export] #[doc(hidden)] macro_rules! __cfg_csharp__ {( $($item:item)* @@ -37,7 +37,7 @@ macro_rules! __cfg_csharp__ {( $($item)* )} -#[cfg(not(feature = "csharp-headers"))] +#[cfg(not(feature = "headers"))] #[macro_export] #[doc(hidden)] macro_rules! __cfg_csharp__ {( $($item:item)* diff --git a/src/layout/niche.rs b/src/layout/niche.rs index b2eb2872da..a4b99aed88 100644 --- a/src/layout/niche.rs +++ b/src/layout/niche.rs @@ -94,7 +94,6 @@ cfg_alloc! { } } -#[cfg(feature = "out-refs")] unsafe_impls! { @for['out, T : 'out + ReprC] Out<'out, T> => |it| it.is_null() diff --git a/tests/layout_macros.rs b/tests/layout_macros.rs index 9ac438553d..a6f7046ea0 100644 --- a/tests/layout_macros.rs +++ b/tests/layout_macros.rs @@ -319,7 +319,6 @@ fn generate_headers () for &language in &[ C, - #[cfg(feature = "csharp-headers")] CSharp, ] { From fcf60c4962a05d1b2f830ed616f45c4667b88db2 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 13:25:44 +0100 Subject: [PATCH 06/13] Fix CI --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 0efa718c89..823f27ae45 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -43,7 +43,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: check - args: --features proc_macros,log,out-refs + args: --features log releasable-to-crates-io: name: Check the crate can be released to crates.io From 34bb9050ad3d8dfb7366b4b60803c70076c91399 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 13:31:55 +0100 Subject: [PATCH 07/13] Nit --- .github/workflows/gh-pages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 823f27ae45..325180b051 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -15,7 +15,6 @@ jobs: name: Check nightly stable and MSRV runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: os: - ubuntu-latest @@ -70,6 +69,7 @@ jobs: runs-on: ubuntu-latest needs: check strategy: + fail-fast: false matrix: feature--std: ['', '--features alloc', '--features std'] feature--async-fn: ['', '--features async-fn'] @@ -103,7 +103,7 @@ jobs: build-and-test: name: Build and test runs-on: ${{ matrix.os }} - needs: [check, check-features] + needs: [check] strategy: fail-fast: false matrix: From 3c60e7f056065b8d1c9a88056118043caf70a56e Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 13:42:26 +0100 Subject: [PATCH 08/13] Nits + use crates.io placeholder for js functionality --- Cargo.toml | 27 +++++++++++++++++++-------- napi-dispatcher/Cargo.toml | 4 ++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 70d68a20bc..63fa79163d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,17 +4,23 @@ path = "src/_lib.rs" [package] name = "safer-ffi" version = "0.1.0-rc1" # Keep in sync -authors = ["Daniel Henry-Mantilla "] +authors = [ + "Daniel Henry-Mantilla ", +] edition = "2021" description = "Write safer FFI code in Rust without polluting it with unsafe code" -keywords = ["ffi", "no_std", "framework", "safety", "bindings"] +keywords = [ + "ffi", "no_std", "framework", "safety", "bindings", +] license = "MIT" repository = "https://github.com/getditto/safer_ffi" readme = "README.md" -exclude = ["/guide"] +exclude = [ + "/guide", +] [features] default = [ @@ -71,10 +77,12 @@ c-headers-with-fn-style = [ "headers", ] +# PRIVATE FEATURE / not part of crates.io package! js = [ "async-fn", "headers", "inventory", + "napi", "safer_ffi-proc_macros/js", # For convenience "std", @@ -112,12 +120,8 @@ inventory-0-3-1.version = "0.3.1" log.optional = true log.version = "0.4.8" -macro_rules_attribute.version = "0.1.0" +macro_rules_attribute.version = "0.1.3" -napi.package = "napi-dispatcher" -napi.path = "napi-dispatcher" - -# paste.package = "mini_paste" paste.version = "1.0.12" scopeguard.version = "1.1.0" @@ -135,6 +139,13 @@ unwind_safe.version = "0.1.0" with_builtin_macros.version = "0.0.3" +# This dependency is not released to crates.io +[dependencies.napi] +optional = true +path = "napi-dispatcher" +package = "cratesio-placeholder-package" +version = "0.0.3" + [dependencies.safer_ffi-proc_macros] path = "src/proc_macro" version = "0.1.0-rc1" # Keep in sync diff --git a/napi-dispatcher/Cargo.toml b/napi-dispatcher/Cargo.toml index 7c710656c5..f3f6cd11f8 100644 --- a/napi-dispatcher/Cargo.toml +++ b/napi-dispatcher/Cargo.toml @@ -2,8 +2,8 @@ path = "dispatcher.rs" [package] -name = "napi-dispatcher" -version = "0.1.0" +name = "cratesio-placeholder-package" # "napi-dispatcher" +version = "0.0.3" authors = [ "Daniel Henry Mantilla ", ] From beedca49256dc52f0a8dfeffdb97d41c84e20518 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 13:31:47 +0100 Subject: [PATCH 09/13] Update `.lock` files and dependencies --- Cargo.lock | 314 +++++++++++++++++---------------- ffi_tests/.gitignore | 1 - ffi_tests/Cargo.lock | 346 ++++++++++++++++++++++++++++++++++++ js_tests/Cargo.lock | 411 +++++++++++++++++++++++++------------------ 4 files changed, 747 insertions(+), 325 deletions(-) create mode 100644 ffi_tests/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock index c3e50479a2..bcb49676b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,21 +29,21 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cfg-if" @@ -52,10 +52,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "chunked_transfer" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" +name = "cratesio-placeholder-package" +version = "0.0.3" +dependencies = [ + "napi", + "napi-dispatcher-nodejs-derive", + "napi-dispatcher-wasm", +] [[package]] name = "crc32fast" @@ -68,41 +71,67 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.20" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", "syn", ] +[[package]] +name = "ext-trait" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d772df1c1a777963712fb68e014235e80863d6a91a85c4e06ba2d16243a310e5" +dependencies = [ + "ext-trait-proc_macros", +] + +[[package]] +name = "ext-trait-proc_macros" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab7934152eaf26aa5aa9f7371408ad5af4c31357073c9e84c3b9d7f11ad639a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "extension-traits" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a296e5a895621edf9fa8329c83aa1cb69a964643e36cf54d8d7a69b789089537" +dependencies = [ + "ext-trait", +] + [[package]] name = "flate2" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ - "cfg-if", "crc32fast", - "libc", "miniz_oxide", ] [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "futures" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" dependencies = [ "futures-channel", "futures-core", @@ -115,9 +144,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" dependencies = [ "futures-core", "futures-sink", @@ -125,15 +154,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" dependencies = [ "futures-core", "futures-task", @@ -142,15 +171,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ "proc-macro2", "quote", @@ -159,21 +188,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-channel", "futures-core", @@ -189,9 +218,9 @@ dependencies = [ [[package]] name = "ghost" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb19fe8de3ea0920d282f7b77dd4227aea6b8b999b42cdf0ca41b2472b14443a" +checksum = "69e0cd8a998937e25c6ba7cc276b96ec5cc3f4dc4ab5de9ede4fb152bdd5c5eb" dependencies = [ "proc-macro2", "quote", @@ -200,9 +229,9 @@ dependencies = [ [[package]] name = "gloo-utils" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40913a05c8297adca04392f707b1e73b12ba7b8eab7244a4961580b1fd34063c" +checksum = "a8e8fc851e9c7b9852508bc6e3f690f452f474417e8545ec9857b7f7377036b5" dependencies = [ "js-sys", "serde", @@ -213,29 +242,28 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" dependencies = [ "libc", ] [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "inventory" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0f7efb804ec95e33db9ad49e4252f049e37e8b0a4652e3cd61f7999f2eff7f" +checksum = "f0eb5160c60ba1e809707918ee329adb99d222888155835c6feedba19f6c3fd4" dependencies = [ "ctor", "ghost", @@ -244,9 +272,9 @@ dependencies = [ [[package]] name = "inventory" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e21e0a36a4dc4b469422ee17f715e8313f4a637675656d6a13637954278c6f55" +checksum = "498ae1c9c329c7972b917506239b557a60386839192f1cf0ca034f345b65db99" dependencies = [ "ctor", "ghost", @@ -254,9 +282,9 @@ dependencies = [ [[package]] name = "inventory-impl" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75c094e94816723ab936484666968f5b58060492e880f3c8d00489a1e244fa51" +checksum = "7e41b53715c6f0c4be49510bb82dee2c1e51c8586d885abe65396e82ed518548" dependencies = [ "proc-macro2", "quote", @@ -265,45 +293,39 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - [[package]] name = "libc" -version = "0.2.99" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "log" -version = "0.4.14" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", ] [[package]] name = "macro_rules_attribute" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2db753a9eacb63f7aa2c64bfdd2cd3f35cc8b0946799f0b60f7110f4f3104e3b" +checksum = "cf0c9b980bf4f3a37fd7b1c066941dd1b1d0152ce6ee6e8fe8c49b9f6810d862" dependencies = [ "macro_rules_attribute-proc_macro", "paste", @@ -311,15 +333,9 @@ dependencies = [ [[package]] name = "macro_rules_attribute-proc_macro" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61568f4b6f1d9c6b31185090275fb372dab0f5cea6a772e906ec56d1dc6d74aa" - -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "58093314a45e00c77d5c508f76e77c3396afbbc0d01506e7fae47b018bac2b1d" [[package]] name = "memchr" @@ -329,9 +345,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miniz_oxide" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -377,15 +393,6 @@ dependencies = [ "syn", ] -[[package]] -name = "napi-dispatcher" -version = "0.1.0" -dependencies = [ - "napi", - "napi-dispatcher-nodejs-derive", - "napi-dispatcher-wasm", -] - [[package]] name = "napi-dispatcher-nodejs-derive" version = "0.1.0" @@ -432,9 +439,9 @@ source = "git+https://github.com/getditto/napi-rs?branch=ditto/closure-into-jsfu [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ "hermit-abi", "libc", @@ -442,9 +449,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.10.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "paste" @@ -454,9 +461,9 @@ checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pin-project-lite" @@ -472,9 +479,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "prettyplease" -version = "0.1.10" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9e07e3a46d0771a8a06b5f4441527802830b43e679ba12f44960f48dd4c6803" +checksum = "4ebcd279d20a4a0a2404a33056388e950504d891c855c7975b9a8fef75f3bf04" dependencies = [ "proc-macro2", "syn", @@ -482,36 +489,36 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.18" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] [[package]] name = "ref-cast" -version = "1.0.7" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685d58625b6c2b83e4cc88a27c4bf65adb7b6b16dbdc413e515c9405b47432ab" +checksum = "a9af2cf09ef80e610097515e80095b7f76660a92743c4185aff5406cd5ce3dd5" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.7" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a043824e29c94169374ac5183ac0ed43f5724dc4556b19568007486bd840fa1f" +checksum = "9c501201393982e275433bc55de7d6ae6f00e7699cd5572c5b57581cd69c881b" dependencies = [ "proc-macro2", "quote", @@ -535,9 +542,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.4" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -547,22 +554,22 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "safer-ffi" version = "0.1.0-rc1" dependencies = [ "async-compat", + "cratesio-placeholder-package", "futures", - "inventory 0.1.10", - "inventory 0.3.2", + "inventory 0.1.11", + "inventory 0.3.4", "libc", "log", "macro_rules_attribute", - "napi-dispatcher", "paste", "safer-ffi", "safer_ffi-proc_macros", @@ -609,18 +616,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.136" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" dependencies = [ "proc-macro2", "quote", @@ -629,9 +636,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" dependencies = [ "itoa", "ryu", @@ -640,9 +647,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] @@ -655,9 +662,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "syn" -version = "1.0.98" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -675,9 +682,9 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" @@ -693,30 +700,33 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" [[package]] name = "unicode-ident" -version = "1.0.1" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "uninit" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb5fa53d0101e0cd980b0d679db2c76f75c94b883985f57cfe7f50c72dd0536" +checksum = "3e130f2ed46ca5d8ec13c7ff95836827f92f5f5f37fd2b2bf16f33c408d98bb6" +dependencies = [ + "extension-traits", +] [[package]] name = "untrusted" @@ -732,12 +742,11 @@ checksum = "0976c77def3f1f75c4ef892a292c31c0bbe9e3d0702c63044d7c76db298171a3" [[package]] name = "ureq" -version = "2.4.0" +version = "2.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9399fa2f927a3d327187cbd201480cee55bee6ac5d3c77dd27f0c6814cff16d5" +checksum = "338b31dd1314f68f3aabf3ed57ab922df95ffcd902476ca7ba3c4ce7b908c46d" dependencies = [ "base64", - "chunked_transfer", "flate2", "log", "once_cell", @@ -749,21 +758,20 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", ] [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -771,13 +779,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -786,9 +794,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.30" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if", "js-sys", @@ -798,9 +806,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -808,9 +816,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", @@ -821,15 +829,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -847,9 +855,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.3" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] diff --git a/ffi_tests/.gitignore b/ffi_tests/.gitignore index f17110ab69..5c3650b11e 100644 --- a/ffi_tests/.gitignore +++ b/ffi_tests/.gitignore @@ -1,6 +1,5 @@ /target **/*.rs.bk -Cargo.lock c_binary **/*.a diff --git a/ffi_tests/Cargo.lock b/ffi_tests/Cargo.lock new file mode 100644 index 0000000000..92573c8815 --- /dev/null +++ b/ffi_tests/Cargo.lock @@ -0,0 +1,346 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "ctor" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "ext-trait" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d772df1c1a777963712fb68e014235e80863d6a91a85c4e06ba2d16243a310e5" +dependencies = [ + "ext-trait-proc_macros", +] + +[[package]] +name = "ext-trait-proc_macros" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab7934152eaf26aa5aa9f7371408ad5af4c31357073c9e84c3b9d7f11ad639a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "extension-traits" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a296e5a895621edf9fa8329c83aa1cb69a964643e36cf54d8d7a69b789089537" +dependencies = [ + "ext-trait", +] + +[[package]] +name = "ffi_tests" +version = "0.1.0" +dependencies = [ + "safer-ffi", + "scopeguard", +] + +[[package]] +name = "futures" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" + +[[package]] +name = "futures-executor" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" + +[[package]] +name = "futures-macro" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" + +[[package]] +name = "futures-task" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" + +[[package]] +name = "futures-util" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "ghost" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e0cd8a998937e25c6ba7cc276b96ec5cc3f4dc4ab5de9ede4fb152bdd5c5eb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "inventory" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0eb5160c60ba1e809707918ee329adb99d222888155835c6feedba19f6c3fd4" +dependencies = [ + "ctor", + "ghost", + "inventory-impl", +] + +[[package]] +name = "inventory-impl" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e41b53715c6f0c4be49510bb82dee2c1e51c8586d885abe65396e82ed518548" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "libc" +version = "0.2.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" + +[[package]] +name = "macro_rules_attribute" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf0c9b980bf4f3a37fd7b1c066941dd1b1d0152ce6ee6e8fe8c49b9f6810d862" +dependencies = [ + "macro_rules_attribute-proc_macro", + "paste", +] + +[[package]] +name = "macro_rules_attribute-proc_macro" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58093314a45e00c77d5c508f76e77c3396afbbc0d01506e7fae47b018bac2b1d" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "prettyplease" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebcd279d20a4a0a2404a33056388e950504d891c855c7975b9a8fef75f3bf04" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "safer-ffi" +version = "0.1.0-rc1" +dependencies = [ + "futures", + "inventory", + "libc", + "macro_rules_attribute", + "paste", + "safer_ffi-proc_macros", + "scopeguard", + "uninit", + "unwind_safe", + "with_builtin_macros", +] + +[[package]] +name = "safer_ffi-proc_macros" +version = "0.1.0-rc1" +dependencies = [ + "macro_rules_attribute", + "prettyplease", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "uninit" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e130f2ed46ca5d8ec13c7ff95836827f92f5f5f37fd2b2bf16f33c408d98bb6" +dependencies = [ + "extension-traits", +] + +[[package]] +name = "unwind_safe" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0976c77def3f1f75c4ef892a292c31c0bbe9e3d0702c63044d7c76db298171a3" + +[[package]] +name = "with_builtin_macros" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a59d55032495429b87f9d69954c6c8602e4d3f3e0a747a12dea6b0b23de685da" +dependencies = [ + "with_builtin_macros-proc_macros", +] + +[[package]] +name = "with_builtin_macros-proc_macros" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bd7679c15e22924f53aee34d4e448c45b674feb6129689af88593e129f8f42" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/js_tests/Cargo.lock b/js_tests/Cargo.lock index f914e2e25b..eec510d85e 100644 --- a/js_tests/Cargo.lock +++ b/js_tests/Cargo.lock @@ -8,23 +8,29 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cfg-if" @@ -32,12 +38,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chunked_transfer" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" - [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -48,6 +48,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "cratesio-placeholder-package" +version = "0.0.3" +dependencies = [ + "napi", + "napi-dispatcher-nodejs-derive", + "napi-dispatcher-wasm", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -59,41 +68,67 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.22" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "ext-trait" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d772df1c1a777963712fb68e014235e80863d6a91a85c4e06ba2d16243a310e5" +dependencies = [ + "ext-trait-proc_macros", +] + +[[package]] +name = "ext-trait-proc_macros" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" +checksum = "1ab7934152eaf26aa5aa9f7371408ad5af4c31357073c9e84c3b9d7f11ad639a" dependencies = [ + "proc-macro2", "quote", "syn", ] +[[package]] +name = "extension-traits" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a296e5a895621edf9fa8329c83aa1cb69a964643e36cf54d8d7a69b789089537" +dependencies = [ + "ext-trait", +] + [[package]] name = "flate2" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ - "cfg-if", "crc32fast", - "libc", "miniz_oxide", ] [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "futures" -version = "0.3.21" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" dependencies = [ "futures-channel", "futures-core", @@ -106,9 +141,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" dependencies = [ "futures-core", "futures-sink", @@ -116,15 +151,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" dependencies = [ "futures-core", "futures-task", @@ -133,15 +168,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ "proc-macro2", "quote", @@ -150,21 +185,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-channel", "futures-core", @@ -180,9 +215,9 @@ dependencies = [ [[package]] name = "ghost" -version = "0.1.4" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c813ffb63e8fd3df6f1ac3cc1ea392c7612ac2de4d0b44dcbfe03e5c4bf94a" +checksum = "69e0cd8a998937e25c6ba7cc276b96ec5cc3f4dc4ab5de9ede4fb152bdd5c5eb" dependencies = [ "proc-macro2", "quote", @@ -204,20 +239,19 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" dependencies = [ "libc", ] [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] @@ -246,15 +280,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -269,17 +303,11 @@ dependencies = [ "safer-ffi-build", ] -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - [[package]] name = "libc" -version = "0.2.125" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "log" @@ -292,9 +320,9 @@ dependencies = [ [[package]] name = "macro_rules_attribute" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422a6e082b3d33461030d68a243af2482eefded078eaaf8ac401777d21cae32b" +checksum = "cf0c9b980bf4f3a37fd7b1c066941dd1b1d0152ce6ee6e8fe8c49b9f6810d862" dependencies = [ "macro_rules_attribute-proc_macro", "paste", @@ -302,15 +330,9 @@ dependencies = [ [[package]] name = "macro_rules_attribute-proc_macro" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb4091d2e7f515b3a7ae8dda39417cd2b81d5c8814f68361c3e15b24e2d40b4a" - -[[package]] -name = "matches" -version = "0.1.9" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "58093314a45e00c77d5c508f76e77c3396afbbc0d01506e7fae47b018bac2b1d" [[package]] name = "memchr" @@ -318,26 +340,11 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" -[[package]] -name = "mini_paste" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2499b7bd9834270bf24cfc4dd96be59020ba6fd7f3276b772aee2de66e82b63" -dependencies = [ - "mini_paste-proc_macro", -] - -[[package]] -name = "mini_paste-proc_macro" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c5f1f52e39b728e73af4b454f1b29173d4544607bd395dafe1918fd149db67" - [[package]] name = "miniz_oxide" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -383,15 +390,6 @@ dependencies = [ "syn", ] -[[package]] -name = "napi-dispatcher" -version = "0.1.0" -dependencies = [ - "napi", - "napi-dispatcher-nodejs-derive", - "napi-dispatcher-wasm", -] - [[package]] name = "napi-dispatcher-nodejs-derive" version = "0.1.0" @@ -438,9 +436,9 @@ source = "git+https://github.com/getditto/napi-rs?branch=ditto/closure-into-jsfu [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ "hermit-abi", "libc", @@ -448,21 +446,21 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.10.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "paste" -version = "1.0.7" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pin-project-lite" @@ -478,9 +476,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "prettyplease" -version = "0.1.11" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28f53e8b192565862cf99343194579a022eb9c7dd3a8d03134734803c7b3125" +checksum = "4ebcd279d20a4a0a2404a33056388e950504d891c855c7975b9a8fef75f3bf04" dependencies = [ "proc-macro2", "syn", @@ -488,36 +486,36 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.38" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa" +checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.18" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] [[package]] name = "ref-cast" -version = "1.0.7" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685d58625b6c2b83e4cc88a27c4bf65adb7b6b16dbdc413e515c9405b47432ab" +checksum = "a9af2cf09ef80e610097515e80095b7f76660a92743c4185aff5406cd5ce3dd5" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.7" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a043824e29c94169374ac5183ac0ed43f5724dc4556b19568007486bd840fa1f" +checksum = "9c501201393982e275433bc55de7d6ae6f00e7699cd5572c5b57581cd69c881b" dependencies = [ "proc-macro2", "quote", @@ -541,9 +539,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.4" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -553,19 +551,19 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "safer-ffi" -version = "0.1.0" +version = "0.1.0-rc1" dependencies = [ + "cratesio-placeholder-package", "inventory", "libc", "macro_rules_attribute", - "mini_paste", - "napi-dispatcher", + "paste", "safer_ffi-proc_macros", "scopeguard", "uninit", @@ -609,18 +607,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.137" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.137" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" dependencies = [ "proc-macro2", "quote", @@ -629,9 +627,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" dependencies = [ "itoa", "ryu", @@ -640,9 +638,12 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] [[package]] name = "spin" @@ -652,13 +653,13 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "syn" -version = "1.0.92" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -672,47 +673,51 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.18.2" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" dependencies = [ + "autocfg", "num_cpus", - "once_cell", "pin-project-lite", + "windows-sys", ] [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" + +[[package]] +name = "unicode-ident" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-xid" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" - [[package]] name = "uninit" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb5fa53d0101e0cd980b0d679db2c76f75c94b883985f57cfe7f50c72dd0536" +checksum = "3e130f2ed46ca5d8ec13c7ff95836827f92f5f5f37fd2b2bf16f33c408d98bb6" +dependencies = [ + "extension-traits", +] [[package]] name = "untrusted" @@ -728,12 +733,11 @@ checksum = "0976c77def3f1f75c4ef892a292c31c0bbe9e3d0702c63044d7c76db298171a3" [[package]] name = "ureq" -version = "2.4.0" +version = "2.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9399fa2f927a3d327187cbd201480cee55bee6ac5d3c77dd27f0c6814cff16d5" +checksum = "338b31dd1314f68f3aabf3ed57ab922df95ffcd902476ca7ba3c4ce7b908c46d" dependencies = [ "base64", - "chunked_transfer", "flate2", "log", "once_cell", @@ -745,21 +749,20 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", ] [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -767,13 +770,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -782,9 +785,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.30" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if", "js-sys", @@ -794,9 +797,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -804,9 +807,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", @@ -817,15 +820,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -843,9 +846,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.3" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] @@ -872,6 +875,72 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "with_builtin_macros" version = "0.0.3" From 33e3cd355cd797d989a642bfd9090cef08b5bd7f Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 13:55:08 +0100 Subject: [PATCH 10/13] CI: bundle all the required checks into one (infrastructure as code yadda yadda) --- .github/workflows/gh-pages.yml | 21 ++++++++++++++++++++- napi-dispatcher/dispatcher.rs | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 325180b051..3fcc6e24d4 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -45,7 +45,7 @@ jobs: args: --features log releasable-to-crates-io: - name: Check the crate can be released to crates.io + name: Check the package can be released to crates.io runs-on: ubuntu-latest needs: check steps: @@ -153,6 +153,25 @@ jobs: RUSTFLAGS: -Zmacro-backtrace RUST_BACKTRACE: full + all-good: + name: All the required checks + needs: + - check + - check-features + - build-and-test + - releasable-to-crates-io + runs-on: ubuntu-latest + if: ${{ always() }} + steps: + - name: Job Checks + run: | + RESULT=$(echo "${{ join(needs.*.result, '') }}" | sed -e "s/success//g") + if [ -n "$RESULT" ]; then + echo "One or more jobs failed" + exit 1 + fi + echo "All jobs succeeded" + # Deploy to Github pages # deploy: if: github.ref == 'refs/heads/master' diff --git a/napi-dispatcher/dispatcher.rs b/napi-dispatcher/dispatcher.rs index e0d7caa6fb..a064100e46 100644 --- a/napi-dispatcher/dispatcher.rs +++ b/napi-dispatcher/dispatcher.rs @@ -11,6 +11,7 @@ macro_rules! emit {( $($_:tt)* ) => ( $($_)* )} } #[cfg(not(target_arch = "wasm32"))] emit! { + #[allow(unused_extern_crates)] extern crate napi; pub use ::{ napi::*, From 304eaaca90da941e29d5adf0004a690cadd1e6c7 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 13:56:44 +0100 Subject: [PATCH 11/13] Make `dyn-traits` require `std` --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 63fa79163d..8233a467d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,8 @@ debug_proc_macros = [ dyn-traits = [ "safer_ffi-proc_macros/dyn-traits", + # FIXME: make this finer-grained + "std", ] futures = [ From 7e631b9f914983f12c9701c77aaadc2b7e6c14e8 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 14:12:46 +0100 Subject: [PATCH 12/13] Enable the `rt-multi-thread` feature of `tokio` when testing --- Cargo.toml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8233a467d9..5f50023ae5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,16 +95,17 @@ inventory-0-3-1 = [ "safer_ffi-proc_macros/inventory-0-3-1", ] -[dev-dependencies] -macro_rules_attribute = "0.1.0" -safer-ffi.path = "." -safer-ffi.features = [ +internal-tests = [ "async-fn", "headers", "dyn-traits", - "tokio", + "tokio/rt-multi-thread", ] +[dev-dependencies] +safer-ffi.path = "." +safer-ffi.features = ["internal-tests"] + [dependencies] async-compat.optional = true async-compat.version = "0.2.1" From cf89c68b153d7ce8f59e9203e72289f8cbbc3a50 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Tue, 14 Mar 2023 14:26:37 +0100 Subject: [PATCH 13/13] Use .NET 6 for the C# integration test --- ffi_tests/tests/csharp/Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffi_tests/tests/csharp/Tests.csproj b/ffi_tests/tests/csharp/Tests.csproj index 5dede5e0d4..148801f72a 100644 --- a/ffi_tests/tests/csharp/Tests.csproj +++ b/ffi_tests/tests/csharp/Tests.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp5.0 + netcoreapp6.0 true