local_source

Function local_source 

Source
pub fn local_source(source_path: &Path) -> Result<AcquiredSource>
Expand description

Use a local kernel source tree.

Dirty detection uses gix tree_index_status (HEAD-vs-index) and status().into_index_worktree_iter() (index-vs-worktree) to check for modifications to tracked files. Submodule checks are skipped entirely. Untracked files do not affect the dirty flag.

When the tree is dirty, the HEAD commit does not describe the source actually being built, so git_hash is dropped — no commit identifies a dirty worktree. is_dirty=true carries that fact forward; callers (see crate::cli) use it to bypass the kernel cache entirely.

No diagnostic output: all operator-visible messaging for a local source is routed through kernel_build_pipeline’s cache-skip hint (DIRTY_TREE_CACHE_SKIP_HINT / NON_GIT_TREE_CACHE_SKIP_HINT), which has the full context to emit a single informational line rather than two redundant warnings. Sibling entries (download_tarball, git_clone) still take a cli_label because they genuinely print progress lines — local_source does not.