slint-ui/slint · error

not implemented

Error message

not implemented

What it means

The linuxkms backend crate compiles on non-Linux platforms as a stub: its Backend's create_window_adapter returns the error 'The linuxkms backend is only supported on Linux', and run_event_loop() is `unimplemented!()` — a panic. Reaching run_event_loop means the stub backend was selected (e.g. via SLINT_BACKEND) on Windows or macOS.

Source

Thrown at internal/backends/linuxkms/noop_backend.rs:24

impl Backend {
    pub fn build(_builder: super::BackendBuilder) -> Result<Self, PlatformError> {
        Ok(Backend {})
    }
}

impl i_slint_core::platform::Platform for Backend {
    fn create_window_adapter(
        &self,
    ) -> Result<
        std::rc::Rc<dyn i_slint_core::window::WindowAdapter>,
        i_slint_core::platform::PlatformError,
    > {
        Err("The linuxkms backend is only supported on Linux".into())
    }

    fn run_event_loop(&self) -> Result<(), PlatformError> {
        unimplemented!()
    }
}

View on GitHub (pinned to a9ea814a58)

Solutions

  1. Use the default winit backend on desktop platforms; unset SLINT_BACKEND or set it to winit.
  2. Gate linuxkms dependencies/selection to `target_os = "linux"` in Cargo config and build scripts.
  3. If linuxkms was the only compiled backend, rebuild with backend-winit enabled for that platform.

Example fix

# before
SLINT_BACKEND=linuxkms cargo run   # on macOS/Windows -> panic in run_event_loop

# after
unset SLINT_BACKEND
cargo run                           # selects winit backend
Defensive patterns

Strategy: validation

Validate before calling

// Refuse to select linuxkms outside Linux before anything runs
#ifdef SLINT_BACKEND_CHECK
if (std::env::var("SLINT_BACKEND").as_deref() == Ok("linuxkms") && !cfg!(target_os = "linux")) {
    eprintln!("linuxkms backend is Linux-only; unset SLINT_BACKEND");
    std::process::exit(1);
}
#endif

Prevention

When it happens

Trigger: Setting SLINT_BACKEND=linuxkms (or building with linuxkms as the only backend feature) on a non-Linux OS and calling slint::run_event_loop() (or i_slint_backend_selector's run), which dispatches to the stub's unimplemented run_event_loop.

Common situations: An SLINT_BACKEND variable copied from an embedded Linux target leaking into a desktop/CI build; a Cargo config enabling backend-linuxkms without a target-os gate; docs/tutorials for embedded KMS followed on macOS/Windows.

Related errors


AI-assisted analysis of slint-ui/slint@a9ea814a58 (2026-08-16). Data as JSON: /api/errors/2e1978f431efc130. Report an issue: GitHub.