{"record":{"id":"18c3bc8cb8a8368f","repo":"xai-org/grok-build","slug":"not-available-in-this-build","errorCode":null,"errorMessage":"not available in this build","messagePattern":"not available in this build","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-fast-worktree/src/lib.rs","lineNumber":94,"sourceCode":"};\npub use git::{\n    KeepReason, Reclaim, reclaimable_after_snapshot, remove_stale_worktree_registration,\n    remove_stale_worktree_registrations_under,\n};\npub use metrics::{\n    grove_wt_create_count, grove_wt_create_last_duration_ns, record_grove_wt_create,\n};\npub use nfs::create_latency_stamp;\npub use nfs::{\n    CleanArtifactsReply, DetachReply, NfsAdopted, NfsCreateDecision, NfsStatusView,\n    NfsWorktreeClient, NfsWorktreeOpts, SalvageReply, dest_is_known_unmounted, dest_is_mountpoint,\n    dest_is_nfs_mount, source_is_linked_local_view,\n};\npub fn local_salvage(\n    _dest: &std::path::Path,\n    _out: &std::path::Path,\n) -> anyhow::Result<SalvageReply> {\n    anyhow::bail!(\"not available in this build\")\n}\npub fn local_clean_artifacts(_dest: &std::path::Path) -> anyhow::Result<CleanArtifactsReply> {\n    anyhow::bail!(\"not available in this build\")\n}\npub use sync::{SourceDirtyState, SyncReport, WorktreeSync, collect_source_dirty_state};\n#[cfg(target_os = \"linux\")]\npub use worktree::execute::cleanup_snapshot_git_state;\npub use worktree::{STRATEGY_GROVE_FUSE, STRATEGY_GROVE_NFS, STRATEGY_NFS, is_grove_strategy};\n/// Count the number of tracked files in a git repository's index.\n///\n/// Reads the index header via `gix`, which contains the entry count — this\n/// is an O(1) read (no directory walk). Useful for deciding whether a repo\n/// is large enough to benefit from worktree pooling.\npub fn count_tracked_files(repo_path: &std::path::Path) -> anyhow::Result<usize> {\n    let repo = gix::discover(repo_path)\n        .map_err(|e| anyhow::anyhow!(\"failed to discover git repo: {e}\"))?;\n    let index = repo\n        .index_or_load_from_head()","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-fast-worktree/src/lib.rs#L76-L112","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use the platform-native salvage path instead (NfsWorktreeClient::salvage_worktree or the Linux-gated implementation).","Gate the call site with #[cfg(target_os = \"linux\")] (or the matching feature flag) so the stub is never invoked.","Check the crate's feature flags in Cargo.toml and enable the one that compiles the real salvage implementation.","If salvage isn't needed on this platform, handle the error as 'unsupported operation' and skip it rather than propagating."],"exampleFix":"// before: unconditional call, fails on non-Linux builds\nlet reply = local_salvage(&dest, &out)?;\n// after\n#[cfg(target_os = \"linux\")]\nlet reply = local_salvage(&dest, &out)?;\n#[cfg(not(target_os = \"linux\"))]\nlet reply = anyhow::bail!(\"salvage unsupported on this platform; skipping\");","handlingStrategy":"fallback","validationCode":"const LOCAL_SALVAGE_SUPPORTED: bool = cfg!(target_os = \"linux\");","typeGuard":"fn local_salvage_available() -> bool { cfg!(target_os = \"linux\") }","tryCatchPattern":"match local_salvage(&dest, &out) {\n    Err(e) if e.to_string() == \"not available in this build\" => {\n        tracing::info!(\"salvage unsupported in this build; using NFS client path or skipping\");\n        nfs_client.salvage_worktree(&dest, &out)?;\n    }\n    Err(e) => return Err(e),\n    Ok(reply) => use(reply),\n}","preventionTips":["Gate salvage call sites with cfg(target_os = \"linux\") or the required feature flag.","Verify crate features in Cargo.toml before relying on local salvage.","Route non-Linux platforms through NfsWorktreeClient::salvage_worktree.","Never call the local_* helpers from platform-agnostic code paths."],"tags":["unsupported-platform","stub","compile-time-gating","rust"],"backgroundTag":"not-available-in-this-build","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}