xai-org/grok-build · error

not available in this build

Error message

not available in this build

What it means

The non-Linux (feature-gated fallback) build of xai-fast-worktree provides local_salvage as a stub that unconditionally fails with 'not available in this build'. Salvage of a worktree's local changes to an output path is only implemented on platforms with the real backend; the stub exists so the public API compiles everywhere. Calling it is a programming/configuration error, not a runtime condition.

Source

Thrown at crates/codegen/xai-fast-worktree/src/lib.rs:94

};
pub use git::{
    KeepReason, Reclaim, reclaimable_after_snapshot, remove_stale_worktree_registration,
    remove_stale_worktree_registrations_under,
};
pub use metrics::{
    grove_wt_create_count, grove_wt_create_last_duration_ns, record_grove_wt_create,
};
pub use nfs::create_latency_stamp;
pub use nfs::{
    CleanArtifactsReply, DetachReply, NfsAdopted, NfsCreateDecision, NfsStatusView,
    NfsWorktreeClient, NfsWorktreeOpts, SalvageReply, dest_is_known_unmounted, dest_is_mountpoint,
    dest_is_nfs_mount, source_is_linked_local_view,
};
pub fn local_salvage(
    _dest: &std::path::Path,
    _out: &std::path::Path,
) -> anyhow::Result<SalvageReply> {
    anyhow::bail!("not available in this build")
}
pub fn local_clean_artifacts(_dest: &std::path::Path) -> anyhow::Result<CleanArtifactsReply> {
    anyhow::bail!("not available in this build")
}
pub use sync::{SourceDirtyState, SyncReport, WorktreeSync, collect_source_dirty_state};
#[cfg(target_os = "linux")]
pub use worktree::execute::cleanup_snapshot_git_state;
pub use worktree::{STRATEGY_GROVE_FUSE, STRATEGY_GROVE_NFS, STRATEGY_NFS, is_grove_strategy};
/// Count the number of tracked files in a git repository's index.
///
/// Reads the index header via `gix`, which contains the entry count — this
/// is an O(1) read (no directory walk). Useful for deciding whether a repo
/// is large enough to benefit from worktree pooling.
pub fn count_tracked_files(repo_path: &std::path::Path) -> anyhow::Result<usize> {
    let repo = gix::discover(repo_path)
        .map_err(|e| anyhow::anyhow!("failed to discover git repo: {e}"))?;
    let index = repo
        .index_or_load_from_head()

View on GitHub (pinned to bc7f02eddd)

Solutions

  1. Use the platform-native salvage path instead (NfsWorktreeClient::salvage_worktree or the Linux-gated implementation).
  2. Gate the call site with #[cfg(target_os = "linux")] (or the matching feature flag) so the stub is never invoked.
  3. Check the crate's feature flags in Cargo.toml and enable the one that compiles the real salvage implementation.
  4. If salvage isn't needed on this platform, handle the error as 'unsupported operation' and skip it rather than propagating.

Example fix

// before: unconditional call, fails on non-Linux builds
let reply = local_salvage(&dest, &out)?;
// after
#[cfg(target_os = "linux")]
let reply = local_salvage(&dest, &out)?;
#[cfg(not(target_os = "linux"))]
let reply = anyhow::bail!("salvage unsupported on this platform; skipping");
Defensive patterns

Strategy: fallback

Validate before calling

const LOCAL_SALVAGE_SUPPORTED: bool = cfg!(target_os = "linux");

Type guard

fn local_salvage_available() -> bool { cfg!(target_os = "linux") }

Try / catch

match local_salvage(&dest, &out) {
    Err(e) if e.to_string() == "not available in this build" => {
        tracing::info!("salvage unsupported in this build; using NFS client path or skipping");
        nfs_client.salvage_worktree(&dest, &out)?;
    }
    Err(e) => return Err(e),
    Ok(reply) => use(reply),
}

Prevention

When it happens

Trigger: Calling xai_fast_worktree::local_salvage(dest, out) in a build where the platform-gated implementation is compiled out (e.g. macOS/Windows, or a build without the required feature flags). Every call fails, always.

Common situations: Code written against the crate compiled for the wrong target; a feature flag dropped from Cargo.toml so the stub was selected; tests running on CI images for a non-supported OS; calling the salvage path unconditionally without checking platform support.

Related errors


AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31). Data as JSON: /api/errors/18c3bc8cb8a8368f. Report an issue: GitHub.