{"record":{"id":"2e1978f431efc130","repo":"slint-ui/slint","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backends/linuxkms/noop_backend.rs","lineNumber":24,"sourceCode":"\nimpl Backend {\n    pub fn build(_builder: super::BackendBuilder) -> Result<Self, PlatformError> {\n        Ok(Backend {})\n    }\n}\n\nimpl i_slint_core::platform::Platform for Backend {\n    fn create_window_adapter(\n        &self,\n    ) -> Result<\n        std::rc::Rc<dyn i_slint_core::window::WindowAdapter>,\n        i_slint_core::platform::PlatformError,\n    > {\n        Err(\"The linuxkms backend is only supported on Linux\".into())\n    }\n\n    fn run_event_loop(&self) -> Result<(), PlatformError> {\n        unimplemented!()\n    }\n}\n","sourceCodeStart":6,"sourceCodeEnd":27,"githubUrl":"https://github.com/slint-ui/slint/blob/a9ea814a5813e7460fa1a867924872095a4d678d/internal/backends/linuxkms/noop_backend.rs#L6-L27","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use the default winit backend on desktop platforms; unset SLINT_BACKEND or set it to winit.","Gate linuxkms dependencies/selection to `target_os = \"linux\"` in Cargo config and build scripts.","If linuxkms was the only compiled backend, rebuild with backend-winit enabled for that platform."],"exampleFix":"# before\nSLINT_BACKEND=linuxkms cargo run   # on macOS/Windows -> panic in run_event_loop\n\n# after\nunset SLINT_BACKEND\ncargo run                           # selects winit backend","handlingStrategy":"validation","validationCode":"// Refuse to select linuxkms outside Linux before anything runs\n#ifdef SLINT_BACKEND_CHECK\nif (std::env::var(\"SLINT_BACKEND\").as_deref() == Ok(\"linuxkms\") && !cfg!(target_os = \"linux\")) {\n    eprintln!(\"linuxkms backend is Linux-only; unset SLINT_BACKEND\");\n    std::process::exit(1);\n}\n#endif","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate linuxkms feature/dependency selection with `[target.'cfg(target_os = \"linux\")'.dependencies]` in Cargo.toml.","Never export SLINT_BACKEND=linuxkms in shared shell profiles or CI images.","Smoke-test run_event_loop() early in main so mis-selection fails fast."],"tags":["linuxkms","backend","platform","panic","env-var"],"backgroundTag":"unsupported-platform-backend","analyzedSha":"a9ea814a5813e7460fa1a867924872095a4d678d","analyzedAt":"2026-08-16T22:39:12.830Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}