wasmerio/wasmer · error · anyhow::Error

The lldb profiler requires --experimental-artifact

Error message

The lldb profiler requires --experimental-artifact

What it means

Same contract as the gdb profiler: the lldb profiler requires the experimental artifact instrumentation to attach. validate_profiler bails when Profiler::Lldb is selected while experimental_artifact is false.

Source

Thrown at lib/cli/src/backend.rs:230

            "gdb" => Ok(Self::Gdb),
            "lldb" => Ok(Self::Lldb),
            _ => Err(anyhow::anyhow!("Unrecognized profiler: {s}")),
        }
    }
}

impl RuntimeOptions {
    fn validate_profiler(&self) -> Result<()> {
        if self.experimental_artifact && !cfg!(target_os = "linux") {
            bail!("--experimental-artifact is only supported on Linux");
        }
        if !self.experimental_artifact {
            match self.profiler {
                Some(Profiler::Gdb) => {
                    bail!("The gdb profiler requires --experimental-artifact")
                }
                Some(Profiler::Lldb) => {
                    bail!("The lldb profiler requires --experimental-artifact")
                }
                _ => {}
            }
        }
        Ok(())
    }

    pub fn get_available_backends(&self) -> Result<Vec<BackendType>> {
        // If a specific backend is explicitly requested, use it
        #[cfg(feature = "cranelift")]
        {
            if self.cranelift {
                return Ok(vec![BackendType::Cranelift]);
            }
        }

        #[cfg(feature = "llvm")]
        {

View on GitHub (pinned to 8c4b9ee9d3)

Solutions

  1. Add --experimental-artifact alongside --profile lldb
  2. Set RuntimeOptions.experimental_artifact = true when selecting Profiler::Lldb
  3. Remove the lldb profiler option if profiling is not intended

Example fix

// before
let opts = RuntimeOptions { profiler: Some(Profiler::Lldb), experimental_artifact: false, .. };
// after
let opts = RuntimeOptions { profiler: Some(Profiler::Lldb), experimental_artifact: true, .. };
Defensive patterns

Strategy: validation

Validate before calling

if matches!(opts.profiler, Some(Profiler::Lldb)) && !opts.experimental_artifact {
    eprintln!("lldb profiler needs --experimental-artifact; enabling");
    opts.experimental_artifact = true;
}

Type guard

fn profiler_config_valid(opts: &RuntimeOptions) -> bool {
    !matches!(opts.profiler, Some(Profiler::Gdb | Profiler::Lldb)) || opts.experimental_artifact
}

Try / catch

match result {
    Err(e) if e.to_string().contains("requires --experimental-artifact") => retry_with_artifact_flag(),
    other => other?,
}

Prevention

When it happens

Trigger: Passing Profiler::Lldb (or --profile lldb) without --experimental-artifact, when get_sys_compiler_config/get_engine builds the engine.

Common situations: Running `wasmer run --profile lldb` without the experimental flag; CI profiling jobs missing the flag; enabling lldb profiling in a config file without the counterpart setting.

Related errors


AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01). Data as JSON: /api/errors/fa87318b739119d8. Report an issue: GitHub.