slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.

Home Page:https://slint.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I encountered a failure building wasm when using 'skia' renderer.

xb284524239 opened this issue · comments

I attempted to compile the MemoryTile demo into WASM, and two distinct scenarios emerged:

  • When using the femtovg renderer, everything proceeded as expected.
  • However, when attempting to use the skia renderer, the build process failed.

My computer is Windows 10, and the Slint version is 1.7.1.

# Cargo.toml

[package]
name = "slint_learn"
version = "1.0.0"
edition = "2021"
publish = false

[lib]
name = "memlib"
path = "src/lib.rs"
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "memory"
path = "src/main.rs"

[dependencies]
slint = { version = "1.7",  default-features = false, features = ["compat-1-2", "backend-winit", "renderer-skia"] }
# slint = { version = "1.7", default-features = false, features = ["compat-1-2", "backend-winit", "renderer-femtovg"] }
rand = "0.8"

[build-dependencies]
slint-build = "1.7"

# wasm command:  wasm-pack build --release --target web --no-typescript --no-pack
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { version = "0.2" }
web-sys = { version = "0.3", features = ["console"] }
console_error_panic_hook = "0.1"
getrandom = { version = "0.2", features = ["js"] }

[profile.release]
lto = true
opt-level = 3
panic = "abort"
codegen-units = 1

[profile.dev]
opt-level = 2

PS C:\Workspace\VSCode_Workspace\slint_learn> wasm-pack build --release --target web
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
   Compiling skia-bindings v0.75.0
   Compiling i-slint-core v1.7.1
   Compiling glutin v0.32.0
   Compiling i-slint-backend-winit v1.7.1
   Compiling zerocopy-derive v0.7.35     
   Compiling dpi v0.1.1
   Compiling smol_str v0.2.2
   Compiling cursor-icon v1.1.0
error: Please select at least one api backend
  --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:28:1
   |
28 | compile_error!("Please select at least one api backend");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   Compiling i-slint-backend-selector v1.7.1
error[E0392]: type parameter `T` is never used
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:278:18
    |
