JonasKruckenberg / tauri-sys

Bindings to the Tauri API for projects using wasm-bindgen
Apache License 2.0
84 stars 21 forks source link

Unable to compile with the dialog feature enabled #30

Closed Isaac-Leonard closed 11 months ago

Isaac-Leonard commented 11 months ago

When adding the dialog feature to my project I get compilation errors.

   Compiling tauri-sys v0.1.0 (https://github.com/JonasKruckenberg/tauri-sys?rev
=904450c#904450cf)
error: concrete type differs from previous defining opaque type use
   --> /Users/isaac/.cargo/git/checkouts/tauri-sys-af581fbb8e6f4ef1/904450c/src/
dialog.rs:170:64
    |
170 | ...:Result<Option<impl Iterator<Item = PathBuf>>> {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                   |
    |                   expected `std::iter::Map<ArrayIterator, [closure@/Users/
isaac/.cargo/git/checkouts/tauri-sys-af581fbb8e6f4ef1/904450c/src/dialog.rs:177:
47: 177:52]>`, got `std::iter::Map<ArrayIterator, [closure@/Users/isaac/.cargo/g
it/checkouts/tauri-sys-af581fbb8e6f4ef1/904450c/src/dialog.rs:177:47: 177:52]>`
    |                   this expression supplies two conflicting concrete types
for the same opaque type

error: concrete type differs from previous defining opaque type use
   --> /Users/isaac/.cargo/git/checkouts/tauri-sys-af581fbb8e6f4ef1/904450c/src/
dialog.rs:221:66
    |
221 | ...:Result<Option<impl Iterator<Item = PathBuf>>> {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                   |
    |                   expected `std::iter::Map<ArrayIterator, [closure@/Users/
isaac/.cargo/git/checkouts/tauri-sys-af581fbb8e6f4ef1/904450c/src/dialog.rs:229:
47: 229:52]>`, got `std::iter::Map<ArrayIterator, [closure@/Users/isaac/.cargo/g
it/checkouts/tauri-sys-af581fbb8e6f4ef1/904450c/src/dialog.rs:229:47: 229:52]>`
    |                   this expression supplies two conflicting concrete types
for the same opaque type

error: could not compile `tauri-sys` (lib) due to 2 previous errors

My cargo.toml has this for kauri-sys:

tauri-sys = { git = "https://github.com/JonasKruckenberg/tauri-sys", rev = "904450c", features = [
"dialog"
] }

I'm happy to make a pull request later today if this is just a name conflict issue as the error seems to suggest

Isaac-Leonard commented 11 months ago

Okay, I can get it to compile fine when cloning this repo so not sure what's going on

Isaac-Leonard commented 11 months ago

It seems like it depends on the rust version I'm using with issues happening in the currently nightly iteration

Isaac-Leonard commented 11 months ago

Adding the following to rust-toolchain.toml in my project seems to fix it for now:

[toolchain]
channel = "nightly-2023-06-15"

With the error I encountered while attempting to compile the current tauri-sys repo with the current nightly edition being:

error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /Users/isaac/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-mac
ro2-1.0.47/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `proc-macro2` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...

Not sure if this was the cause of the original errors but I'll mark this as closed for now as I seem to have a solution and the issue doesn't appear to be in the kauri-sys code.