sinelaw/fresh · error

this build was compiled without self-update support…

Error message

this build was compiled without self-update support; download the latest release from https://github.com/sinelaw/fresh/releases

What it means

The editor was invoked with the self-update command but the binary was compiled without the `self-update` cargo feature, so the update path is unimplemented. main.rs:5047 bails early in the `#[cfg(not(feature = "self-update"))]` branch instead of attempting an update. The message directs users to download a prebuilt release manually.

Solutions

  1. Download and install the latest release manually from https://github.com/sinelaw/fresh/releases
  2. Rebuild from source with the feature enabled: `cargo build --release --features self-update`
  3. Update via the original installation channel (package manager, cargo install, etc.) instead of the in-app updater

Example fix

// before
cargo build --release
fresh --update  // this build was compiled without self-update support
// after
cargo build --release --features self-update
fresh --update  // works
Defensive patterns

Strategy: fallback

Validate before calling

let self_update_enabled = cfg!(feature = "self-update");
if !self_update_enabled {
    eprintln!("self-update unavailable; install from https://github.com/sinelaw/fresh/releases");
}

Try / catch

match fresh.update() {
    Err(e) if e.to_string().contains("without self-update support") => download_release_manually(),
    other => other?,
}

Prevention

When it happens

Trigger: Running `fresh --update` (or equivalent self-update CLI args, passed via `args`) on a binary built without `--features self-update`, e.g. a distro package or a default `cargo build`.

Common situations: Installing via a package manager that strips the feature; building from source with plain `cargo build --release`; CI artifacts compiled without the feature; users expecting the update subcommand to exist because the released binaries have it.

Related errors


AI-assisted analysis of sinelaw/fresh@67894ca546 (2026-09-13). Data as JSON: /api/errors/a698ae0aaa3907c4. Report an issue: GitHub.

Appendix: source

Thrown at crates/fresh-editor/src/main.rs:5047

        //                        printed what the user has to do, so add
        //                        nothing here
        //   - Err             -> clean one-line "Error: <msg>", exit 1
        use fresh_update::engine::UpdateStatus;
        match fresh_update::engine::run(fresh::services::release_checker::CURRENT_VERSION, &opts) {
            Ok(UpdateStatus::Done) => Ok(()),
            Ok(UpdateStatus::ActionRequired) => {
                std::process::exit(fresh_update::EXIT_ACTION_REQUIRED)
            }
            Err(e) => {
                eprintln!("Error: {e}");
                std::process::exit(1);
            }
        }
    }
    #[cfg(not(feature = "self-update"))]
    {
        let _ = args;
        anyhow::bail!(
            "this build was compiled without self-update support; \
             download the latest release from https://github.com/sinelaw/fresh/releases"
        );
    }
}

fn dump_config_command(args: &Args) -> AnyhowResult<()> {
    let dir_context = fresh::config_io::DirectoryContext::from_system()?;
    let working_dir = std::env::current_dir().unwrap_or_default();
    let config = if let Some(config_path) = &args.config {
        config::Config::load_from_file(config_path)
            .with_context(|| format!("Failed to load config from {}", config_path.display()))?
    } else {
        config::Config::load_with_layers(&dir_context, &working_dir)
    };
    println!(
        "{}",
        serde_json::to_string_pretty(&config).context("Failed to serialize config")?

View on GitHub (pinned to 67894ca546)