278 | pub enum Surface<T: SurfaceTypeTrait> {
    |                  ^ unused type parameter
    |
    = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`

error[E0277]: `()` doesn't implement `std::fmt::Display`
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:524:57
    |
524 |         f.write_fmt(format_args!("DisplayApiPreference::{api}"))
    |                                                         ^^^^^ `()` cannot be formatted with the default formatter
    |
    = help: the trait `std::fmt::Display` is not implemented for `()`
    = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
    = note: this error originates in the macro `format_args` (in Nightly builds, run with -Z macro-backtrace for more info)

   Compiling winit v0.30.4
error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19    
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:451:9 
    |
451 |         gl_api_dispatch!(self; Self(config) => config.color_buffer_type())
    |         ------------------------------------------------------------------ in this macro invocation   
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:455:9
    |
455 |         gl_api_dispatch!(self; Self(config) => config.float_pixels())
    |         ------------------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:459:9
    |
459 |         gl_api_dispatch!(self; Self(config) => config.alpha_size())
    |         ----------------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:463:9
    |
463 |         gl_api_dispatch!(self; Self(config) => config.depth_size())
    |         ----------------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:467:9
    |
467 |         gl_api_dispatch!(self; Self(config) => config.stencil_size())
    |         ------------------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:471:9
    |
471 |         gl_api_dispatch!(self; Self(config) => config.num_samples())
    |         ------------------------------------------------------------ in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:475:9
    |
475 |         gl_api_dispatch!(self; Self(config) => config.srgb_capable())
    |         ------------------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:479:9
    |
479 |         gl_api_dispatch!(self; Self(config) => config.config_surface_types())
    |         --------------------------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:483:9
    |
483 |         gl_api_dispatch!(self; Self(config) => config.hardware_accelerated())
    |         --------------------------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:487:9
    |
487 |         gl_api_dispatch!(self; Self(config) => config.supports_transparency())
    |         ---------------------------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:491:9
    |
491 |         gl_api_dispatch!(self; Self(config) => config.api())
    |         ---------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:61:19
    |
61  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:499:9
    |
499 |         gl_api_dispatch!(self; Self(config) => config.display(); as Display)
    |         -------------------------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
61  ~             match $what {
62  +                 _ => todo!(),
63  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Config` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:534:9
    |
534 |         gl_api_dispatch!(self; Self(config) => config.raw_config())
    |         ----------------------------------------------------------- in this macro invocation
    |
note: `Config` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\config.rs:431:10
    |
431 | pub enum Config {
    |          ^^^^^^
    = note: the matched value is of type `&Config`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&NotCurrentContext` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:443:9
    |
443 |         gl_api_dispatch!(self; Self(context) => context.context_api())
    |         -------------------------------------------------------------- in this macro invocation
    |
note: `NotCurrentContext` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:363:10
    |
363 | pub enum NotCurrentContext {
    |          ^^^^^^^^^^^^^^^^^
    = note: the matched value is of type `&NotCurrentContext`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&NotCurrentContext` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:61:19
    |
61  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:451:9
    |
451 |         gl_api_dispatch!(self; Self(context) => context.config(); as Config)
    |         -------------------------------------------------------------------- in this macro invocation
    |
note: `NotCurrentContext` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:363:10
    |
363 | pub enum NotCurrentContext {
    |          ^^^^^^^^^^^^^^^^^
    = note: the matched value is of type `&NotCurrentContext`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
61  ~             match $what {
62  +                 _ => todo!(),
63  +             }
    |

error[E0004]: non-exhaustive patterns: type `&NotCurrentContext` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:61:19
    |
61  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:459:9
    |
459 |         gl_api_dispatch!(self; Self(context) => context.display(); as Display)
    |         ---------------------------------------------------------------------- in this macro invocation
    |
note: `NotCurrentContext` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:363:10
    |
363 | pub enum NotCurrentContext {
    |          ^^^^^^^^^^^^^^^^^
    = note: the matched value is of type `&NotCurrentContext`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
61  ~             match $what {
62  +                 _ => todo!(),
63  +             }
    |

error[E0004]: non-exhaustive patterns: type `&NotCurrentContext` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:465:9
    |
465 |         gl_api_dispatch!(self; Self(context) => context.raw_context())
    |         -------------------------------------------------------------- in this macro invocation
    |
note: `NotCurrentContext` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:363:10
    |
363 | pub enum NotCurrentContext {
    |          ^^^^^^^^^^^^^^^^^
    = note: the matched value is of type `&NotCurrentContext`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&PossiblyCurrentContext` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:511:9
    |
511 |         gl_api_dispatch!(self; Self(context) => context.is_current())
    |         ------------------------------------------------------------- in this macro invocation
    |
note: `PossiblyCurrentContext` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:488:10
    |
488 | pub enum PossiblyCurrentContext {
    |          ^^^^^^^^^^^^^^^^^^^^^^
    = note: the matched value is of type `&PossiblyCurrentContext`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&PossiblyCurrentContext` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:563:9
    |
563 |         gl_api_dispatch!(self; Self(context) => context.context_api())
    |         -------------------------------------------------------------- in this macro invocation
    |
note: `PossiblyCurrentContext` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:488:10
    |
488 | pub enum PossiblyCurrentContext {
    |          ^^^^^^^^^^^^^^^^^^^^^^
    = note: the matched value is of type `&PossiblyCurrentContext`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&PossiblyCurrentContext` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:61:19
    |
61  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:571:9
    |
571 |         gl_api_dispatch!(self; Self(context) => context.config(); as Config)
    |         -------------------------------------------------------------------- in this macro invocation
    |
note: `PossiblyCurrentContext` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:488:10
    |
488 | pub enum PossiblyCurrentContext {
    |          ^^^^^^^^^^^^^^^^^^^^^^
    = note: the matched value is of type `&PossiblyCurrentContext`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
61  ~             match $what {
62  +                 _ => todo!(),
63  +             }
    |

error[E0004]: non-exhaustive patterns: type `&PossiblyCurrentContext` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:61:19
    |
61  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:579:9
    |
579 |         gl_api_dispatch!(self; Self(context) => context.display(); as Display)
    |         ---------------------------------------------------------------------- in this macro invocation
    |
note: `PossiblyCurrentContext` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:488:10
    |
488 | pub enum PossiblyCurrentContext {
    |          ^^^^^^^^^^^^^^^^^^^^^^
    = note: the matched value is of type `&PossiblyCurrentContext`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
61  ~             match $what {
62  +                 _ => todo!(),
63  +             }
    |

error[E0004]: non-exhaustive patterns: type `&PossiblyCurrentContext` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:585:9
    |
585 |         gl_api_dispatch!(self; Self(context) => context.raw_context())
    |         -------------------------------------------------------------- in this macro invocation
    |
note: `PossiblyCurrentContext` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\context.rs:488:10
    |
488 | pub enum PossiblyCurrentContext {
    |          ^^^^^^^^^^^^^^^^^^^^^^
    = note: the matched value is of type `&PossiblyCurrentContext`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&display::Display` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:271:15
    |
271 |         match self {
    |               ^^^^
    |
note: `display::Display` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:178:10
    |
178 | pub enum Display {
    |          ^^^^^^^
    = note: the matched value is of type `&display::Display`
    = note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
271 ~         match self {
272 +             _ => todo!(),
273 +         }
    |

error[E0004]: non-exhaustive patterns: type `&display::Display` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:396:9
    |
396 |         gl_api_dispatch!(self; Self(display) => display.get_proc_address(addr))
    |         ----------------------------------------------------------------------- in this macro invocation
    |
note: `display::Display` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:178:10
    |
178 | pub enum Display {
    |          ^^^^^^^
    = note: the matched value is of type `&display::Display`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&display::Display` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:400:9
    |
400 |         gl_api_dispatch!(self; Self(display) => display.version_string())
    |         ----------------------------------------------------------------- in this macro invocation
    |
note: `display::Display` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:178:10
    |
178 | pub enum Display {
    |          ^^^^^^^
    = note: the matched value is of type `&display::Display`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&display::Display` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:404:9
    |
404 |         gl_api_dispatch!(self; Self(display) => display.supported_features())
    |         --------------------------------------------------------------------- in this macro invocation
    |
note: `display::Display` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:178:10
    |
178 | pub enum Display {
    |          ^^^^^^^
    = note: the matched value is of type `&display::Display`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&display::Display` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:410:9
    |
410 |         gl_api_dispatch!(self; Self(display) => display.raw_display())
    |         -------------------------------------------------------------- in this macro invocation
    |
note: `display::Display` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\display.rs:178:10
    |
178 | pub enum Display {
    |          ^^^^^^^
    = note: the matched value is of type `&display::Display`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Surface<T>` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:301:9
    |
301 |         gl_api_dispatch!(self; Self(surface) => surface.buffer_age())
    |         ------------------------------------------------------------- in this macro invocation
    |
note: `Surface<T>` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:278:10
    |
278 | pub enum Surface<T: SurfaceTypeTrait> {
    |          ^^^^^^^
    = note: the matched value is of type `&Surface<T>`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Surface<T>` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:305:9
    |
305 |         gl_api_dispatch!(self; Self(surface) => surface.width())
    |         -------------------------------------------------------- in this macro invocation
    |
note: `Surface<T>` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:278:10
    |
278 | pub enum Surface<T: SurfaceTypeTrait> {
    |          ^^^^^^^
    = note: the matched value is of type `&Surface<T>`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Surface<T>` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:309:9
    |
309 |         gl_api_dispatch!(self; Self(surface) => surface.height())
    |         --------------------------------------------------------- in this macro invocation
    |
note: `Surface<T>` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:278:10
    |
278 | pub enum Surface<T: SurfaceTypeTrait> {
    |          ^^^^^^^
    = note: the matched value is of type `&Surface<T>`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Surface<T>` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:313:9
    |
313 |         gl_api_dispatch!(self; Self(surface) => surface.is_single_buffered())
    |         --------------------------------------------------------------------- in this macro invocation
    |
note: `Surface<T>` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:278:10
    |
278 | pub enum Surface<T: SurfaceTypeTrait> {
    |          ^^^^^^^
    = note: the matched value is of type `&Surface<T>`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Surface<T>` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:61:19
    |
61  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:456:9
    |
456 |         gl_api_dispatch!(self; Self(surface) => surface.display(); as Display)
    |         ---------------------------------------------------------------------- in this macro invocation
    |
note: `Surface<T>` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:278:10
    |
278 | pub enum Surface<T: SurfaceTypeTrait> {
    |          ^^^^^^^
    = note: the matched value is of type `&Surface<T>`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
61  ~             match $what {
62  +                 _ => todo!(),
63  +             }
    |

error[E0004]: non-exhaustive patterns: type `&Surface<T>` is non-empty
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\lib.rs:73:19
    |
73  |             match $what {
    |                   ^^^^^
    |
   ::: C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:462:9
    |
462 |         gl_api_dispatch!(self; Self(surface) => surface.raw_surface())
    |         -------------------------------------------------------------- in this macro invocation
    |
note: `Surface<T>` defined here
   --> C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glutin-0.32.0\src\surface.rs:278:10
    |
278 | pub enum Surface<T: SurfaceTypeTrait> {
    |          ^^^^^^^
    = note: the matched value is of type `&Surface<T>`
    = note: references are always considered inhabited
    = note: this error originates in the macro `gl_api_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
73  ~             match $what {
74  +                 _ => todo!(),
75  +             }
    |

Some errors have detailed explanations: E0004, E0277, E0392.
For more information about an error, try `rustc --explain E0004`.
error: could not compile `glutin` (lib) due to 36 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `skia-bindings v0.75.0`

Caused by:
  process didn't exit successfully: `C:\Workspace\VSCode_Workspace\slint_learn\target\release\build\skia-bindings-45edd30bc956513f\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=DOCS_RS
  cargo:rerun-if-env-changed=SKIA_DEBUG
  HOST: x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=SKIA_SOURCE_DIR
  cargo:rerun-if-env-changed=FORCE_SKIA_BUILD
  cargo:rerun-if-env-changed=FORCE_SKIA_BINARIES_DOWNLOAD
  TRYING TO DOWNLOAD AND INSTALL SKIA BINARIES: 0.75.0/e7e538647512cab844c3-wasm32-unknown-unknown-gl-textlayout
  cargo:rerun-if-env-changed=SKIA_BINARIES_URL
    FROM: https://github.com/rust-skia/skia-binaries/releases/download/0.75.0/skia-binaries-e7e538647512cab844c3-wasm32-unknown-unknown-gl-textlayout.tar.gz
  DOWNLOAD AND INSTALL FAILED: curl error code: Some(22)
  curl stderr: Ok("")
  STARTING A FULL BUILD
  cargo:rerun-if-env-changed=CLANGCC
  cargo:rerun-if-env-changed=CC
  cargo:rerun-if-env-changed=CLANGCXX
  cargo:rerun-if-env-changed=CXX
  HOST: x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=OPT_LEVEL
  cargo:rerun-if-env-changed=SKIA_USE_SYSTEM_LIBRARIES
  HOST: x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=SDKTARGETSYSROOT
  cargo:rerun-if-env-changed=SDKROOT
  HOST: x86_64-pc-windows-msvc
  HOST: x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=SKIA_NINJA_COMMAND
  cargo:rerun-if-env-changed=SKIA_GN_COMMAND
  Probing 'python'
  Python 3 found: "python"
  Synchronizing Skia dependencies
  DOWNLOADING: https://codeload.github.com/rust-skia/skia/tar.gz/m126-0.74.2

  --- stderr
  thread 'main' panicked at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\skia-bindings-0.75.0\build_support\binary_cache\download.rs:93:43:
  called `Result::unwrap()` on an `Err` value: Custom { kind: Uncategorized, error: TarError { desc: "failed to unpack `C:\\Users\\paul\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\skia-bindings-0.75.0\\skia-m126-0.74.2\\bazel\\external\\expat\\config\\expat_config.h`", io: Custom { kind: Uncategorized, error: "客户端没有所需的特权。 (os error 1314) when symlinking ../../../../third_party/expat/include/expat_config/expat_config.h to C:\\Users\\paul\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\skia-bindings-0.75.0\\skia-m126-0.74.2\\bazel\\external\\expat\\config\\expat_config.h" } } }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: Compiling your crate to WebAssembly failed
Caused by: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit code: 101
  full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"

In the last segment of the error message, I found the following contents:

TRYING TO DOWNLOAD AND INSTALL SKIA BINARIES: 0.75.0/e7e538647512cab844c3-wasm32-unknown-unknown-gl-textlayout
  cargo:rerun-if-env-changed=SKIA_BINARIES_URL
    FROM: https://github.com/rust-skia/skia-binaries/releases/download/0.75.0/skia-binaries-e7e538647512cab844c3-wasm32-unknown-unknown-gl-textlayout.tar.gz
  DOWNLOAD AND INSTALL FAILED: curl error code: Some(22)
  curl stderr: Ok("")

It appears that there was an attempt to download the file skia-binaries-e7e538647512cab844c3-wasm32-unknown-unknown-gl-textlayout.tar.gz from GitHub, which seems to have failed.

I then checked the repository at https://github.com/rust-skia/skia-binaries/releases/tag/0.75.0. Indeed, the file skia-binaries-e7e538647512cab844c3-wasm32-unknown-unknown-gl-textlayout.tar.gz is not present there.

A similar name I did find was for the binary file skia-binaries-e7e538647512cab844c3-wasm32-unknown-emscripten-gl-textlayout.tar.gz.

Perhaps this discrepancy is the reason why the compilation to wasm failed.

Slint can't be compiled for wasm32-unknown-unknown when the renderer-skia feature is enabled. You must use the renderer-femtovg feature for wasm builds.

I suppose we could do a compile_error!() in renderer-skia when targeting wasm. @ogoffart what do you think? (I can do it, but want to run it by you first)

I don't think we can do a compile_error easily, because the problem is already in the dependencies.

Ah indeed. Closing this issue as Skia can’t be built with wasm.

I think that you should report an issue with upstream. There's a possibility that in the future, the upstream might add support for wasm32-unknown-unknown in addition to wasm32-unknown-emscripten. If this were to happen, Slint would also benefit.

I think that would be rust-skia/rust-skia#982