Skip to main content

phase_discovery

Function phase_discovery 

Source
pub fn phase_discovery(
    trees: &[(PathBuf, PathBuf)],
    excludes: &[PathBuf],
    errors: &mut ErrorSink,
) -> Result<Vec<Vec<PathBuf>>, ()>
Expand description

Phase 1: discover the .bynk files under the source (and, in split mode, the tests) root by walking the filesystem. Pushes any discovery error into errors and signals a pipeline bail via Err(()) (the caller terminates with finish); otherwise returns the discovered (src_files, tests_files).

#1077/#1081 review: this is the on-disk half only — no_sources/ check_file_directory_conflicts moved to check_discovered_files, which run_checks calls on the result either this walk or a caller-supplied discovered list produces, so a CompileOptions.sources-driven compile (the CLI’s own path as of #1081) still gets both checks — they are properties of “what files does this build have,” not of having just walked the disk to find them. R3.9 (#1113): walks every (root, prefix) tree Roots::trees resolves to, not a hardcoded primary/secondary pair — trees[0] is the mandatory tree (a missing directory is a real error, via discover_bynk_files itself); every later tree is optional, same as the old secondary tree always was (a project may simply have no such subtree).