slint-ui/slint · critical

the renderer-software feature must be enabled in…

Error message

the renderer-software feature must be enabled in i-slint-compiler when embedding textures

What it means

CompilerConfiguration::new panics at compile time of the consuming build when texture embedding is requested (via SLINT_EMBED_TEXTURES or DEP_MCU_BOARD_SUPPORT_MCU_EMBED_TEXTURES) but the `renderer-software` feature is not enabled on i-slint-compiler. Embedded textures are only supported by the software renderer, so this configuration is invalid.

Solutions

  1. Enable the renderer-software feature on i-slint-compiler in Cargo.toml: `i-slint-compiler = { version = "...", features = ["renderer-software"] }`
  2. If you don't need embedded textures, unset the SLINT_EMBED_TEXTURES env var and remove DEP_MCU_BOARD_SUPPORT_MCU_EMBED_TEXTURES-triggering dependency features
  3. Use an existing embedded demo template (e.g. mcu-board-support setup) that already enables the correct feature combination

Example fix

// before (Cargo.toml)
i-slint-compiler = "1.0"
// after
i-slint-compiler = { version = "1.0", features = ["renderer-software"] }
Defensive patterns

Strategy: validation

Validate before calling

# build-time guard (build.rs or CI shell)
if [ -n "$SLINT_EMBED_TEXTURES" ]; then
  grep -q 'renderer-software' Cargo.toml || echo "ERROR: enable i-slint-compiler renderer-software feature" && exit 1
fi

Prevention

When it happens

Trigger: Building firmware/embedded projects with SLINT_EMBED_TEXTURES set (or the mcu-board-support dep requesting embedded textures) while i-slint-compiler was built without `features = ["renderer-software"]`.

Common situations: Embedded (MCU) builds using the pico/stm32 board support crates; cargo build of an embedded demo where the compiler feature flags were trimmed or never added.

Related errors


AI-assisted analysis of slint-ui/slint@3a7e700487 (2026-09-16). Data as JSON: /api/errors/0eebcad3fb810047. Report an issue: GitHub.

Appendix: source

Thrown at internal/compiler/lib.rs:241

    /// The absolute path of the directory the translations are bundled from, if any.
    pub fn absolute_bundled_translations_path(&self) -> Option<String> {
        #[cfg(feature = "bundle-translations")]
        return self.bundled_translations_path.as_ref().map(|path| {
            std::path::absolute(path)
                .unwrap_or_else(|_| path.clone())
                .to_string_lossy()
                .into_owned()
        });
        #[cfg(not(feature = "bundle-translations"))]
        return None;
    }

    pub fn new(output_format: OutputFormat) -> Self {
        let embed_resources = if std::env::var_os("SLINT_EMBED_TEXTURES").is_some()
            || std::env::var_os("DEP_MCU_BOARD_SUPPORT_MCU_EMBED_TEXTURES").is_some()
        {
            #[cfg(not(feature = "renderer-software"))]
            panic!(
                "the renderer-software feature must be enabled in i-slint-compiler when embedding textures"
            );
            #[cfg(feature = "renderer-software")]
            EmbedResourcesKind::EmbedTextures
        } else if let Ok(var) = std::env::var("SLINT_EMBED_RESOURCES") {
            let var = var.parse::<bool>().unwrap_or_else(|_|{
                panic!("SLINT_EMBED_RESOURCES has incorrect value. Must be either unset, 'true' or 'false'")
            });
            match var {
                true => EmbedResourcesKind::EmbedAllResources,
                false => EmbedResourcesKind::OnlyBuiltinResources,
            }
        } else {
            match output_format {
                #[cfg(feature = "rust")]
                OutputFormat::Rust => EmbedResourcesKind::EmbedAllResources,
                OutputFormat::Interpreter => EmbedResourcesKind::Nothing,
                _ => EmbedResourcesKind::OnlyBuiltinResources,

View on GitHub (pinned to 3a7e700487)